summaryrefslogtreecommitdiff
path: root/src
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
parentac1bd7e0981222bf340ce7defb2bb8307d42a0a2 (diff)
downloadfluxbox_lack-dbfddf8e0bcf8e7abbba671eff64c9679332a774.zip
fluxbox_lack-dbfddf8e0bcf8e7abbba671eff64c9679332a774.tar.bz2
added new ThemeProxy for automatically handling focused vs. unfocused ThemeItems
Diffstat (limited to 'src')
-rw-r--r--src/CommandDialog.cc8
-rw-r--r--src/FbWinFrame.cc35
-rw-r--r--src/FbWinFrame.hh6
-rw-r--r--src/FbWinFrameTheme.cc8
-rw-r--r--src/FbWinFrameTheme.hh5
-rw-r--r--src/FocusableTheme.hh71
-rw-r--r--src/IconButton.cc61
-rw-r--r--src/IconButton.hh11
-rw-r--r--src/IconbarTheme.cc60
-rw-r--r--src/IconbarTheme.hh16
-rw-r--r--src/IconbarTool.cc23
-rw-r--r--src/IconbarTool.hh5
-rw-r--r--src/Makefile.am2
-rw-r--r--src/Screen.cc20
-rw-r--r--src/ToolFactory.cc16
-rw-r--r--src/ToolFactory.hh2
-rw-r--r--src/Window.cc7
17 files changed, 196 insertions, 160 deletions
diff --git a/src/CommandDialog.cc b/src/CommandDialog.cc
index d88d755..17bd771 100644
--- a/src/CommandDialog.cc
+++ b/src/CommandDialog.cc
@@ -190,12 +190,12 @@ void CommandDialog::tabComplete() {
190 190
191void CommandDialog::render() { 191void CommandDialog::render() {
192 Pixmap tmp = m_pixmap; 192 Pixmap tmp = m_pixmap;
193 if (!m_screen.winFrameTheme()->iconbarTheme().focusedTexture().usePixmap()) { 193 if (!m_screen.winFrameTheme()->focusedIconbarTheme().texture().usePixmap()) {
194 m_label.setBackgroundColor(m_screen.winFrameTheme()->iconbarTheme().focusedTexture().color()); 194 m_label.setBackgroundColor(m_screen.winFrameTheme()->focusedIconbarTheme().texture().color());
195 m_pixmap = 0; 195 m_pixmap = 0;
196 } else { 196 } else {
197 m_pixmap = m_screen.imageControl().renderImage(m_label.width(), m_label.height(), 197 m_pixmap = m_screen.imageControl().renderImage(m_label.width(), m_label.height(),
198 m_screen.winFrameTheme()->iconbarTheme().focusedTexture()); 198 m_screen.winFrameTheme()->focusedIconbarTheme().texture());
199 m_label.setBackgroundPixmap(m_pixmap); 199 m_label.setBackgroundPixmap(m_pixmap);
200 } 200 }
201 201
@@ -210,7 +210,7 @@ void CommandDialog::init() {
210 // setup label 210 // setup label
211 // we listen to motion notify too 211 // we listen to motion notify too
212 m_label.setEventMask(m_label.eventMask() | ButtonPressMask | ButtonMotionMask); 212 m_label.setEventMask(m_label.eventMask() | ButtonPressMask | ButtonMotionMask);
213 m_label.setGC(m_screen.winFrameTheme()->iconbarTheme().focusedText().textGC()); 213 m_label.setGC(m_screen.winFrameTheme()->focusedIconbarTheme().text().textGC());
214 m_label.show(); 214 m_label.show();
215 215
216 // setup text box 216 // setup text box
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc
index 36bf251..5cc7631 100644
--- a/src/FbWinFrame.cc
+++ b/src/FbWinFrame.cc
@@ -563,19 +563,14 @@ void FbWinFrame::removeAllButtons() {
563 } 563 }
564} 564}
565 565
566IconButton *FbWinFrame::createTab(Focusable &client) { 566void FbWinFrame::createTab(FbTk::Button &button) {
567 IconButton *button = new IconButton(m_tab_container, theme()->iconbarTheme(), 567 button.show();
568 client); 568 button.setEventMask(ExposureMask | ButtonPressMask |
569 ButtonReleaseMask | ButtonMotionMask |
570 EnterWindowMask);
571 FbTk::EventManager::instance()->add(button, button.window());
569 572
570 button->show(); 573 m_tab_container.insertItem(&button);
571 button->setEventMask(ExposureMask | ButtonPressMask |
572 ButtonReleaseMask | ButtonMotionMask |
573 EnterWindowMask);
574 FbTk::EventManager::instance()->add(*button, button->window());
575
576 m_tab_container.insertItem(button);
577
578 return button;
579} 574}
580 575
581void FbWinFrame::removeTab(IconButton *btn) { 576void FbWinFrame::removeTab(IconButton *btn) {
@@ -1140,11 +1135,11 @@ void FbWinFrame::renderTitlebar() {
1140 1135
1141 //!! TODO: don't render label if internal tabs 1136 //!! TODO: don't render label if internal tabs
1142 1137
1143 render(theme()->iconbarTheme()->focusedTexture(), m_label_focused_color, 1138 render(theme()->focusedIconbarTheme()->texture(), m_label_focused_color,
1144 m_label_focused_pm, 1139 m_label_focused_pm,
1145 m_label.width(), m_label.height()); 1140 m_label.width(), m_label.height());
1146 1141
1147 render(theme()->iconbarTheme()->unfocusedTexture(), m_label_unfocused_color, 1142 render(theme()->unfocusedIconbarTheme()->texture(), m_label_unfocused_color,
1148 m_label_unfocused_pm, 1143 m_label_unfocused_pm,
1149 m_label.width(), m_label.height()); 1144 m_label.width(), m_label.height());
1150 1145
@@ -1156,8 +1151,8 @@ void FbWinFrame::renderTabContainer() {
1156 return; 1151 return;
1157 } 1152 }
1158 1153
1159 const FbTk::Texture *tc_focused = &theme()->iconbarTheme()->focusedTexture(); 1154 const FbTk::Texture *tc_focused = &theme()->focusedIconbarTheme()->texture();
1160 const FbTk::Texture *tc_unfocused = &theme()->iconbarTheme()->unfocusedTexture(); 1155 const FbTk::Texture *tc_unfocused = &theme()->unfocusedIconbarTheme()->texture();
1161 1156
1162 if (m_tabmode == EXTERNAL && tc_focused->type() & FbTk::Texture::PARENTRELATIVE) 1157 if (m_tabmode == EXTERNAL && tc_focused->type() & FbTk::Texture::PARENTRELATIVE)
1163 tc_focused = &theme()->titleFocusTexture(); 1158 tc_focused = &theme()->titleFocusTexture();
@@ -1192,11 +1187,11 @@ void FbWinFrame::applyTitlebar() {
1192 1187
1193 if (m_tabmode != INTERNAL) { 1188 if (m_tabmode != INTERNAL) {
1194 m_label.setGC(m_focused ? 1189 m_label.setGC(m_focused ?
1195 theme()->iconbarTheme()->focusedText().textGC() : 1190 theme()->focusedIconbarTheme()->text().textGC() :
1196 theme()->iconbarTheme()->unfocusedText().textGC()); 1191 theme()->unfocusedIconbarTheme()->text().textGC());
1197 m_label.setJustify(m_focused ? 1192 m_label.setJustify(m_focused ?
1198 theme()->iconbarTheme()->focusedText().justify() : 1193 theme()->focusedIconbarTheme()->text().justify() :
1199 theme()->iconbarTheme()->unfocusedText().justify()); 1194 theme()->unfocusedIconbarTheme()->text().justify());
1200 1195
1201 if (label_pm != 0) 1196 if (label_pm != 0)
1202 m_label.setBackgroundPixmap(label_pm); 1197 m_label.setBackgroundPixmap(label_pm);
diff --git a/src/FbWinFrame.hh b/src/FbWinFrame.hh
index 82c33dc..800bc0e 100644
--- a/src/FbWinFrame.hh
+++ b/src/FbWinFrame.hh
@@ -160,8 +160,8 @@ public:
160 void addRightButton(FbTk::Button *btn); 160 void addRightButton(FbTk::Button *btn);
161 /// remove all buttons from titlebar 161 /// remove all buttons from titlebar
162 void removeAllButtons(); 162 void removeAllButtons();
163 /// adds a button to label window with specified title and command 163 /// adds a button to tab container
164 IconButton *createTab(Focusable &client); 164 void createTab(FbTk::Button &button);
165 /// removes a specific button from label window 165 /// removes a specific button from label window
166 void removeTab(IconButton *id); 166 void removeTab(IconButton *id);
167 /// move label button to the left 167 /// move label button to the left
@@ -253,7 +253,6 @@ public:
253 FbTk::FbWindow &gripLeft() { return m_grip_left; } 253 FbTk::FbWindow &gripLeft() { return m_grip_left; }
254 const FbTk::FbWindow &gripRight() const { return m_grip_right; } 254 const FbTk::FbWindow &gripRight() const { return m_grip_right; }
255 FbTk::FbWindow &gripRight() { return m_grip_right; } 255 FbTk::FbWindow &gripRight() { return m_grip_right; }
256 const IconButton *currentLabel() const { return m_current_label; }
257 bool focused() const { return m_focused; } 256 bool focused() const { return m_focused; }
258 bool isShaded() const { return m_shaded; } 257 bool isShaded() const { return m_shaded; }
259 FbTk::ThemeProxy<FbWinFrameTheme> &theme() const { return m_theme; } 258 FbTk::ThemeProxy<FbWinFrameTheme> &theme() const { return m_theme; }
@@ -337,7 +336,6 @@ private:
337 ButtonList m_buttons_left, ///< buttons to the left 336 ButtonList m_buttons_left, ///< buttons to the left
338 m_buttons_right; ///< buttons to the right 337 m_buttons_right; ///< buttons to the right
339 typedef std::list<FbTk::TextButton *> LabelList; 338 typedef std::list<FbTk::TextButton *> LabelList;
340 IconButton *m_current_label; ///< which client button is focused at the moment
341 int m_bevel; ///< bevel between titlebar items and titlebar 339 int m_bevel; ///< bevel between titlebar items and titlebar
342 unsigned int m_decoration_mask; ///< bitmask of applied decorations 340 unsigned int m_decoration_mask; ///< bitmask of applied decorations
343 bool m_use_titlebar; ///< if we should use titlebar 341 bool m_use_titlebar; ///< if we should use titlebar
diff --git a/src/FbWinFrameTheme.cc b/src/FbWinFrameTheme.cc
index c72e4cf..634a0fd 100644
--- a/src/FbWinFrameTheme.cc
+++ b/src/FbWinFrameTheme.cc
@@ -55,7 +55,10 @@ FbWinFrameTheme::FbWinFrameTheme(int screen_num):
55 m_button_pic_unfocus_gc(RootWindow(FbTk::App::instance()->display(), screen_num)), 55 m_button_pic_unfocus_gc(RootWindow(FbTk::App::instance()->display(), screen_num)),
56 m_focused_alpha(255), 56 m_focused_alpha(255),
57 m_unfocused_alpha(255), 57 m_unfocused_alpha(255),
58 m_iconbar_theme(screen_num, "window.label", "Window.Label") { 58 m_focused_iconbar_theme(screen_num, "window.label.focus",
59 "Window.Label.Unfocus"),
60 m_unfocused_iconbar_theme(screen_num, "window.label.unfocus",
61 "Window.Label.Unfocus") {
59 62
60 *m_title_height = 0; 63 *m_title_height = 0;
61 // set defaults 64 // set defaults
@@ -111,6 +114,7 @@ void FbWinFrameTheme::reconfigTheme() {
111 m_button_pic_focus_gc.setForeground(*m_button_focus_color); 114 m_button_pic_focus_gc.setForeground(*m_button_focus_color);
112 m_button_pic_unfocus_gc.setForeground(*m_button_unfocus_color); 115 m_button_pic_unfocus_gc.setForeground(*m_button_unfocus_color);
113 116
114 m_iconbar_theme.reconfigTheme(); 117 m_focused_iconbar_theme.reconfigTheme();
118 m_unfocused_iconbar_theme.reconfigTheme();
115} 119}
116 120
diff --git a/src/FbWinFrameTheme.hh b/src/FbWinFrameTheme.hh
index 66448b6..bc8ed40 100644
--- a/src/FbWinFrameTheme.hh
+++ b/src/FbWinFrameTheme.hh
@@ -92,7 +92,8 @@ public:
92 void setFocusedAlpha(unsigned char alpha) { m_focused_alpha = alpha; } 92 void setFocusedAlpha(unsigned char alpha) { m_focused_alpha = alpha; }
93 void setUnfocusedAlpha(unsigned char alpha) { m_unfocused_alpha = alpha; } 93 void setUnfocusedAlpha(unsigned char alpha) { m_unfocused_alpha = alpha; }
94 94
95 IconbarTheme &iconbarTheme() { return m_iconbar_theme; } 95 IconbarTheme &focusedIconbarTheme() { return m_focused_iconbar_theme; }
96 IconbarTheme &unfocusedIconbarTheme() { return m_unfocused_iconbar_theme; }
96 97
97 virtual FbTk::Subject &reconfigSig() { return FbTk::Theme::reconfigSig(); } 98 virtual FbTk::Subject &reconfigSig() { return FbTk::Theme::reconfigSig(); }
98 virtual const FbTk::Subject &reconfigSig() const { return FbTk::Theme::reconfigSig(); } 99 virtual const FbTk::Subject &reconfigSig() const { return FbTk::Theme::reconfigSig(); }
@@ -128,7 +129,7 @@ private:
128 unsigned char m_focused_alpha; 129 unsigned char m_focused_alpha;
129 unsigned char m_unfocused_alpha; 130 unsigned char m_unfocused_alpha;
130 131
131 IconbarTheme m_iconbar_theme; 132 IconbarTheme m_focused_iconbar_theme, m_unfocused_iconbar_theme;
132}; 133};
133 134
134#endif // FBWINFRAMETHEME_HH 135#endif // FBWINFRAMETHEME_HH
diff --git a/src/FocusableTheme.hh b/src/FocusableTheme.hh
new file mode 100644
index 0000000..d0f5d9e
--- /dev/null
+++ b/src/FocusableTheme.hh
@@ -0,0 +1,71 @@
1// FocusableTheme.hh
2// Copyright (c) 2008 Fluxbox Team (fluxgen at fluxbox dot org)
3//
4// Permission is hereby granted, free of charge, to any person obtaining a
5// copy of this software and associated documentation files (the "Software"),
6// to deal in the Software without restriction, including without limitation
7// the rights to use, copy, modify, merge, publish, distribute, sublicense,
8// and/or sell copies of the Software, and to permit persons to whom the
9// Software is furnished to do so, subject to the following conditions:
10//
11// The above copyright notice and this permission notice shall be included in
12// all copies or substantial portions of the Software.
13//
14// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE.
21
22#ifndef FOCUSABLETHEME_HH
23#define FOCUSABLETHEME_HH
24
25#include "Focusable.hh"
26#include "FbTk/Observer.hh"
27#include "FbTk/Theme.hh"
28
29template <typename BaseTheme>
30class FocusableTheme: public FbTk::ThemeProxy<BaseTheme>,
31 private FbTk::Observer {
32public:
33 FocusableTheme(Focusable &win, FbTk::ThemeProxy<BaseTheme> &focused,
34 FbTk::ThemeProxy<BaseTheme> &unfocused):
35 m_win(win), m_focused_theme(focused), m_unfocused_theme(unfocused) {
36 m_win.focusSig().attach(this);
37 m_win.attentionSig().attach(this);
38 m_focused_theme.reconfigSig().attach(this);
39 m_unfocused_theme.reconfigSig().attach(this);
40 }
41
42 Focusable &win() { return m_win; }
43 const Focusable &win() const { return m_win; }
44
45 FbTk::ThemeProxy<BaseTheme> &focusedTheme() { return m_focused_theme; }
46 const FbTk::ThemeProxy<BaseTheme> &focusedTheme() const { return m_focused_theme; }
47
48 FbTk::ThemeProxy<BaseTheme> &unfocusedTheme() { return m_unfocused_theme; }
49 const FbTk::ThemeProxy<BaseTheme> &unfocusedTheme() const { return m_unfocused_theme; }
50
51 FbTk::Subject &reconfigSig() { return m_reconfig_sig; }
52 const FbTk::Subject &reconfigSig() const { return m_reconfig_sig; }
53
54 virtual BaseTheme &operator *() {
55 return (m_win.isFocused() || m_win.getAttentionState()) ?
56 *m_focused_theme : *m_unfocused_theme;
57 }
58 virtual const BaseTheme &operator *() const {
59 return (m_win.isFocused() || m_win.getAttentionState()) ?
60 *m_focused_theme : *m_unfocused_theme;
61 }
62
63private:
64 void update(FbTk::Subject *subj) { m_reconfig_sig.notify(); }
65
66 Focusable &m_win;
67 FbTk::ThemeProxy<BaseTheme> &m_focused_theme, &m_unfocused_theme;
68 FbTk::Subject m_reconfig_sig;
69};
70
71#endif // FOCUSABLETHEME_HH
diff --git a/src/IconButton.cc b/src/IconButton.cc
index d64e23c..2df741a 100644
--- a/src/IconButton.cc
+++ b/src/IconButton.cc
@@ -25,7 +25,6 @@
25#include "IconbarTheme.hh" 25#include "IconbarTheme.hh"
26 26
27#include "Screen.hh" 27#include "Screen.hh"
28#include "Focusable.hh"
29 28
30#include "FbTk/App.hh" 29#include "FbTk/App.hh"
31#include "FbTk/Command.hh" 30#include "FbTk/Command.hh"
@@ -47,15 +46,15 @@
47 46
48 47
49IconButton::IconButton(const FbTk::FbWindow &parent, 48IconButton::IconButton(const FbTk::FbWindow &parent,
50 FbTk::ThemeProxy<IconbarTheme> &theme, Focusable &win): 49 FbTk::ThemeProxy<IconbarTheme> &focused_theme,
51 FbTk::TextButton(parent, theme->focusedText().font(), win.title()), 50 FbTk::ThemeProxy<IconbarTheme> &unfocused_theme, Focusable &win):
51 FbTk::TextButton(parent, focused_theme->text().font(), win.title()),
52 m_win(win), 52 m_win(win),
53 m_icon_window(*this, 1, 1, 1, 1, 53 m_icon_window(*this, 1, 1, 1, 1,
54 ExposureMask | ButtonPressMask | ButtonReleaseMask), 54 ExposureMask | ButtonPressMask | ButtonReleaseMask),
55 m_use_pixmap(true), 55 m_use_pixmap(true),
56 m_theme(theme), 56 m_theme(win, focused_theme, unfocused_theme),
57 m_focused_pm(win.screen().imageControl()), 57 m_pm(win.screen().imageControl()) {
58 m_unfocused_pm(win.screen().imageControl()) {
59 58
60 m_win.titleSig().attach(this); 59 m_win.titleSig().attach(this);
61 m_win.focusSig().attach(this); 60 m_win.focusSig().attach(this);
@@ -118,47 +117,25 @@ void IconButton::setPixmap(bool use) {
118 117
119void IconButton::reconfigTheme() { 118void IconButton::reconfigTheme() {
120 119
121 if (m_theme->focusedTexture().usePixmap()) 120 if (m_theme->texture().usePixmap())
122 m_focused_pm.reset(m_win.screen().imageControl().renderImage( 121 m_pm.reset(m_win.screen().imageControl().renderImage(
123 width(), height(), m_theme->focusedTexture(), 122 width(), height(), m_theme->texture(),
124 orientation())); 123 orientation()));
125 else 124 else
126 m_focused_pm.reset(0); 125 m_pm.reset(0);
127
128 if (m_theme->unfocusedTexture().usePixmap())
129 m_unfocused_pm.reset(m_win.screen().imageControl().renderImage(
130 width(), height(), m_theme->unfocusedTexture(),
131 orientation()));
132 else
133 m_unfocused_pm.reset(0);
134 126
135 setAlpha(parent()->alpha()); 127 setAlpha(parent()->alpha());
136 128
137 if (m_win.isFocused() || m_win.getAttentionState()) { 129 if (m_pm != 0)
138 if (m_focused_pm != 0) 130 setBackgroundPixmap(m_pm);
139 setBackgroundPixmap(m_focused_pm); 131 else
140 else 132 setBackgroundColor(m_theme->texture().color());
141 setBackgroundColor(m_theme->focusedTexture().color());
142
143 setGC(m_theme->focusedText().textGC());
144 setFont(m_theme->focusedText().font());
145 setJustify(m_theme->focusedText().justify());
146 setBorderWidth(m_theme->focusedBorder().width());
147 setBorderColor(m_theme->focusedBorder().color());
148
149 } else {
150 if (m_unfocused_pm != 0)
151 setBackgroundPixmap(m_unfocused_pm);
152 else
153 setBackgroundColor(m_theme->unfocusedTexture().color());
154
155 setGC(m_theme->unfocusedText().textGC());
156 setFont(m_theme->unfocusedText().font());
157 setJustify(m_theme->unfocusedText().justify());
158 setBorderWidth(m_theme->unfocusedBorder().width());
159 setBorderColor(m_theme->unfocusedBorder().color());
160 133
161 } 134 setGC(m_theme->text().textGC());
135 setFont(m_theme->text().font());
136 setJustify(m_theme->text().justify());
137 setBorderWidth(m_theme->border().width());
138 setBorderColor(m_theme->border().color());
162 139
163 updateBackground(false); 140 updateBackground(false);
164 141
diff --git a/src/IconButton.hh b/src/IconButton.hh
index a0cd82e..b80a29b 100644
--- a/src/IconButton.hh
+++ b/src/IconButton.hh
@@ -23,12 +23,13 @@
23#ifndef ICONBUTTON_HH 23#ifndef ICONBUTTON_HH
24#define ICONBUTTON_HH 24#define ICONBUTTON_HH
25 25
26#include "FocusableTheme.hh"
27
26#include "FbTk/CachedPixmap.hh" 28#include "FbTk/CachedPixmap.hh"
27#include "FbTk/FbPixmap.hh" 29#include "FbTk/FbPixmap.hh"
28#include "FbTk/Observer.hh" 30#include "FbTk/Observer.hh"
29#include "FbTk/TextButton.hh" 31#include "FbTk/TextButton.hh"
30 32
31class Focusable;
32class IconbarTheme; 33class IconbarTheme;
33 34
34namespace FbTk { 35namespace FbTk {
@@ -38,7 +39,9 @@ template <class T> class ThemeProxy;
38class IconButton: public FbTk::TextButton, public FbTk::Observer { 39class IconButton: public FbTk::TextButton, public FbTk::Observer {
39public: 40public:
40 IconButton(const FbTk::FbWindow &parent, 41 IconButton(const FbTk::FbWindow &parent,
41 FbTk::ThemeProxy<IconbarTheme> &theme, Focusable &window); 42 FbTk::ThemeProxy<IconbarTheme> &focused_theme,
43 FbTk::ThemeProxy<IconbarTheme> &unfocused_theme,
44 Focusable &window);
42 virtual ~IconButton(); 45 virtual ~IconButton();
43 46
44 void exposeEvent(XExposeEvent &event); 47 void exposeEvent(XExposeEvent &event);
@@ -71,9 +74,9 @@ private:
71 FbTk::FbPixmap m_icon_mask; 74 FbTk::FbPixmap m_icon_mask;
72 bool m_use_pixmap; 75 bool m_use_pixmap;
73 76
74 FbTk::ThemeProxy<IconbarTheme> &m_theme; 77 FocusableTheme<IconbarTheme> m_theme;
75 // cached pixmaps 78 // cached pixmaps
76 FbTk::CachedPixmap m_focused_pm, m_unfocused_pm; 79 FbTk::CachedPixmap m_pm;
77}; 80};
78 81
79#endif // ICONBUTTON_HH 82#endif // ICONBUTTON_HH
diff --git a/src/IconbarTheme.cc b/src/IconbarTheme.cc
index f2247aa..0be9cd1 100644
--- a/src/IconbarTheme.cc
+++ b/src/IconbarTheme.cc
@@ -27,26 +27,10 @@ IconbarTheme::IconbarTheme(int screen_num,
27 const std::string &name, 27 const std::string &name,
28 const std::string &altname): 28 const std::string &altname):
29 FbTk::Theme(screen_num), 29 FbTk::Theme(screen_num),
30 m_focused_texture(*this, 30 m_texture(*this, name, altname),
31 name + (name == "window.label" ? ".focus" : ".focused"),
32 altname + (name == "window.label" ? ".Focus" : ".Focused")),
33 m_unfocused_texture(*this,
34 name + (name == "window.label" ? ".unfocus" : ".unfocused"),
35 altname + (name == "window.label" ? ".Unfocus" : ".Unfocused")),
36 m_empty_texture(*this, name + ".empty", altname + ".Empty"), 31 m_empty_texture(*this, name + ".empty", altname + ".Empty"),
37 m_focused_border(*this,
38 name + (name == "window.label" ? ".focus" : ".focused"),
39 altname + (name == "window.label" ? ".Focus" : ".Focused")),
40 m_unfocused_border(*this,
41 name + (name == "window.label" ? ".unfocus" : ".unfocused"),
42 altname + (name == "window.label" ? ".Unfocus" : ".Unfocused")),
43 m_border(*this, name, altname), 32 m_border(*this, name, altname),
44 m_focused_text(*this, 33 m_text(*this, name, altname),
45 name + (name == "window.label" ? ".focus" : ".focused"),
46 altname + (name == "window.label" ? ".Focus" : ".Focused")),
47 m_unfocused_text(*this,
48 name + (name == "window.label" ? ".unfocus" : ".unfocused"),
49 altname + (name == "window.label" ? ".Unfocus" : ".Unfocused")),
50 m_name(name), m_altname(altname) { 34 m_name(name), m_altname(altname) {
51 35
52 FbTk::ThemeManager::instance().loadTheme(*this); 36 FbTk::ThemeManager::instance().loadTheme(*this);
@@ -58,48 +42,46 @@ IconbarTheme::~IconbarTheme() {
58 42
59 43
60void IconbarTheme::reconfigTheme() { 44void IconbarTheme::reconfigTheme() {
61 m_focused_text.updateTextColor(); 45 m_text.updateTextColor();
62 m_unfocused_text.updateTextColor();
63} 46}
64 47
65// fallback resources 48// fallback resources
66bool IconbarTheme::fallback(FbTk::ThemeItem_base &item) { 49bool IconbarTheme::fallback(FbTk::ThemeItem_base &item) {
67 using namespace FbTk; 50 using namespace FbTk;
68 ThemeManager &tm = ThemeManager::instance(); 51 ThemeManager &tm = ThemeManager::instance();
69 std::string focus = (m_name == "window.label" ? ".focus" : ".focused"); 52 std::string base = m_name;
70 std::string un = (m_name == "window.label" ? ".unfocus" : ".unfocused"); 53 base.erase(base.find_last_of("."));
54 std::string altbase = m_altname;
55 altbase.erase(altbase.find_last_of("."));
71 56
72 if (&m_focused_texture == &item || &m_unfocused_texture == &item) { 57 if (&m_texture == &item) {
73 return tm.loadItem(item, "toolbar.windowLabel", "toolbar.windowLabel"); 58 return tm.loadItem(item, "toolbar.windowLabel", "toolbar.windowLabel");
74 } else if (&m_empty_texture == &item) { 59 } else if (&m_empty_texture == &item) {
75 return (tm.loadItem(item, m_focused_texture.name(), 60 return (tm.loadItem(item, "toolbar.iconbar.empty",
76 m_focused_texture.altName()) || 61 "Toolbar.Iconbar.Empty") ||
62 tm.loadItem(item, m_texture.name(), m_texture.altName()) ||
77 tm.loadItem(item, "toolbar.windowLabel", "toolbar.windowLabel") 63 tm.loadItem(item, "toolbar.windowLabel", "toolbar.windowLabel")
78 || tm.loadItem(item, "toolbar", "toolbar")); 64 || tm.loadItem(item, "toolbar", "toolbar"));
79 } else if (item.name() == m_name + focus + ".borderWidth" || 65 } else if (item.name() == m_name + ".borderWidth")
80 item.name() == m_name + un + ".borderWidth")
81 // don't fallback for base border, for theme backwards compatibility 66 // don't fallback for base border, for theme backwards compatibility
82 return (tm.loadItem(item, m_name + ".borderWidth", 67 return (tm.loadItem(item, base + ".borderWidth",
83 m_altname + ".BorderWidth") || 68 altbase + ".BorderWidth") ||
84 tm.loadItem(item, "window.borderWidth", "Window.BorderWidth") || 69 tm.loadItem(item, "window.borderWidth", "Window.BorderWidth") ||
85 tm.loadItem(item, "borderWidth", "BorderWidth")); 70 tm.loadItem(item, "borderWidth", "BorderWidth"));
86 71
87 else if (item.name() == m_name + focus + ".borderColor" || 72 else if (item.name() == m_name + ".borderColor")
88 item.name() == m_name + un + ".borderColor")
89 73
90 return (tm.loadItem(item, m_name + ".borderColor", 74 return (tm.loadItem(item, base + ".borderColor",
91 m_altname + ".BorderColor") || 75 altbase + ".BorderColor") ||
92 tm.loadItem(item, "window.borderColor", "Window.BorderColor") || 76 tm.loadItem(item, "window.borderColor", "Window.BorderColor") ||
93 tm.loadItem(item, "borderColor", "BorderColor")); 77 tm.loadItem(item, "borderColor", "BorderColor"));
94 78
95 else if (item.name() == m_name + focus + ".font" || 79 else if (item.name() == m_name + ".font")
96 item.name() == m_name + un + ".font")
97 80
98 return tm.loadItem(item, "window.font", "Window.Font"); 81 return tm.loadItem(item, "window.font", "Window.Font");
99 82
100 else if (item.name() == m_name + focus + ".justify" || 83 else if (item.name() == m_name + ".justify") {
101 item.name() == m_name + un + ".justify") { 84 return (tm.loadItem(item, base + ".justify", altbase + ".Justify")
102 return (tm.loadItem(item, m_name + ".justify", m_altname + ".Justify")
103 || tm.loadItem(item, "window.justify", "Window.Justify")); 85 || tm.loadItem(item, "window.justify", "Window.Justify"));
104 } 86 }
105 87
diff --git a/src/IconbarTheme.hh b/src/IconbarTheme.hh
index 4dc5f32..e4b3c8b 100644
--- a/src/IconbarTheme.hh
+++ b/src/IconbarTheme.hh
@@ -36,15 +36,9 @@ public:
36 void reconfigTheme(); 36 void reconfigTheme();
37 bool fallback(FbTk::ThemeItem_base &item); 37 bool fallback(FbTk::ThemeItem_base &item);
38 38
39 FbTk::TextTheme &focusedText() { return m_focused_text; } 39 FbTk::TextTheme &text() { return m_text; }
40 FbTk::TextTheme &unfocusedText() { return m_unfocused_text; }
41
42 const FbTk::BorderTheme &focusedBorder() const { return m_focused_border; }
43 const FbTk::BorderTheme &unfocusedBorder() const { return m_unfocused_border; }
44 const FbTk::BorderTheme &border() const { return m_border; } 40 const FbTk::BorderTheme &border() const { return m_border; }
45 41 const FbTk::Texture &texture() const { return *m_texture; }
46 const FbTk::Texture &focusedTexture() const { return *m_focused_texture; }
47 const FbTk::Texture &unfocusedTexture() const { return *m_unfocused_texture; }
48 const FbTk::Texture &emptyTexture() const { return *m_empty_texture; } 42 const FbTk::Texture &emptyTexture() const { return *m_empty_texture; }
49 43
50 virtual FbTk::Subject &reconfigSig() { return FbTk::Theme::reconfigSig(); } 44 virtual FbTk::Subject &reconfigSig() { return FbTk::Theme::reconfigSig(); }
@@ -54,9 +48,9 @@ public:
54 virtual const IconbarTheme &operator *() const { return *this; } 48 virtual const IconbarTheme &operator *() const { return *this; }
55 49
56private: 50private:
57 FbTk::ThemeItem<FbTk::Texture> m_focused_texture, m_unfocused_texture, m_empty_texture; 51 FbTk::ThemeItem<FbTk::Texture> m_texture, m_empty_texture;
58 FbTk::BorderTheme m_focused_border, m_unfocused_border, m_border; 52 FbTk::BorderTheme m_border;
59 FbTk::TextTheme m_focused_text, m_unfocused_text; 53 FbTk::TextTheme m_text;
60 std::string m_name, m_altname; 54 std::string m_name, m_altname;
61}; 55};
62 56
diff --git a/src/IconbarTool.cc b/src/IconbarTool.cc
index 3984b52..d8579f2 100644
--- a/src/IconbarTool.cc
+++ b/src/IconbarTool.cc
@@ -253,12 +253,14 @@ private:
253}; // end anonymous namespace 253}; // end anonymous namespace
254 254
255IconbarTool::IconbarTool(const FbTk::FbWindow &parent, 255IconbarTool::IconbarTool(const FbTk::FbWindow &parent,
256 FbTk::ThemeProxy<IconbarTheme> &theme, 256 FbTk::ThemeProxy<IconbarTheme> &focused_theme,
257 FbTk::ThemeProxy<IconbarTheme> &unfocused_theme,
257 BScreen &screen, FbTk::Menu &menu): 258 BScreen &screen, FbTk::Menu &menu):
258 ToolbarItem(ToolbarItem::RELATIVE), 259 ToolbarItem(ToolbarItem::RELATIVE),
259 m_screen(screen), 260 m_screen(screen),
260 m_icon_container(parent), 261 m_icon_container(parent),
261 m_theme(theme), 262 m_focused_theme(focused_theme),
263 m_unfocused_theme(unfocused_theme),
262 m_empty_pm( screen.imageControl() ), 264 m_empty_pm( screen.imageControl() ),
263 m_winlist(new FocusableList(screen)), 265 m_winlist(new FocusableList(screen)),
264 m_mode("none"), 266 m_mode("none"),
@@ -297,7 +299,8 @@ IconbarTool::IconbarTool(const FbTk::FbWindow &parent,
297 menu.insert(m_menu.label(), &m_menu); 299 menu.insert(m_menu.label(), &m_menu);
298 300
299 // setup signals 301 // setup signals
300 theme.reconfigSig().attach(this); 302 focused_theme.reconfigSig().attach(this);
303 unfocused_theme.reconfigSig().attach(this);
301 setMode(*m_rc_mode); 304 setMode(*m_rc_mode);
302} 305}
303 306
@@ -402,7 +405,8 @@ void IconbarTool::update(FbTk::Subject *subj) {
402 405
403 m_icon_container.setMaxSizePerClient(*m_rc_client_width); 406 m_icon_container.setMaxSizePerClient(*m_rc_client_width);
404 407
405 if (subj == &m_theme.reconfigSig()) { 408 if (subj == &m_focused_theme.reconfigSig() ||
409 subj == &m_unfocused_theme.reconfigSig()) {
406 setMode(*m_rc_mode); 410 setMode(*m_rc_mode);
407 return; 411 return;
408 } 412 }
@@ -468,7 +472,7 @@ void IconbarTool::reset() {
468} 472}
469 473
470void IconbarTool::updateSizing() { 474void IconbarTool::updateSizing() {
471 m_icon_container.setBorderWidth(m_theme->border().width()); 475 m_icon_container.setBorderWidth(m_focused_theme->border().width());
472 476
473 IconMap::iterator icon_it = m_icons.begin(); 477 IconMap::iterator icon_it = m_icons.begin();
474 const IconMap::iterator icon_it_end = m_icons.end(); 478 const IconMap::iterator icon_it_end = m_icons.end();
@@ -489,14 +493,14 @@ void IconbarTool::renderTheme() {
489 updateSizing(); 493 updateSizing();
490 494
491 // if we dont have any icons then we should render empty texture 495 // if we dont have any icons then we should render empty texture
492 if (!m_theme->emptyTexture().usePixmap()) { 496 if (!m_focused_theme->emptyTexture().usePixmap()) {
493 m_empty_pm.reset( 0 ); 497 m_empty_pm.reset( 0 );
494 m_icon_container.setBackgroundColor(m_theme->emptyTexture().color()); 498 m_icon_container.setBackgroundColor(m_focused_theme->emptyTexture().color());
495 } else { 499 } else {
496 m_empty_pm.reset(m_screen.imageControl(). 500 m_empty_pm.reset(m_screen.imageControl().
497 renderImage(m_icon_container.width(), 501 renderImage(m_icon_container.width(),
498 m_icon_container.height(), 502 m_icon_container.height(),
499 m_theme->emptyTexture(), orientation())); 503 m_focused_theme->emptyTexture(), orientation()));
500 m_icon_container.setBackgroundPixmap(m_empty_pm); 504 m_icon_container.setBackgroundPixmap(m_empty_pm);
501 } 505 }
502 506
@@ -548,7 +552,8 @@ IconButton *IconbarTool::makeButton(Focusable &win) {
548#ifdef DEBUG 552#ifdef DEBUG
549 cerr<<"IconbarTool::addWindow(0x"<<&win<<" title = "<<win.title()<<")"<<endl; 553 cerr<<"IconbarTool::addWindow(0x"<<&win<<" title = "<<win.title()<<")"<<endl;
550#endif // DEBUG 554#endif // DEBUG
551 IconButton *button = new IconButton(m_icon_container, m_theme, win); 555 IconButton *button = new IconButton(m_icon_container, m_focused_theme,
556 m_unfocused_theme, win);
552 557
553 RefCmd focus_cmd(new ::FocusCommand(win)); 558 RefCmd focus_cmd(new ::FocusCommand(win));
554 RefCmd menu_cmd(new ::ShowMenu(*fbwin)); 559 RefCmd menu_cmd(new ::ShowMenu(*fbwin));
diff --git a/src/IconbarTool.hh b/src/IconbarTool.hh
index 36609cc..58f8791 100644
--- a/src/IconbarTool.hh
+++ b/src/IconbarTool.hh
@@ -44,7 +44,8 @@ public:
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,
47 FbTk::ThemeProxy<IconbarTheme> &theme, 47 FbTk::ThemeProxy<IconbarTheme> &focused_theme,
48 FbTk::ThemeProxy<IconbarTheme> &unfocused_theme,
48 BScreen &screen, FbTk::Menu &menu); 49 BScreen &screen, FbTk::Menu &menu);
49 ~IconbarTool(); 50 ~IconbarTool();
50 51
@@ -96,7 +97,7 @@ private:
96 97
97 BScreen &m_screen; 98 BScreen &m_screen;
98 FbTk::Container m_icon_container; 99 FbTk::Container m_icon_container;
99 FbTk::ThemeProxy<IconbarTheme> &m_theme; 100 FbTk::ThemeProxy<IconbarTheme> &m_focused_theme, &m_unfocused_theme;
100 FbTk::CachedPixmap m_empty_pm; ///< pixmap for empty container 101 FbTk::CachedPixmap m_empty_pm; ///< pixmap for empty container
101 102
102 103
diff --git a/src/Makefile.am b/src/Makefile.am
index 9b0b1aa..683179d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -141,7 +141,7 @@ fluxbox_SOURCES = AtomHandler.hh ArrowButton.hh ArrowButton.cc \
141 AttentionNoticeHandler.hh AttentionNoticeHandler.cc \ 141 AttentionNoticeHandler.hh AttentionNoticeHandler.cc \
142 IconButton.hh IconButton.cc \ 142 IconButton.hh IconButton.cc \
143 IconbarTheme.hh IconbarTheme.cc \ 143 IconbarTheme.hh IconbarTheme.cc \
144 Focusable.hh FocusableList.hh FocusableList.cc \ 144 Focusable.hh FocusableList.hh FocusableList.cc FocusableTheme.hh \
145 ${newwmspec_SOURCE} ${gnome_SOURCE} \ 145 ${newwmspec_SOURCE} ${gnome_SOURCE} \
146 ${REMEMBER_SOURCE} ${TOOLBAR_SOURCE} 146 ${REMEMBER_SOURCE} ${TOOLBAR_SOURCE}
147 147
diff --git a/src/Screen.cc b/src/Screen.cc
index 5edbcaf..7174cda 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -1795,7 +1795,7 @@ void BScreen::showPosition(int x, int y) {
1795 1795
1796 winFrameTheme()->font().drawText(m_pos_window, 1796 winFrameTheme()->font().drawText(m_pos_window,
1797 screenNumber(), 1797 screenNumber(),
1798 winFrameTheme()->iconbarTheme().focusedText().textGC(), 1798 winFrameTheme()->focusedIconbarTheme().text().textGC(),
1799 label, strlen(label), 1799 label, strlen(label),
1800 winFrameTheme()->bevelWidth(), 1800 winFrameTheme()->bevelWidth(),
1801 winFrameTheme()->bevelWidth() + 1801 winFrameTheme()->bevelWidth() +
@@ -1847,7 +1847,7 @@ void BScreen::showGeometry(int gx, int gy) {
1847 //!! TODO: geom window again?! repeated 1847 //!! TODO: geom window again?! repeated
1848 winFrameTheme()->font().drawText(m_geom_window, 1848 winFrameTheme()->font().drawText(m_geom_window,
1849 screenNumber(), 1849 screenNumber(),
1850 winFrameTheme()->iconbarTheme().focusedText().textGC(), 1850 winFrameTheme()->focusedIconbarTheme().text().textGC(),
1851 label, strlen(label), 1851 label, strlen(label),
1852 winFrameTheme()->bevelWidth(), 1852 winFrameTheme()->bevelWidth(),
1853 winFrameTheme()->bevelWidth() + 1853 winFrameTheme()->bevelWidth() +
@@ -1918,7 +1918,7 @@ void BScreen::renderGeomWindow() {
1918 1918
1919 Pixmap tmp = geom_pixmap; 1919 Pixmap tmp = geom_pixmap;
1920 1920
1921 if (winFrameTheme()->iconbarTheme().focusedTexture().type() & FbTk::Texture::PARENTRELATIVE) { 1921 if (winFrameTheme()->focusedIconbarTheme().texture().type() & FbTk::Texture::PARENTRELATIVE) {
1922 if (!winFrameTheme()->titleFocusTexture().usePixmap()) { 1922 if (!winFrameTheme()->titleFocusTexture().usePixmap()) {
1923 geom_pixmap = None; 1923 geom_pixmap = None;
1924 m_geom_window.setBackgroundColor(winFrameTheme()->titleFocusTexture().color()); 1924 m_geom_window.setBackgroundColor(winFrameTheme()->titleFocusTexture().color());
@@ -1928,12 +1928,12 @@ void BScreen::renderGeomWindow() {
1928 m_geom_window.setBackgroundPixmap(geom_pixmap); 1928 m_geom_window.setBackgroundPixmap(geom_pixmap);
1929 } 1929 }
1930 } else { 1930 } else {
1931 if (!winFrameTheme()->iconbarTheme().focusedTexture().usePixmap()) { 1931 if (!winFrameTheme()->focusedIconbarTheme().texture().usePixmap()) {
1932 geom_pixmap = None; 1932 geom_pixmap = None;
1933 m_geom_window.setBackgroundColor(winFrameTheme()->iconbarTheme().focusedTexture().color()); 1933 m_geom_window.setBackgroundColor(winFrameTheme()->focusedIconbarTheme().texture().color());
1934 } else { 1934 } else {
1935 geom_pixmap = imageControl().renderImage(m_geom_window.width(), m_geom_window.height(), 1935 geom_pixmap = imageControl().renderImage(m_geom_window.width(), m_geom_window.height(),
1936 winFrameTheme()->iconbarTheme().focusedTexture()); 1936 winFrameTheme()->focusedIconbarTheme().texture());
1937 m_geom_window.setBackgroundPixmap(geom_pixmap); 1937 m_geom_window.setBackgroundPixmap(geom_pixmap);
1938 } 1938 }
1939 } 1939 }
@@ -1956,7 +1956,7 @@ void BScreen::renderPosWindow() {
1956 1956
1957 Pixmap tmp = pos_pixmap; 1957 Pixmap tmp = pos_pixmap;
1958 1958
1959 if (winFrameTheme()->iconbarTheme().focusedTexture().type() & FbTk::Texture::PARENTRELATIVE) { 1959 if (winFrameTheme()->focusedIconbarTheme().texture().type() & FbTk::Texture::PARENTRELATIVE) {
1960 if (!winFrameTheme()->titleFocusTexture().usePixmap()) { 1960 if (!winFrameTheme()->titleFocusTexture().usePixmap()) {
1961 pos_pixmap = None; 1961 pos_pixmap = None;
1962 m_pos_window.setBackgroundColor(winFrameTheme()->titleFocusTexture().color()); 1962 m_pos_window.setBackgroundColor(winFrameTheme()->titleFocusTexture().color());
@@ -1966,12 +1966,12 @@ void BScreen::renderPosWindow() {
1966 m_pos_window.setBackgroundPixmap(pos_pixmap); 1966 m_pos_window.setBackgroundPixmap(pos_pixmap);
1967 } 1967 }
1968 } else { 1968 } else {
1969 if (!winFrameTheme()->iconbarTheme().focusedTexture().usePixmap()) { 1969 if (!winFrameTheme()->focusedIconbarTheme().texture().usePixmap()) {
1970 pos_pixmap = None; 1970 pos_pixmap = None;
1971 m_pos_window.setBackgroundColor(winFrameTheme()->iconbarTheme().focusedTexture().color()); 1971 m_pos_window.setBackgroundColor(winFrameTheme()->focusedIconbarTheme().texture().color());
1972 } else { 1972 } else {
1973 pos_pixmap = imageControl().renderImage(m_pos_window.width(), m_pos_window.height(), 1973 pos_pixmap = imageControl().renderImage(m_pos_window.width(), m_pos_window.height(),
1974 winFrameTheme()->iconbarTheme().focusedTexture()); 1974 winFrameTheme()->focusedIconbarTheme().texture());
1975 m_pos_window.setBackgroundPixmap(pos_pixmap); 1975 m_pos_window.setBackgroundPixmap(pos_pixmap);
1976 } 1976 }
1977 } 1977 }
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();
diff --git a/src/ToolFactory.hh b/src/ToolFactory.hh
index c1ce511..98124e3 100644
--- a/src/ToolFactory.hh
+++ b/src/ToolFactory.hh
@@ -55,7 +55,7 @@ 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_iconbar_theme; 58 IconbarTheme m_focused_iconbar_theme, m_unfocused_iconbar_theme;
59}; 59};
60 60
61#endif // TOOLFACTORY_HH 61#endif // TOOLFACTORY_HH
diff --git a/src/Window.cc b/src/Window.cc
index a2a256e..5c6043d 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -4128,8 +4128,11 @@ void FluxboxWindow::ungrabPointer(Time time) {
4128} 4128}
4129 4129
4130void FluxboxWindow::associateClient(WinClient &client) { 4130void FluxboxWindow::associateClient(WinClient &client) {
4131 4131 IconButton *btn = new IconButton(frame().tabcontainer(),
4132 IconButton *btn = frame().createTab(client); 4132 frame().theme()->focusedIconbarTheme(),
4133 frame().theme()->unfocusedIconbarTheme(),
4134 client);
4135 frame().createTab(*btn);
4133 4136
4134 FbTk::RefCount<FbTk::Command> setcmd(new SetClientCmd(client)); 4137 FbTk::RefCount<FbTk::Command> setcmd(new SetClientCmd(client));
4135 btn->setOnClick(setcmd, 1); 4138 btn->setOnClick(setcmd, 1);