all repos — fluxbox @ 37a602899dc1c6f42076ff64d19a4b378cfa2b8f

custom fork of the fluxbox windowmanager

fix reading iconbar border from theme
Mark Tiefenbruck mark@fluxbox.org
commit

37a602899dc1c6f42076ff64d19a4b378cfa2b8f

parent

e6b11e06c67d0c7987410097b62f730dcd88db3a

4 files changed, 16 insertions(+), 9 deletions(-)

jump to
M src/IconbarTool.ccsrc/IconbarTool.cc

@@ -243,13 +243,14 @@ };

}; // end anonymous namespace -IconbarTool::IconbarTool(const FbTk::FbWindow &parent, +IconbarTool::IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme, FbTk::ThemeProxy<IconbarTheme> &focused_theme, FbTk::ThemeProxy<IconbarTheme> &unfocused_theme, BScreen &screen, FbTk::Menu &menu): ToolbarItem(ToolbarItem::RELATIVE), m_screen(screen), m_icon_container(parent), + m_theme(theme), m_focused_theme(focused_theme), m_unfocused_theme(unfocused_theme), m_empty_pm( screen.imageControl() ),

@@ -290,6 +291,7 @@ // add iconbar menu to toolbar menu

menu.insert(m_menu.label(), &m_menu); // setup signals + theme.reconfigSig().attach(this); focused_theme.reconfigSig().attach(this); unfocused_theme.reconfigSig().attach(this); setMode(*m_rc_mode);

@@ -397,7 +399,8 @@

m_icon_container.setMaxSizePerClient(*m_rc_client_width); if (subj == &m_focused_theme.reconfigSig() || - subj == &m_unfocused_theme.reconfigSig()) { + subj == &m_unfocused_theme.reconfigSig() || + subj == &m_theme.reconfigSig()) { setMode(*m_rc_mode); return; }

@@ -463,7 +466,8 @@ updateList();

} void IconbarTool::updateSizing() { - m_icon_container.setBorderWidth(m_focused_theme->border().width()); + m_icon_container.setBorderWidth(m_theme.border().width()); + m_icon_container.setBorderColor(m_theme.border().color()); IconMap::iterator icon_it = m_icons.begin(); const IconMap::iterator icon_it_end = m_icons.end();

@@ -484,14 +488,14 @@ // update button sizes before we get max width per client!

updateSizing(); // if we dont have any icons then we should render empty texture - if (!m_focused_theme->emptyTexture().usePixmap()) { + if (!m_theme.emptyTexture().usePixmap()) { m_empty_pm.reset( 0 ); - m_icon_container.setBackgroundColor(m_focused_theme->emptyTexture().color()); + m_icon_container.setBackgroundColor(m_theme.emptyTexture().color()); } else { m_empty_pm.reset(m_screen.imageControl(). renderImage(m_icon_container.width(), m_icon_container.height(), - m_focused_theme->emptyTexture(), orientation())); + m_theme.emptyTexture(), orientation())); m_icon_container.setBackgroundPixmap(m_empty_pm); }
M src/IconbarTool.hhsrc/IconbarTool.hh

@@ -43,7 +43,7 @@ class IconbarTool: public ToolbarItem, public FbTk::Observer {

public: typedef std::map<Focusable *, IconButton *> IconMap; - IconbarTool(const FbTk::FbWindow &parent, + IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme, FbTk::ThemeProxy<IconbarTheme> &focused_theme, FbTk::ThemeProxy<IconbarTheme> &unfocused_theme, BScreen &screen, FbTk::Menu &menu);

@@ -97,6 +97,7 @@ void updateList();

BScreen &m_screen; FbTk::Container m_icon_container; + IconbarTheme &m_theme; FbTk::ThemeProxy<IconbarTheme> &m_focused_theme, &m_unfocused_theme; FbTk::CachedPixmap m_empty_pm; ///< pixmap for empty container
M src/ToolFactory.ccsrc/ToolFactory.cc

@@ -75,6 +75,7 @@ "toolbar.clock", "Toolbar.Clock")),

m_workspace_theme(new WorkspaceNameTheme(screen.screenNumber(), "toolbar.workspace", "Toolbar.Workspace")), m_systray_theme(new ButtonTheme(screen.screenNumber(), "toolbar.systray", "Toolbar.Systray", "toolbar.clock", "Toolbar.Systray")), + m_iconbar_theme(screen.screenNumber(), "toolbar.iconbar", "Toolbar.Iconbar"), m_focused_iconbar_theme(screen.screenNumber(), "toolbar.iconbar.focused", "Toolbar.Iconbar.Focused"), m_unfocused_iconbar_theme(screen.screenNumber(), "toolbar.iconbar.unfocused", "Toolbar.Iconbar.Unfocused") {

@@ -95,7 +96,7 @@ RefCount<Command<void> > showmenu(new ShowMenuAboveToolbar(tbar));

witem->button().setOnClick(showmenu); item = witem; } else if (name == "iconbar") { - item = new IconbarTool(parent, m_focused_iconbar_theme, m_unfocused_iconbar_theme, screen(), tbar.menu()); + item = new IconbarTool(parent, m_iconbar_theme, m_focused_iconbar_theme, m_unfocused_iconbar_theme, screen(), tbar.menu()); } else if (name == "systemtray") { item = new SystemTray(parent, dynamic_cast<ButtonTheme &>(*m_systray_theme), screen()); } else if (name == "clock") {
M src/ToolFactory.hhsrc/ToolFactory.hh

@@ -55,7 +55,8 @@ ToolTheme m_clock_theme;

std::auto_ptr<ToolTheme> m_button_theme; std::auto_ptr<ToolTheme> m_workspace_theme; std::auto_ptr<ToolTheme> m_systray_theme; - IconbarTheme m_focused_iconbar_theme, m_unfocused_iconbar_theme; + IconbarTheme m_iconbar_theme, m_focused_iconbar_theme, + m_unfocused_iconbar_theme; }; #endif // TOOLFACTORY_HH