aboutsummaryrefslogtreecommitdiff
path: root/src/ToolFactory.cc
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-01-07 10:26:32 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-01-07 10:26:32 (GMT)
commitdbfddf8e0bcf8e7abbba671eff64c9679332a774 (patch)
tree37cefce75eef2f7e0c749c3489008608e71dcd6c /src/ToolFactory.cc
parentac1bd7e0981222bf340ce7defb2bb8307d42a0a2 (diff)
downloadfluxbox-dbfddf8e0bcf8e7abbba671eff64c9679332a774.zip
fluxbox-dbfddf8e0bcf8e7abbba671eff64c9679332a774.tar.bz2
added new ThemeProxy for automatically handling focused vs. unfocused ThemeItems
Diffstat (limited to 'src/ToolFactory.cc')
-rw-r--r--src/ToolFactory.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/ToolFactory.cc b/src/ToolFactory.cc
index cee0d93..87299cc 100644
--- a/src/ToolFactory.cc
+++ b/src/ToolFactory.cc
@@ -76,7 +76,8 @@ ToolFactory::ToolFactory(BScreen &screen):m_screen(screen),
76 m_workspace_theme(new WorkspaceNameTheme(screen.screenNumber(), "toolbar.workspace", "Toolbar.Workspace")), 76 m_workspace_theme(new WorkspaceNameTheme(screen.screenNumber(), "toolbar.workspace", "Toolbar.Workspace")),
77 m_systray_theme(new ButtonTheme(screen.screenNumber(), "toolbar.systray", "Toolbar.Systray", 77 m_systray_theme(new ButtonTheme(screen.screenNumber(), "toolbar.systray", "Toolbar.Systray",
78 "toolbar.clock", "Toolbar.Systray")), 78 "toolbar.clock", "Toolbar.Systray")),
79 m_iconbar_theme(screen.screenNumber(), "toolbar.iconbar", "Toolbar.Iconbar") { 79 m_focused_iconbar_theme(screen.screenNumber(), "toolbar.iconbar.focused", "Toolbar.Iconbar.Focused"),
80 m_unfocused_iconbar_theme(screen.screenNumber(), "toolbar.iconbar.unfocused", "Toolbar.Iconbar.Unfocused") {
80 81
81} 82}
82 83
@@ -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_iconbar_theme, screen(), tbar.menu()); 99 item = new IconbarTool(parent, 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") {
@@ -149,7 +150,8 @@ ToolbarItem *ToolFactory::create(const std::string &name, const FbTk::FbWindow &
149 150
150void ToolFactory::updateThemes() { 151void ToolFactory::updateThemes() {
151 m_clock_theme.reconfigTheme(); 152 m_clock_theme.reconfigTheme();
152 m_iconbar_theme.reconfigTheme(); 153 m_focused_iconbar_theme.reconfigTheme();
154 m_unfocused_iconbar_theme.reconfigTheme();
153 m_button_theme->reconfigTheme(); 155 m_button_theme->reconfigTheme();
154 m_workspace_theme->reconfigTheme(); 156 m_workspace_theme->reconfigTheme();
155} 157}
@@ -160,11 +162,11 @@ int ToolFactory::maxFontHeight() {
160 if (max_height < m_clock_theme.font().height()) 162 if (max_height < m_clock_theme.font().height())
161 max_height = m_clock_theme.font().height(); 163 max_height = m_clock_theme.font().height();
162 164
163 if (max_height < m_iconbar_theme.focusedText().font().height()) 165 if (max_height < m_focused_iconbar_theme.text().font().height())
164 max_height = m_iconbar_theme.focusedText().font().height(); 166 max_height = m_focused_iconbar_theme.text().font().height();
165 167
166 if (max_height < m_iconbar_theme.unfocusedText().font().height()) 168 if (max_height < m_unfocused_iconbar_theme.text().font().height())
167 max_height = m_iconbar_theme.unfocusedText().font().height(); 169 max_height = m_unfocused_iconbar_theme.text().font().height();
168 170
169 if (max_height < m_workspace_theme->font().height()) 171 if (max_height < m_workspace_theme->font().height())
170 max_height = m_workspace_theme->font().height(); 172 max_height = m_workspace_theme->font().height();