aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-07-21 19:34:07 (GMT)
committerPavel Labath <pavelo@centrum.sk>2013-02-18 21:04:23 (GMT)
commitfb0235c51656bf834ec1bc91b0e012321e676d71 (patch)
tree487a60dc90e6ea3641b4cb89555a77d0686e5e04 /src
parent09a76586dec0059dea3ef9183e417e232a0012a2 (diff)
downloadfluxbox_pavel-fb0235c51656bf834ec1bc91b0e012321e676d71.zip
fluxbox_pavel-fb0235c51656bf834ec1bc91b0e012321e676d71.tar.bz2
Attach modifiedSig handlers to the session.screenX.tab.width resource
Diffstat (limited to 'src')
-rw-r--r--src/FbWinFrame.cc4
-rw-r--r--src/Screen.cc9
-rw-r--r--src/Screen.hh2
-rw-r--r--src/Window.cc2
4 files changed, 6 insertions, 11 deletions
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc
index 21de2c5..3185003 100644
--- a/src/FbWinFrame.cc
+++ b/src/FbWinFrame.cc
@@ -319,8 +319,8 @@ void FbWinFrame::alignTabs() {
319 FbTk::Orientation orig_orient = m_tab_container.orientation(); 319 FbTk::Orientation orig_orient = m_tab_container.orientation();
320 unsigned int orig_tabwidth = m_tab_container.maxWidthPerClient(); 320 unsigned int orig_tabwidth = m_tab_container.maxWidthPerClient();
321 321
322 if (orig_tabwidth != m_screen.getTabWidth()) 322 if (orig_tabwidth != *m_screen.getTabWidthResource())
323 m_tab_container.setMaxSizePerClient(m_screen.getTabWidth()); 323 m_tab_container.setMaxSizePerClient(*m_screen.getTabWidthResource());
324 324
325 int tabx = 0, taby = 0; 325 int tabx = 0, taby = 0;
326 switch (*m_screen.getTabPlacementResource()) { 326 switch (*m_screen.getTabPlacementResource()) {
diff --git a/src/Screen.cc b/src/Screen.cc
index 2766c06..1970ad0 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -1513,21 +1513,14 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
1513 menu.removeAll(); 1513 menu.removeAll();
1514 1514
1515 FbTk::MacroCommand *s_a_reconf_macro = new FbTk::MacroCommand(); 1515 FbTk::MacroCommand *s_a_reconf_macro = new FbTk::MacroCommand();
1516 FbTk::MacroCommand *s_a_reconftabs_macro = new FbTk::MacroCommand();
1517 FbTk::RefCount<FbTk::Command<void> > saverc_cmd(new FbTk::SimpleCommand<Fluxbox>( 1516 FbTk::RefCount<FbTk::Command<void> > saverc_cmd(new FbTk::SimpleCommand<Fluxbox>(
1518 *Fluxbox::instance(), 1517 *Fluxbox::instance(),
1519 &Fluxbox::save_rc)); 1518 &Fluxbox::save_rc));
1520 FbTk::RefCount<FbTk::Command<void> > reconf_cmd(FbTk::CommandParser<void>::instance().parse("reconfigure")); 1519 FbTk::RefCount<FbTk::Command<void> > reconf_cmd(FbTk::CommandParser<void>::instance().parse("reconfigure"));
1521 1520
1522 FbTk::RefCount<FbTk::Command<void> > reconftabs_cmd(new FbTk::SimpleCommand<BScreen>(
1523 *this,
1524 &BScreen::reconfigureTabs));
1525 s_a_reconf_macro->add(saverc_cmd); 1521 s_a_reconf_macro->add(saverc_cmd);
1526 s_a_reconf_macro->add(reconf_cmd); 1522 s_a_reconf_macro->add(reconf_cmd);
1527 s_a_reconftabs_macro->add(saverc_cmd);
1528 s_a_reconftabs_macro->add(reconftabs_cmd);
1529 FbTk::RefCount<FbTk::Command<void> > save_and_reconfigure(s_a_reconf_macro); 1523 FbTk::RefCount<FbTk::Command<void> > save_and_reconfigure(s_a_reconf_macro);
1530 FbTk::RefCount<FbTk::Command<void> > save_and_reconftabs(s_a_reconftabs_macro);
1531 // create focus menu 1524 // create focus menu
1532 // we don't set this to internal menu so will 1525 // we don't set this to internal menu so will
1533 // be deleted toghether with the parent 1526 // be deleted toghether with the parent
@@ -1650,7 +1643,7 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
1650 "Width of external-style tabs"), 1643 "Width of external-style tabs"),
1651 resource.tab_width, 10, 3000, /* silly number */ 1644 resource.tab_width, 10, 3000, /* silly number */
1652 *tab_menu); 1645 *tab_menu);
1653 tab_width_item->setCommand(save_and_reconftabs); 1646 tab_width_item->setCommand(saverc_cmd);
1654 tab_menu->insert(tab_width_item); 1647 tab_menu->insert(tab_width_item);
1655 1648
1656 // menu is 3 wide, 5 down 1649 // menu is 3 wide, 5 down
diff --git a/src/Screen.hh b/src/Screen.hh
index 8d50fbc..b6ca75d 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -133,7 +133,7 @@ public:
133 FbTk::BoolResource &getTabsUsePixmapResource() { return resource.tabs_use_pixmap; } 133 FbTk::BoolResource &getTabsUsePixmapResource() { return resource.tabs_use_pixmap; }
134 const bool getMaxOverTabs() const { return *resource.max_over_tabs; } 134 const bool getMaxOverTabs() const { return *resource.max_over_tabs; }
135 135
136 unsigned int getTabWidth() const { return *resource.tab_width; } 136 FbTk::IntResource &getTabWidthResource() { return resource.tab_width; }
137 /// @return the slit, @see Slit 137 /// @return the slit, @see Slit
138 Slit *slit() { return m_slit.get(); } 138 Slit *slit() { return m_slit.get(); }
139 /// @return the slit, @see Slit 139 /// @return the slit, @see Slit
diff --git a/src/Window.cc b/src/Window.cc
index 6c2cc66..5d64667 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -445,6 +445,8 @@ void FluxboxWindow::init() {
445 FbTk::MemFunIgnoreArgs(*this, &FluxboxWindow::applyDecorations)); 445 FbTk::MemFunIgnoreArgs(*this, &FluxboxWindow::applyDecorations));
446 join(screen().getTabPlacementResource().modifiedSig(), 446 join(screen().getTabPlacementResource().modifiedSig(),
447 FbTk::MemFunIgnoreArgs(*this, &FluxboxWindow::applyDecorations)); 447 FbTk::MemFunIgnoreArgs(*this, &FluxboxWindow::applyDecorations));
448 join(screen().getTabWidthResource().modifiedSig(),
449 FbTk::MemFunIgnoreArgs(*this, &FluxboxWindow::applyDecorations));
448 450
449 /**************************************************/ 451 /**************************************************/
450 /* Read state above here, apply state below here. */ 452 /* Read state above here, apply state below here. */