From fb0235c51656bf834ec1bc91b0e012321e676d71 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 21de2c5..3185003 100644 --- a/src/FbWinFrame.cc +++ b/src/FbWinFrame.cc @@ -319,8 +319,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 2766c06..1970ad0 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -1513,21 +1513,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 @@ -1650,7 +1643,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 8d50fbc..b6ca75d 100644 --- a/src/Screen.hh +++ b/src/Screen.hh @@ -133,7 +133,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 6c2cc66..5d64667 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -445,6 +445,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