From 37a602899dc1c6f42076ff64d19a4b378cfa2b8f Mon Sep 17 00:00:00 2001 From: Mark Tiefenbruck Date: Sat, 23 Aug 2008 12:46:36 -0700 Subject: fix reading iconbar border from theme --- src/IconbarTool.cc | 16 ++++++++++------ src/IconbarTool.hh | 3 ++- src/ToolFactory.cc | 3 ++- src/ToolFactory.hh | 3 ++- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/IconbarTool.cc b/src/IconbarTool.cc index f352237..6678d1d 100644 --- a/src/IconbarTool.cc +++ b/src/IconbarTool.cc @@ -243,13 +243,14 @@ private: }; // end anonymous namespace -IconbarTool::IconbarTool(const FbTk::FbWindow &parent, +IconbarTool::IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme, FbTk::ThemeProxy &focused_theme, FbTk::ThemeProxy &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 @@ IconbarTool::IconbarTool(const FbTk::FbWindow &parent, 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 @@ void IconbarTool::update(FbTk::Subject *subj) { 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 @@ void IconbarTool::reset() { } 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 @@ void IconbarTool::renderTheme() { 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); } diff --git a/src/IconbarTool.hh b/src/IconbarTool.hh index 58f8791..efb4a1a 100644 --- a/src/IconbarTool.hh +++ b/src/IconbarTool.hh @@ -43,7 +43,7 @@ class IconbarTool: public ToolbarItem, public FbTk::Observer { public: typedef std::map IconMap; - IconbarTool(const FbTk::FbWindow &parent, + IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme, FbTk::ThemeProxy &focused_theme, FbTk::ThemeProxy &unfocused_theme, BScreen &screen, FbTk::Menu &menu); @@ -97,6 +97,7 @@ private: BScreen &m_screen; FbTk::Container m_icon_container; + IconbarTheme &m_theme; FbTk::ThemeProxy &m_focused_theme, &m_unfocused_theme; FbTk::CachedPixmap m_empty_pm; ///< pixmap for empty container diff --git a/src/ToolFactory.cc b/src/ToolFactory.cc index 51692ad..c5cb895 100644 --- a/src/ToolFactory.cc +++ b/src/ToolFactory.cc @@ -75,6 +75,7 @@ ToolFactory::ToolFactory(BScreen &screen):m_screen(screen), 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 @@ ToolbarItem *ToolFactory::create(const std::string &name, const FbTk::FbWindow & 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(*m_systray_theme), screen()); } else if (name == "clock") { diff --git a/src/ToolFactory.hh b/src/ToolFactory.hh index 98124e3..3d99785 100644 --- a/src/ToolFactory.hh +++ b/src/ToolFactory.hh @@ -55,7 +55,8 @@ private: std::auto_ptr m_button_theme; std::auto_ptr m_workspace_theme; std::auto_ptr 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 -- cgit v0.11.2