From cb3ace75e1df7f00cae2033a31511ed7ddd7d991 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Thu, 21 Jul 2011 21:34:07 +0200 Subject: Attach modifiedSig handlers to the session.screenX.tab.width resource --- src/FbWinFrame.cc | 4 ++-- src/Screen.cc | 9 +-------- src/Screen.hh | 2 +- src/Window.cc | 2 ++ 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc index 9acccaf..ec43a00 100644 --- a/src/FbWinFrame.cc +++ b/src/FbWinFrame.cc @@ -300,8 +300,8 @@ void FbWinFrame::alignTabs() { FbTk::Orientation orig_orient = m_tab_container.orientation(); unsigned int orig_tabwidth = m_tab_container.maxWidthPerClient(); - if (orig_tabwidth != m_screen.getTabWidth()) - m_tab_container.setMaxSizePerClient(m_screen.getTabWidth()); + if (orig_tabwidth != *m_screen.getTabWidthResource()) + m_tab_container.setMaxSizePerClient(*m_screen.getTabWidthResource()); int tabx = 0, taby = 0; 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) { menu.removeAll(); FbTk::MacroCommand *s_a_reconf_macro = new FbTk::MacroCommand(); - FbTk::MacroCommand *s_a_reconftabs_macro = new FbTk::MacroCommand(); FbTk::RefCount > saverc_cmd(new FbTk::SimpleCommand( *Fluxbox::instance(), &Fluxbox::save_rc)); FbTk::RefCount > reconf_cmd(FbTk::CommandParser::instance().parse("reconfigure")); - FbTk::RefCount > reconftabs_cmd(new FbTk::SimpleCommand( - *this, - &BScreen::reconfigureTabs)); s_a_reconf_macro->add(saverc_cmd); s_a_reconf_macro->add(reconf_cmd); - s_a_reconftabs_macro->add(saverc_cmd); - s_a_reconftabs_macro->add(reconftabs_cmd); FbTk::RefCount > save_and_reconfigure(s_a_reconf_macro); - FbTk::RefCount > save_and_reconftabs(s_a_reconftabs_macro); // create focus menu // we don't set this to internal menu so will // be deleted toghether with the parent @@ -1569,7 +1562,7 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { "Width of external-style tabs"), resource.tab_width, 10, 3000, /* silly number */ *tab_menu); - tab_width_item->setCommand(save_and_reconftabs); + tab_width_item->setCommand(saverc_cmd); tab_menu->insert(tab_width_item); // 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: FbTk::BoolResource &getTabsUsePixmapResource() { return resource.tabs_use_pixmap; } const bool getMaxOverTabs() const { return *resource.max_over_tabs; } - unsigned int getTabWidth() const { return *resource.tab_width; } + FbTk::IntResource &getTabWidthResource() { return resource.tab_width; } /// @return the slit, @see Slit Slit *slit() { return m_slit.get(); } /// @return the slit, @see Slit diff --git a/src/Window.cc b/src/Window.cc index d1edade..d8e3736 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -433,6 +433,8 @@ void FluxboxWindow::init() { FbTk::MemFunIgnoreArgs(*this, &FluxboxWindow::applyDecorations)); join(screen().getTabPlacementResource().modifiedSig(), FbTk::MemFunIgnoreArgs(*this, &FluxboxWindow::applyDecorations)); + join(screen().getTabWidthResource().modifiedSig(), + FbTk::MemFunIgnoreArgs(*this, &FluxboxWindow::applyDecorations)); /**************************************************/ /* Read state above here, apply state below here. */ -- cgit v0.11.2