aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-07-21 19:34:07 (GMT)
committerPavel Labath <pavelo@centrum.sk>2011-11-01 09:57:23 (GMT)
commit2e4111c75bbeb7e566d3742e16efc93ffa5eab87 (patch)
tree79cc6b5b51a57ef8c7a767f6d3c899854f76c8be
parent0326af9b428e5406c465c2efa00ede8d963671f3 (diff)
downloadfluxbox_pavel-2e4111c75bbeb7e566d3742e16efc93ffa5eab87.zip
fluxbox_pavel-2e4111c75bbeb7e566d3742e16efc93ffa5eab87.tar.bz2
Attach modifiedSig handlers to the session.screenX.tab.width resource
-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 6aa65b0..a76df66 100644
--- a/src/FbWinFrame.cc
+++ b/src/FbWinFrame.cc
@@ -316,8 +316,8 @@ void FbWinFrame::alignTabs() {
316 FbTk::Orientation orig_orient = m_tab_container.orientation(); 316 FbTk::Orientation orig_orient = m_tab_container.orientation();
317 unsigned int orig_tabwidth = m_tab_container.maxWidthPerClient(); 317 unsigned int orig_tabwidth = m_tab_container.maxWidthPerClient();
318 318
319 if (orig_tabwidth != m_screen.getTabWidth()) 319 if (orig_tabwidth != *m_screen.getTabWidthResource())
320 m_tab_container.setMaxSizePerClient(m_screen.getTabWidth()); 320 m_tab_container.setMaxSizePerClient(*m_screen.getTabWidthResource());
321 321
322 int tabx = 0, taby = 0; 322 int tabx = 0, taby = 0;
323 switch (*m_screen.getTabPlacementResource()) { 323 switch (*m_screen.getTabPlacementResource()) {
diff --git a/src/Screen.cc b/src/Screen.cc
index 0772048..63143ec 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -1443,21 +1443,14 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
1443 menu.removeAll(); 1443 menu.removeAll();
1444 1444
1445 FbTk::MacroCommand *s_a_reconf_macro = new FbTk::MacroCommand(); 1445 FbTk::MacroCommand *s_a_reconf_macro = new FbTk::MacroCommand();
1446 FbTk::MacroCommand *s_a_reconftabs_macro = new FbTk::MacroCommand();
1447 FbTk::RefCount<FbTk::Command<void> > saverc_cmd(new FbTk::SimpleCommand<Fluxbox>( 1446 FbTk::RefCount<FbTk::Command<void> > saverc_cmd(new FbTk::SimpleCommand<Fluxbox>(
1448 *Fluxbox::instance(), 1447 *Fluxbox::instance(),
1449 &Fluxbox::save_rc)); 1448 &Fluxbox::save_rc));
1450 FbTk::RefCount<FbTk::Command<void> > reconf_cmd(FbTk::CommandParser<void>::instance().parse("reconfigure")); 1449 FbTk::RefCount<FbTk::Command<void> > reconf_cmd(FbTk::CommandParser<void>::instance().parse("reconfigure"));
1451 1450
1452 FbTk::RefCount<FbTk::Command<void> > reconftabs_cmd(new FbTk::SimpleCommand<BScreen>(
1453 *this,
1454 &BScreen::reconfigureTabs));
1455 s_a_reconf_macro->add(saverc_cmd); 1451 s_a_reconf_macro->add(saverc_cmd);
1456 s_a_reconf_macro->add(reconf_cmd); 1452 s_a_reconf_macro->add(reconf_cmd);
1457 s_a_reconftabs_macro->add(saverc_cmd);
1458 s_a_reconftabs_macro->add(reconftabs_cmd);
1459 FbTk::RefCount<FbTk::Command<void> > save_and_reconfigure(s_a_reconf_macro); 1453 FbTk::RefCount<FbTk::Command<void> > save_and_reconfigure(s_a_reconf_macro);
1460 FbTk::RefCount<FbTk::Command<void> > save_and_reconftabs(s_a_reconftabs_macro);
1461 // create focus menu 1454 // create focus menu
1462 // we don't set this to internal menu so will 1455 // we don't set this to internal menu so will
1463 // be deleted toghether with the parent 1456 // be deleted toghether with the parent
@@ -1569,7 +1562,7 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
1569 "Width of external-style tabs"), 1562 "Width of external-style tabs"),
1570 resource.tab_width, 10, 3000, /* silly number */ 1563 resource.tab_width, 10, 3000, /* silly number */
1571 *tab_menu); 1564 *tab_menu);
1572 tab_width_item->setCommand(save_and_reconftabs); 1565 tab_width_item->setCommand(saverc_cmd);
1573 tab_menu->insert(tab_width_item); 1566 tab_menu->insert(tab_width_item);
1574 1567
1575 // menu is 3 wide, 5 down 1568 // menu is 3 wide, 5 down
diff --git a/src/Screen.hh b/src/Screen.hh
index 98c13e4..c776566 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -132,7 +132,7 @@ public:
132 FbTk::BoolResource &getTabsUsePixmapResource() { return resource.tabs_use_pixmap; } 132 FbTk::BoolResource &getTabsUsePixmapResource() { return resource.tabs_use_pixmap; }
133 const bool getMaxOverTabs() const { return *resource.max_over_tabs; } 133 const bool getMaxOverTabs() const { return *resource.max_over_tabs; }
134 134
135 unsigned int getTabWidth() const { return *resource.tab_width; } 135 FbTk::IntResource &getTabWidthResource() { return resource.tab_width; }
136 /// @return the slit, @see Slit 136 /// @return the slit, @see Slit
137 Slit *slit() { return m_slit.get(); } 137 Slit *slit() { return m_slit.get(); }
138 /// @return the slit, @see Slit 138 /// @return the slit, @see Slit
diff --git a/src/Window.cc b/src/Window.cc
index 0bb0f8f..e8b1c31 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -433,6 +433,8 @@ void FluxboxWindow::init() {
433 FbTk::MemFunIgnoreArgs(*this, &FluxboxWindow::applyDecorations)); 433 FbTk::MemFunIgnoreArgs(*this, &FluxboxWindow::applyDecorations));
434 join(screen().getTabPlacementResource().modifiedSig(), 434 join(screen().getTabPlacementResource().modifiedSig(),
435 FbTk::MemFunIgnoreArgs(*this, &FluxboxWindow::applyDecorations)); 435 FbTk::MemFunIgnoreArgs(*this, &FluxboxWindow::applyDecorations));
436 join(screen().getTabWidthResource().modifiedSig(),
437 FbTk::MemFunIgnoreArgs(*this, &FluxboxWindow::applyDecorations));
436 438
437 /**************************************************/ 439 /**************************************************/
438 /* Read state above here, apply state below here. */ 440 /* Read state above here, apply state below here. */