aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/IconbarTool.cc16
-rw-r--r--src/IconbarTool.hh3
-rw-r--r--src/ToolFactory.cc3
-rw-r--r--src/ToolFactory.hh3
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:
243 243
244}; // end anonymous namespace 244}; // end anonymous namespace
245 245
246IconbarTool::IconbarTool(const FbTk::FbWindow &parent, 246IconbarTool::IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme,
247 FbTk::ThemeProxy<IconbarTheme> &focused_theme, 247 FbTk::ThemeProxy<IconbarTheme> &focused_theme,
248 FbTk::ThemeProxy<IconbarTheme> &unfocused_theme, 248 FbTk::ThemeProxy<IconbarTheme> &unfocused_theme,
249 BScreen &screen, FbTk::Menu &menu): 249 BScreen &screen, FbTk::Menu &menu):
250 ToolbarItem(ToolbarItem::RELATIVE), 250 ToolbarItem(ToolbarItem::RELATIVE),
251 m_screen(screen), 251 m_screen(screen),
252 m_icon_container(parent), 252 m_icon_container(parent),
253 m_theme(theme),
253 m_focused_theme(focused_theme), 254 m_focused_theme(focused_theme),
254 m_unfocused_theme(unfocused_theme), 255 m_unfocused_theme(unfocused_theme),
255 m_empty_pm( screen.imageControl() ), 256 m_empty_pm( screen.imageControl() ),
@@ -290,6 +291,7 @@ IconbarTool::IconbarTool(const FbTk::FbWindow &parent,
290 menu.insert(m_menu.label(), &m_menu); 291 menu.insert(m_menu.label(), &m_menu);
291 292
292 // setup signals 293 // setup signals
294 theme.reconfigSig().attach(this);
293 focused_theme.reconfigSig().attach(this); 295 focused_theme.reconfigSig().attach(this);
294 unfocused_theme.reconfigSig().attach(this); 296 unfocused_theme.reconfigSig().attach(this);
295 setMode(*m_rc_mode); 297 setMode(*m_rc_mode);
@@ -397,7 +399,8 @@ void IconbarTool::update(FbTk::Subject *subj) {
397 m_icon_container.setMaxSizePerClient(*m_rc_client_width); 399 m_icon_container.setMaxSizePerClient(*m_rc_client_width);
398 400
399 if (subj == &m_focused_theme.reconfigSig() || 401 if (subj == &m_focused_theme.reconfigSig() ||
400 subj == &m_unfocused_theme.reconfigSig()) { 402 subj == &m_unfocused_theme.reconfigSig() ||
403 subj == &m_theme.reconfigSig()) {
401 setMode(*m_rc_mode); 404 setMode(*m_rc_mode);
402 return; 405 return;
403 } 406 }
@@ -463,7 +466,8 @@ void IconbarTool::reset() {
463} 466}
464 467
465void IconbarTool::updateSizing() { 468void IconbarTool::updateSizing() {
466 m_icon_container.setBorderWidth(m_focused_theme->border().width()); 469 m_icon_container.setBorderWidth(m_theme.border().width());
470 m_icon_container.setBorderColor(m_theme.border().color());
467 471
468 IconMap::iterator icon_it = m_icons.begin(); 472 IconMap::iterator icon_it = m_icons.begin();
469 const IconMap::iterator icon_it_end = m_icons.end(); 473 const IconMap::iterator icon_it_end = m_icons.end();
@@ -484,14 +488,14 @@ void IconbarTool::renderTheme() {
484 updateSizing(); 488 updateSizing();
485 489
486 // if we dont have any icons then we should render empty texture 490 // if we dont have any icons then we should render empty texture
487 if (!m_focused_theme->emptyTexture().usePixmap()) { 491 if (!m_theme.emptyTexture().usePixmap()) {
488 m_empty_pm.reset( 0 ); 492 m_empty_pm.reset( 0 );
489 m_icon_container.setBackgroundColor(m_focused_theme->emptyTexture().color()); 493 m_icon_container.setBackgroundColor(m_theme.emptyTexture().color());
490 } else { 494 } else {
491 m_empty_pm.reset(m_screen.imageControl(). 495 m_empty_pm.reset(m_screen.imageControl().
492 renderImage(m_icon_container.width(), 496 renderImage(m_icon_container.width(),
493 m_icon_container.height(), 497 m_icon_container.height(),
494 m_focused_theme->emptyTexture(), orientation())); 498 m_theme.emptyTexture(), orientation()));
495 m_icon_container.setBackgroundPixmap(m_empty_pm); 499 m_icon_container.setBackgroundPixmap(m_empty_pm);
496 } 500 }
497 501
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 {
43public: 43public:
44 typedef std::map<Focusable *, IconButton *> IconMap; 44 typedef std::map<Focusable *, IconButton *> IconMap;
45 45
46 IconbarTool(const FbTk::FbWindow &parent, 46 IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme,
47 FbTk::ThemeProxy<IconbarTheme> &focused_theme, 47 FbTk::ThemeProxy<IconbarTheme> &focused_theme,
48 FbTk::ThemeProxy<IconbarTheme> &unfocused_theme, 48 FbTk::ThemeProxy<IconbarTheme> &unfocused_theme,
49 BScreen &screen, FbTk::Menu &menu); 49 BScreen &screen, FbTk::Menu &menu);
@@ -97,6 +97,7 @@ private:
97 97
98 BScreen &m_screen; 98 BScreen &m_screen;
99 FbTk::Container m_icon_container; 99 FbTk::Container m_icon_container;
100 IconbarTheme &m_theme;
100 FbTk::ThemeProxy<IconbarTheme> &m_focused_theme, &m_unfocused_theme; 101 FbTk::ThemeProxy<IconbarTheme> &m_focused_theme, &m_unfocused_theme;
101 FbTk::CachedPixmap m_empty_pm; ///< pixmap for empty container 102 FbTk::CachedPixmap m_empty_pm; ///< pixmap for empty container
102 103
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),
75 m_workspace_theme(new WorkspaceNameTheme(screen.screenNumber(), "toolbar.workspace", "Toolbar.Workspace")), 75 m_workspace_theme(new WorkspaceNameTheme(screen.screenNumber(), "toolbar.workspace", "Toolbar.Workspace")),
76 m_systray_theme(new ButtonTheme(screen.screenNumber(), "toolbar.systray", "Toolbar.Systray", 76 m_systray_theme(new ButtonTheme(screen.screenNumber(), "toolbar.systray", "Toolbar.Systray",
77 "toolbar.clock", "Toolbar.Systray")), 77 "toolbar.clock", "Toolbar.Systray")),
78 m_iconbar_theme(screen.screenNumber(), "toolbar.iconbar", "Toolbar.Iconbar"),
78 m_focused_iconbar_theme(screen.screenNumber(), "toolbar.iconbar.focused", "Toolbar.Iconbar.Focused"), 79 m_focused_iconbar_theme(screen.screenNumber(), "toolbar.iconbar.focused", "Toolbar.Iconbar.Focused"),
79 m_unfocused_iconbar_theme(screen.screenNumber(), "toolbar.iconbar.unfocused", "Toolbar.Iconbar.Unfocused") { 80 m_unfocused_iconbar_theme(screen.screenNumber(), "toolbar.iconbar.unfocused", "Toolbar.Iconbar.Unfocused") {
80 81
@@ -95,7 +96,7 @@ ToolbarItem *ToolFactory::create(const std::string &name, const FbTk::FbWindow &
95 witem->button().setOnClick(showmenu); 96 witem->button().setOnClick(showmenu);
96 item = witem; 97 item = witem;
97 } else if (name == "iconbar") { 98 } else if (name == "iconbar") {
98 item = new IconbarTool(parent, m_focused_iconbar_theme, m_unfocused_iconbar_theme, screen(), tbar.menu()); 99 item = new IconbarTool(parent, m_iconbar_theme, m_focused_iconbar_theme, m_unfocused_iconbar_theme, screen(), tbar.menu());
99 } else if (name == "systemtray") { 100 } else if (name == "systemtray") {
100 item = new SystemTray(parent, dynamic_cast<ButtonTheme &>(*m_systray_theme), screen()); 101 item = new SystemTray(parent, dynamic_cast<ButtonTheme &>(*m_systray_theme), screen());
101 } else if (name == "clock") { 102 } 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:
55 std::auto_ptr<ToolTheme> m_button_theme; 55 std::auto_ptr<ToolTheme> m_button_theme;
56 std::auto_ptr<ToolTheme> m_workspace_theme; 56 std::auto_ptr<ToolTheme> m_workspace_theme;
57 std::auto_ptr<ToolTheme> m_systray_theme; 57 std::auto_ptr<ToolTheme> m_systray_theme;
58 IconbarTheme m_focused_iconbar_theme, m_unfocused_iconbar_theme; 58 IconbarTheme m_iconbar_theme, m_focused_iconbar_theme,
59 m_unfocused_iconbar_theme;
59}; 60};
60 61
61#endif // TOOLFACTORY_HH 62#endif // TOOLFACTORY_HH