diff options
author | fluxgen <fluxgen> | 2003-08-13 09:57:40 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-08-13 09:57:40 (GMT) |
commit | eebfc5b8890d6bc7c1d59917b797eb7a5daae921 (patch) | |
tree | 5bb586253de4d6f12c31468decf62a593d67ebf8 /src | |
parent | 2f9ab8617833554df04642b1e2ff85aa1aa6de89 (diff) | |
download | fluxbox-eebfc5b8890d6bc7c1d59917b797eb7a5daae921.zip fluxbox-eebfc5b8890d6bc7c1d59917b797eb7a5daae921.tar.bz2 |
border theme item
Diffstat (limited to 'src')
-rw-r--r-- | src/IconbarTool.cc | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/IconbarTool.cc b/src/IconbarTool.cc index 17faf7c..9b26baf 100644 --- a/src/IconbarTool.cc +++ b/src/IconbarTool.cc | |||
@@ -20,7 +20,7 @@ | |||
20 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 20 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
21 | // DEALINGS IN THE SOFTWARE. | 21 | // DEALINGS IN THE SOFTWARE. |
22 | 22 | ||
23 | // $Id: IconbarTool.cc,v 1.5 2003/08/12 12:16:28 fluxgen Exp $ | 23 | // $Id: IconbarTool.cc,v 1.6 2003/08/13 09:57:40 fluxgen Exp $ |
24 | 24 | ||
25 | #include "IconbarTool.hh" | 25 | #include "IconbarTool.hh" |
26 | 26 | ||
@@ -31,6 +31,9 @@ | |||
31 | #include "IconButton.hh" | 31 | #include "IconButton.hh" |
32 | #include "Workspace.hh" | 32 | #include "Workspace.hh" |
33 | 33 | ||
34 | #include <iostream> | ||
35 | using namespace std; | ||
36 | |||
34 | IconbarTool::IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme, BScreen &screen): | 37 | IconbarTool::IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme, BScreen &screen): |
35 | ToolbarItem(ToolbarItem::RELATIVE), | 38 | ToolbarItem(ToolbarItem::RELATIVE), |
36 | m_screen(screen), | 39 | m_screen(screen), |
@@ -46,7 +49,7 @@ IconbarTool::IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme, BScr | |||
46 | screen.currentWorkspaceSig().attach(this); | 49 | screen.currentWorkspaceSig().attach(this); |
47 | 50 | ||
48 | update(0); | 51 | update(0); |
49 | renderTheme(); | 52 | |
50 | } | 53 | } |
51 | 54 | ||
52 | IconbarTool::~IconbarTool() { | 55 | IconbarTool::~IconbarTool() { |
@@ -94,6 +97,10 @@ unsigned int IconbarTool::height() const { | |||
94 | return m_icon_container.height(); | 97 | return m_icon_container.height(); |
95 | } | 98 | } |
96 | 99 | ||
100 | unsigned int IconbarTool::borderWidth() const { | ||
101 | return m_icon_container.borderWidth(); | ||
102 | } | ||
103 | |||
97 | void IconbarTool::update(FbTk::Subject *subj) { | 104 | void IconbarTool::update(FbTk::Subject *subj) { |
98 | // ignore updates if we're shutting down | 105 | // ignore updates if we're shutting down |
99 | if (m_screen.isShuttingdown()) | 106 | if (m_screen.isShuttingdown()) |
@@ -138,10 +145,11 @@ void IconbarTool::update(FbTk::Subject *subj) { | |||
138 | Workspace::Windows::iterator it = space.windowList().begin(); | 145 | Workspace::Windows::iterator it = space.windowList().begin(); |
139 | Workspace::Windows::iterator it_end = space.windowList().end(); | 146 | Workspace::Windows::iterator it_end = space.windowList().end(); |
140 | for (; it != it_end; ++it) { | 147 | for (; it != it_end; ++it) { |
148 | |||
141 | // we just want windows that has clients | 149 | // we just want windows that has clients |
142 | if ((*it)->clientList().size() == 0) | 150 | if ((*it)->clientList().size() == 0) |
143 | continue; | 151 | continue; |
144 | 152 | ||
145 | IconButton *button = new IconButton(m_icon_container, m_theme.focusedText().font(), **it); | 153 | IconButton *button = new IconButton(m_icon_container, m_theme.focusedText().font(), **it); |
146 | items.push_back(button); | 154 | items.push_back(button); |
147 | m_icon_list.push_back(button); | 155 | m_icon_list.push_back(button); |
@@ -209,11 +217,16 @@ void IconbarTool::renderTheme() { | |||
209 | if (tmp) | 217 | if (tmp) |
210 | m_screen.imageControl().removeImage(m_empty_pm); | 218 | m_screen.imageControl().removeImage(m_empty_pm); |
211 | 219 | ||
220 | m_icon_container.setBorderWidth(m_theme.border().width()); | ||
221 | m_icon_container.setBorderColor(m_theme.border().color()); | ||
222 | |||
212 | // update buttons | 223 | // update buttons |
213 | IconList::iterator icon_it = m_icon_list.begin(); | 224 | IconList::iterator icon_it = m_icon_list.begin(); |
214 | IconList::iterator icon_it_end = m_icon_list.end(); | 225 | IconList::iterator icon_it_end = m_icon_list.end(); |
215 | for (; icon_it != icon_it_end; ++icon_it) | 226 | for (; icon_it != icon_it_end; ++icon_it) |
216 | renderButton(*(*icon_it)); | 227 | renderButton(*(*icon_it)); |
228 | |||
229 | |||
217 | } | 230 | } |
218 | 231 | ||
219 | void IconbarTool::renderButton(IconButton &button) { | 232 | void IconbarTool::renderButton(IconButton &button) { |
@@ -228,6 +241,9 @@ void IconbarTool::renderButton(IconButton &button) { | |||
228 | else | 241 | else |
229 | button.setBackgroundColor(m_theme.focusedTexture().color()); | 242 | button.setBackgroundColor(m_theme.focusedTexture().color()); |
230 | 243 | ||
244 | button.setBorderWidth(m_theme.focusedBorder().width()); | ||
245 | button.setBorderColor(m_theme.focusedBorder().color()); | ||
246 | |||
231 | } else { // unfocused | 247 | } else { // unfocused |
232 | button.setGC(m_theme.unfocusedText().textGC()); | 248 | button.setGC(m_theme.unfocusedText().textGC()); |
233 | button.setFont(m_theme.unfocusedText().font()); | 249 | button.setFont(m_theme.unfocusedText().font()); |
@@ -237,6 +253,9 @@ void IconbarTool::renderButton(IconButton &button) { | |||
237 | button.setBackgroundPixmap(m_unfocused_pm); | 253 | button.setBackgroundPixmap(m_unfocused_pm); |
238 | else | 254 | else |
239 | button.setBackgroundColor(m_theme.unfocusedTexture().color()); | 255 | button.setBackgroundColor(m_theme.unfocusedTexture().color()); |
256 | |||
257 | button.setBorderWidth(m_theme.unfocusedBorder().width()); | ||
258 | button.setBorderColor(m_theme.unfocusedBorder().color()); | ||
240 | } | 259 | } |
241 | } | 260 | } |
242 | 261 | ||