diff options
author | mathias <mathias> | 2005-05-06 18:04:14 (GMT) |
---|---|---|
committer | mathias <mathias> | 2005-05-06 18:04:14 (GMT) |
commit | 4338fbec76d8ca822dcb21c66b6d8e492ee49020 (patch) | |
tree | d99a44d5269b244e9fcea2bbddcd170ae91df6e6 | |
parent | 783a3903759117112e4120a5ff47b59f2a67cf06 (diff) | |
download | fluxbox_pavel-4338fbec76d8ca822dcb21c66b6d8e492ee49020.zip fluxbox_pavel-4338fbec76d8ca822dcb21c66b6d8e492ee49020.tar.bz2 |
Added new Buttons for the Titlebar of a Window (Mathias)
- Shade - just like the "Stick"-button
Styleresources:
window.shade.pixmap, window.shade.unfocus.pixmap, window.shade.pressed.pixmap
window.unshade.pixmap, window.unshade.unfocus.pixmap, window.unshade.pressed.pixmap
etc.
- MenuIcon - click on it provides the windowmenu, if the app
contains a pixmap (gvim, konqueror etc etc) the pixmap is displayed, a
little menu otherwise.
Styleresources:
windowmenu.pixmap, windowmenu.unfocus.pixmap windowmenu.pressed.pixmap
etc.
Example ~/.fluxbox/init - entry:
session.titlebar.left: MenuIcon Stick
session.titlebar.right: Shade Minimize Maximize Close
hint: if the app HAS a pixmap i use window.title.focus.pixmap (look
WinButtonTheme for reference)in pixmap-based-styles. this looks excellent and dont need
much extra-code to pipe that info into WinButtons.
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | src/Resources.cc | 8 | ||||
-rw-r--r-- | src/WinButton.cc | 166 | ||||
-rw-r--r-- | src/WinButton.hh | 11 | ||||
-rw-r--r-- | src/WinButtonTheme.cc | 17 | ||||
-rw-r--r-- | src/WinButtonTheme.hh | 85 | ||||
-rw-r--r-- | src/Window.cc | 11 | ||||
-rw-r--r-- | src/fluxbox.hh | 2 |
8 files changed, 256 insertions, 60 deletions
@@ -1,6 +1,22 @@ | |||
1 | (Format: Year/Month/Day) | 1 | (Format: Year/Month/Day) |
2 | Changes for 0.9.13 | 2 | Changes for 0.9.13 |
3 | *05/05/06: | 3 | *05/05/06: |
4 | * Added new Buttons for the Titlebar of a Window (Mathias) | ||
5 | - Shade - just like the "Stick"-button | ||
6 | Styleresources: | ||
7 | window.shade.pixmap, window.shade.unfocus.pixmap, window.shade.pressed.pixmap | ||
8 | window.unshade.pixmap, window.unshade.unfocus.pixmap, window.unshade.pressed.pixmap | ||
9 | etc. | ||
10 | - MenuIcon - click on it provides the windowmenu, if the app | ||
11 | contains a pixmap (gvim, konqueror etc etc) the pixmap is displayed, a | ||
12 | little menu otherwise. | ||
13 | Styleresources: | ||
14 | windowmenu.pixmap, windowmenu.unfocus.pixmap windowmenu.pressed.pixmap | ||
15 | etc. | ||
16 | Example ~/.fluxbox/init - entry: | ||
17 | session.titlebar.left: MenuIcon Stick | ||
18 | session.titlebar.right: Shade Minimize Maximize Close | ||
19 | Window.cc Resources.cc fluxbox.hh WinButton.cc/hh WinButtonTheme.cc/hh | ||
4 | * xrestop should now display "Fluxbox" (Simon) | 20 | * xrestop should now display "Fluxbox" (Simon) |
5 | Ewmh.hh/cc | 21 | Ewmh.hh/cc |
6 | * Fix potential segfault menu bug, thanks chenfeng (Simon) | 22 | * Fix potential segfault menu bug, thanks chenfeng (Simon) |
diff --git a/src/Resources.cc b/src/Resources.cc index 8b5d31f..ae0d72a 100644 --- a/src/Resources.cc +++ b/src/Resources.cc | |||
@@ -75,8 +75,8 @@ setFromString(char const *strval) { | |||
75 | m_value.push_back(Fluxbox::SHADE); | 75 | m_value.push_back(Fluxbox::SHADE); |
76 | else if (strcasecmp(val[i].c_str(), "Stick")==0) | 76 | else if (strcasecmp(val[i].c_str(), "Stick")==0) |
77 | m_value.push_back(Fluxbox::STICK); | 77 | m_value.push_back(Fluxbox::STICK); |
78 | else if (strcasecmp(val[i].c_str(), "Menu")==0) | 78 | else if (strcasecmp(val[i].c_str(), "MenuIcon")==0) |
79 | m_value.push_back(Fluxbox::MENU); | 79 | m_value.push_back(Fluxbox::MENUICON); |
80 | else if (strcasecmp(val[i].c_str(), "Close")==0) | 80 | else if (strcasecmp(val[i].c_str(), "Close")==0) |
81 | m_value.push_back(Fluxbox::CLOSE); | 81 | m_value.push_back(Fluxbox::CLOSE); |
82 | } | 82 | } |
@@ -150,8 +150,8 @@ getString() { | |||
150 | case Fluxbox::STICK: | 150 | case Fluxbox::STICK: |
151 | retval.append("Stick"); | 151 | retval.append("Stick"); |
152 | break; | 152 | break; |
153 | case Fluxbox::MENU: | 153 | case Fluxbox::MENUICON: |
154 | retval.append("Menu"); | 154 | retval.append("MenuIcon"); |
155 | break; | 155 | break; |
156 | default: | 156 | default: |
157 | break; | 157 | break; |
diff --git a/src/WinButton.cc b/src/WinButton.cc index 4802518..1a28e8f 100644 --- a/src/WinButton.cc +++ b/src/WinButton.cc | |||
@@ -21,22 +21,34 @@ | |||
21 | 21 | ||
22 | /// $Id$ | 22 | /// $Id$ |
23 | 23 | ||
24 | #include <X11/Xlib.h> | ||
25 | |||
24 | #include "WinButton.hh" | 26 | #include "WinButton.hh" |
25 | #include "App.hh" | 27 | #include "App.hh" |
26 | #include "Window.hh" | 28 | #include "Window.hh" |
29 | #include "Screen.hh" | ||
30 | #include "WinClient.hh" | ||
27 | #include "WinButtonTheme.hh" | 31 | #include "WinButtonTheme.hh" |
28 | #include "FbTk/Color.hh" | 32 | #include "FbTk/Color.hh" |
29 | 33 | ||
34 | #ifdef SHAPE | ||
35 | #include <X11/extensions/shape.h> | ||
36 | #endif // SHAPE | ||
37 | |||
38 | |||
30 | WinButton::WinButton(const FluxboxWindow &listen_to, | 39 | WinButton::WinButton(const FluxboxWindow &listen_to, |
31 | WinButtonTheme &theme, | 40 | WinButtonTheme &theme, |
32 | Type buttontype, const FbTk::FbWindow &parent, | 41 | Type buttontype, const FbTk::FbWindow &parent, |
33 | int x, int y, | 42 | int x, int y, |
34 | unsigned int width, unsigned int height): | 43 | unsigned int width, unsigned int height): |
35 | FbTk::Button(parent, x, y, width, height), | 44 | FbTk::Button(parent, x, y, width, height), |
36 | m_type(buttontype), m_listen_to(listen_to), m_theme(theme), | 45 | m_type(buttontype), m_listen_to(listen_to), m_theme(theme), |
46 | m_icon_pixmap(0), m_icon_mask(0), | ||
37 | overrode_bg(false), overrode_pressed(false) { | 47 | overrode_bg(false), overrode_pressed(false) { |
38 | |||
39 | theme.reconfigSig().attach(this); | 48 | theme.reconfigSig().attach(this); |
49 | |||
50 | if (buttontype == MENUICON) | ||
51 | update(0); | ||
40 | } | 52 | } |
41 | 53 | ||
42 | void WinButton::exposeEvent(XExposeEvent &event) { | 54 | void WinButton::exposeEvent(XExposeEvent &event) { |
@@ -51,7 +63,7 @@ void WinButton::buttonReleaseEvent(XButtonEvent &event) { | |||
51 | // when someone else tries to set the background, we may override it | 63 | // when someone else tries to set the background, we may override it |
52 | void WinButton::setBackgroundPixmap(Pixmap pm) { | 64 | void WinButton::setBackgroundPixmap(Pixmap pm) { |
53 | Pixmap my_pm = getBackgroundPixmap(); | 65 | Pixmap my_pm = getBackgroundPixmap(); |
54 | 66 | ||
55 | if (my_pm != 0) { | 67 | if (my_pm != 0) { |
56 | overrode_bg = true; | 68 | overrode_bg = true; |
57 | pm = my_pm; | 69 | pm = my_pm; |
@@ -114,9 +126,8 @@ Pixmap WinButton::getBackgroundPixmap() const { | |||
114 | else | 126 | else |
115 | return m_theme.iconifyUnfocusPixmap().pixmap().drawable(); | 127 | return m_theme.iconifyUnfocusPixmap().pixmap().drawable(); |
116 | break; | 128 | break; |
117 | case STICK: { | 129 | case STICK: |
118 | bool stuck = m_listen_to.isStuck(); | 130 | if (m_listen_to.isStuck()) { |
119 | if (stuck) { | ||
120 | if (focused) | 131 | if (focused) |
121 | return m_theme.stuckPixmap().pixmap().drawable(); | 132 | return m_theme.stuckPixmap().pixmap().drawable(); |
122 | else | 133 | else |
@@ -127,7 +138,6 @@ Pixmap WinButton::getBackgroundPixmap() const { | |||
127 | else | 138 | else |
128 | return m_theme.stickUnfocusPixmap().pixmap().drawable(); | 139 | return m_theme.stickUnfocusPixmap().pixmap().drawable(); |
129 | } | 140 | } |
130 | } | ||
131 | break; | 141 | break; |
132 | case CLOSE: | 142 | case CLOSE: |
133 | if (focused) | 143 | if (focused) |
@@ -135,11 +145,31 @@ Pixmap WinButton::getBackgroundPixmap() const { | |||
135 | else | 145 | else |
136 | return m_theme.closeUnfocusPixmap().pixmap().drawable(); | 146 | return m_theme.closeUnfocusPixmap().pixmap().drawable(); |
137 | break; | 147 | break; |
138 | case SHADE: | 148 | case SHADE: |
139 | if (focused) | 149 | if (m_listen_to.isShaded()) { |
140 | return m_theme.shadePixmap().pixmap().drawable(); | 150 | if (focused) |
141 | else | 151 | return m_theme.unshadePixmap().pixmap().drawable(); |
142 | return m_theme.shadeUnfocusPixmap().pixmap().drawable(); | 152 | else |
153 | return m_theme.unshadeUnfocusPixmap().pixmap().drawable(); | ||
154 | } else { | ||
155 | if (focused) | ||
156 | return m_theme.shadePixmap().pixmap().drawable(); | ||
157 | else | ||
158 | return m_theme.shadeUnfocusPixmap().pixmap().drawable(); | ||
159 | } | ||
160 | break; | ||
161 | case MENUICON: | ||
162 | if (m_icon_pixmap.drawable()) { | ||
163 | if (focused) | ||
164 | return m_theme.titleFocusPixmap().pixmap().drawable(); | ||
165 | else | ||
166 | return m_theme.titleUnfocusPixmap().pixmap().drawable(); | ||
167 | } else { | ||
168 | if (focused) | ||
169 | return m_theme.menuiconPixmap().pixmap().drawable(); | ||
170 | else | ||
171 | return m_theme.menuiconUnfocusPixmap().pixmap().drawable(); | ||
172 | } | ||
143 | break; | 173 | break; |
144 | } | 174 | } |
145 | return None; | 175 | return None; |
@@ -156,23 +186,33 @@ Pixmap WinButton::getPressedPixmap() const { | |||
156 | case CLOSE: | 186 | case CLOSE: |
157 | return m_theme.closePressedPixmap().pixmap().drawable(); | 187 | return m_theme.closePressedPixmap().pixmap().drawable(); |
158 | case SHADE: | 188 | case SHADE: |
159 | return m_theme.shadePressedPixmap().pixmap().drawable(); | 189 | if (m_listen_to.isShaded()) |
190 | return m_theme.unshadePressedPixmap().pixmap().drawable(); | ||
191 | else | ||
192 | return m_theme.shadePressedPixmap().pixmap().drawable(); | ||
193 | case MENUICON: | ||
194 | if (m_icon_pixmap.drawable()) | ||
195 | if (m_listen_to.isFocused()) | ||
196 | return m_theme.titleFocusPixmap().pixmap().drawable(); | ||
197 | else | ||
198 | return m_theme.titleUnfocusPixmap().pixmap().drawable(); | ||
199 | else | ||
200 | return m_theme.menuiconPressedPixmap().pixmap().drawable(); | ||
160 | } | 201 | } |
161 | return None; | 202 | return None; |
162 | } | 203 | } |
163 | 204 | ||
164 | // clear is used to force this to clear the window (e.g. called from clear()) | 205 | // clear is used to force this to clear the window (e.g. called from clear()) |
165 | void WinButton::drawType() { | 206 | void WinButton::drawType() { |
166 | bool used = false; | ||
167 | 207 | ||
168 | // if it's odd and we're centring, we need to add one | 208 | // if it's odd and we're centring, we need to add one |
169 | int oddW = width()%2; | 209 | int oddW = width()%2; |
170 | int oddH = height()%2; | 210 | int oddH = height()%2; |
171 | 211 | ||
172 | bool is_pressed = pressed(); | 212 | bool is_pressed = pressed(); |
173 | if (is_pressed && overrode_pressed) | 213 | if (is_pressed && overrode_pressed && !m_icon_pixmap.drawable()) |
174 | return; | 214 | return; |
175 | if (!is_pressed && overrode_bg) | 215 | if (!is_pressed && overrode_bg && !m_icon_pixmap.drawable()) |
176 | return; | 216 | return; |
177 | if (gc() == 0) | 217 | if (gc() == 0) |
178 | return; | 218 | return; |
@@ -190,8 +230,7 @@ void WinButton::drawType() { | |||
190 | 2, 3, width() - 3, 3); | 230 | 2, 3, width() - 3, 3); |
191 | break; | 231 | break; |
192 | case MINIMIZE: | 232 | case MINIMIZE: |
193 | FbTk::FbWindow::drawRectangle(gc(), | 233 | drawRectangle(gc(), 2, height() - 5, width() - 5, 2); |
194 | 2, height() - 5, width() - 5, 2); | ||
195 | break; | 234 | break; |
196 | case STICK: | 235 | case STICK: |
197 | // width/4 != width/2, so we use /4*2 so that it's properly centred | 236 | // width/4 != width/2, so we use /4*2 so that it's properly centred |
@@ -225,17 +264,106 @@ void WinButton::drawType() { | |||
225 | width() - 3, 2); | 264 | width() - 3, 2); |
226 | break; | 265 | break; |
227 | case SHADE: | 266 | case SHADE: |
228 | // no cute image defined | 267 | |
268 | drawRectangle(gc(), 2, 2, width() - 5 - oddW, 2); | ||
269 | |||
270 | XPoint points[3]; | ||
271 | if (m_listen_to.isShaded()) { | ||
272 | points[1].x = (width() / 2) - 3; points[1].y = 7; | ||
273 | points[2].x = (width() / 2) + 4 - oddW; points[2].y = 7; | ||
274 | points[0].x = (width() / 2); points[0].y = height() / 2 + 2; | ||
275 | } else { | ||
276 | points[0].x = (width() / 2); points[0].y = 6; | ||
277 | points[1].x = (width() / 2) - 4; points[1].y = height() / 2 + 2; | ||
278 | points[2].x = (width() / 2) + 4 - oddW; points[2].y = height() / 2 + 2; | ||
279 | } | ||
280 | fillPolygon(gc(), points, 3, Convex, CoordModeOrigin); | ||
281 | break; | ||
282 | case MENUICON: | ||
283 | if (m_icon_pixmap.drawable()) { | ||
284 | |||
285 | if (m_icon_mask.drawable()) { | ||
286 | XSetClipMask(m_listen_to.fbWindow().display(), | ||
287 | gc(), m_icon_mask.drawable()); | ||
288 | XSetClipOrigin(m_listen_to.fbWindow().display(), | ||
289 | gc(), 2, 2); | ||
290 | } | ||
291 | |||
292 | copyArea(m_icon_pixmap.drawable(), | ||
293 | gc(), | ||
294 | 0, 0, | ||
295 | 2, 2, | ||
296 | m_icon_pixmap.width(), m_icon_pixmap.height()); | ||
297 | |||
298 | if (m_icon_mask.drawable()) | ||
299 | XSetClipMask(m_listen_to.fbWindow().display(), gc(), None); | ||
300 | } else { | ||
301 | for (int y = height()/3; y <= height() - height()/3; y+=3) { | ||
302 | drawLine(gc(), width()/4, y, width() - width()/4 - oddW - 1, y); | ||
303 | } | ||
304 | drawRectangle(gc(), | ||
305 | 2, 2, width() - 5, height() - 5); | ||
306 | } | ||
229 | break; | 307 | break; |
230 | } | 308 | } |
231 | } | 309 | } |
232 | 310 | ||
233 | void WinButton::clear() { | 311 | void WinButton::clear() { |
234 | FbTk::Button::clear(); | 312 | FbTk::Button::clear(); |
313 | |||
314 | if (m_type == MENUICON && ( | ||
315 | !m_icon_pixmap.drawable() || | ||
316 | (m_icon_pixmap.width() != width() - 4 || | ||
317 | m_icon_pixmap.height() != height() - 4))) { | ||
318 | |||
319 | Display* display = m_listen_to.fbWindow().display(); | ||
320 | int screen = m_listen_to.screen().screenNumber(); | ||
321 | XWMHints* hints = XGetWMHints(display, m_listen_to.winClient().window()); | ||
322 | if (hints == 0) { | ||
323 | m_icon_pixmap.release(); | ||
324 | m_icon_mask.release(); | ||
325 | } else { | ||
326 | if ((hints->flags & IconPixmapHint) && hints->icon_pixmap != 0) { | ||
327 | m_icon_pixmap.copy(hints->icon_pixmap, | ||
328 | DefaultDepth(display, screen), screen); | ||
329 | m_icon_pixmap.scale(width() - 4, height() - 4); | ||
330 | } else | ||
331 | m_icon_pixmap.release(); | ||
332 | |||
333 | if ((hints->flags & IconMaskHint)) { | ||
334 | m_icon_mask.copy(hints->icon_mask, 0, 0); | ||
335 | m_icon_mask.scale(width() - 4, height() - 4); | ||
336 | } else | ||
337 | m_icon_mask.release(); | ||
338 | } | ||
339 | |||
340 | XFree(hints); | ||
341 | } | ||
342 | |||
235 | drawType(); | 343 | drawType(); |
236 | } | 344 | } |
237 | 345 | ||
238 | void WinButton::update(FbTk::Subject *subj) { | 346 | void WinButton::update(FbTk::Subject *subj) { |
347 | |||
348 | |||
349 | // just checking, if we the app provides a pixmap. | ||
350 | if (m_type == MENUICON) { | ||
351 | XWMHints* hints = XGetWMHints(m_listen_to.fbWindow().display(), | ||
352 | m_listen_to.winClient().window()); | ||
353 | if (hints == 0) { | ||
354 | m_icon_pixmap.release(); | ||
355 | m_icon_mask.release(); | ||
356 | } else { | ||
357 | if (!((hints->flags & IconPixmapHint) && hints->icon_pixmap != 0)) | ||
358 | m_icon_pixmap.release(); | ||
359 | |||
360 | if (!(hints->flags & IconMaskHint)) | ||
361 | m_icon_mask.release(); | ||
362 | } | ||
363 | |||
364 | XFree(hints); | ||
365 | } | ||
366 | |||
239 | // pressed_pixmap isn't stateful in any current buttons, so no need | 367 | // pressed_pixmap isn't stateful in any current buttons, so no need |
240 | // to potentially override that. Just make sure background pm is ok | 368 | // to potentially override that. Just make sure background pm is ok |
241 | Pixmap my_pm = getBackgroundPixmap(); | 369 | Pixmap my_pm = getBackgroundPixmap(); |
diff --git a/src/WinButton.hh b/src/WinButton.hh index e0036af..e4482d3 100644 --- a/src/WinButton.hh +++ b/src/WinButton.hh | |||
@@ -21,8 +21,9 @@ | |||
21 | 21 | ||
22 | /// $Id$ | 22 | /// $Id$ |
23 | 23 | ||
24 | #include "Button.hh" | 24 | #include "FbTk/Button.hh" |
25 | #include "Observer.hh" | 25 | #include "FbTk/Observer.hh" |
26 | #include "FbTk/FbPixmap.hh" | ||
26 | 27 | ||
27 | class FluxboxWindow; | 28 | class FluxboxWindow; |
28 | class WinButtonTheme; | 29 | class WinButtonTheme; |
@@ -35,7 +36,7 @@ class Color; | |||
35 | class WinButton:public FbTk::Button, public FbTk::Observer { | 36 | class WinButton:public FbTk::Button, public FbTk::Observer { |
36 | public: | 37 | public: |
37 | /// draw type for the button | 38 | /// draw type for the button |
38 | enum Type {MAXIMIZE, MINIMIZE, SHADE, STICK, CLOSE}; | 39 | enum Type {MAXIMIZE, MINIMIZE, SHADE, STICK, CLOSE, MENUICON}; |
39 | WinButton(const FluxboxWindow &listen_to, | 40 | WinButton(const FluxboxWindow &listen_to, |
40 | WinButtonTheme &theme, | 41 | WinButtonTheme &theme, |
41 | Type buttontype, const FbTk::FbWindow &parent, int x, int y, | 42 | Type buttontype, const FbTk::FbWindow &parent, int x, int y, |
@@ -58,5 +59,9 @@ private: | |||
58 | Type m_type; ///< the button type | 59 | Type m_type; ///< the button type |
59 | const FluxboxWindow &m_listen_to; | 60 | const FluxboxWindow &m_listen_to; |
60 | WinButtonTheme &m_theme; | 61 | WinButtonTheme &m_theme; |
62 | |||
63 | FbTk::FbPixmap m_icon_pixmap; | ||
64 | FbTk::FbPixmap m_icon_mask; | ||
65 | |||
61 | bool overrode_bg, overrode_pressed; | 66 | bool overrode_bg, overrode_pressed; |
62 | }; | 67 | }; |
diff --git a/src/WinButtonTheme.cc b/src/WinButtonTheme.cc index 6462cbe..f4d4c24 100644 --- a/src/WinButtonTheme.cc +++ b/src/WinButtonTheme.cc | |||
@@ -43,6 +43,14 @@ WinButtonTheme::WinButtonTheme(int screen_num, const FbWinFrameTheme &frame_them | |||
43 | m_shade_pm(*this, "window.shade.pixmap", "Window.Shade.Pixmap"), | 43 | m_shade_pm(*this, "window.shade.pixmap", "Window.Shade.Pixmap"), |
44 | m_shade_unfocus_pm(*this, "window.shade.unfocus.pixmap", "Window.Shade.Unfocus.Pixmap"), | 44 | m_shade_unfocus_pm(*this, "window.shade.unfocus.pixmap", "Window.Shade.Unfocus.Pixmap"), |
45 | m_shade_pressed_pm(*this, "window.shade.pressed.pixmap", "Window.Shade.Pressed.Pixmap"), | 45 | m_shade_pressed_pm(*this, "window.shade.pressed.pixmap", "Window.Shade.Pressed.Pixmap"), |
46 | m_unshade_pm(*this, "window.unshade.pixmap", "Window.Unshade.Pixmap"), | ||
47 | m_unshade_unfocus_pm(*this, "window.unshade.unfocus.pixmap", "Window.Unhade.Unfocus.Pixmap"), | ||
48 | m_unshade_pressed_pm(*this, "window.unshade.pressed.pixmap", "Window.Unshade.Pressed.Pixmap"), | ||
49 | m_menuicon_pm(*this, "window.menuicon.pixmap", "Window.MenuIcon.Pixmap"), | ||
50 | m_menuicon_unfocus_pm(*this, "window.menuicon.unfocus.pixmap", "Window.MenuIcon.Unfocus.Pixmap"), | ||
51 | m_menuicon_pressed_pm(*this, "window.menuicon.pressed.pixmap", "Window.MenuIcon.Pressed.Pixmap"), | ||
52 | m_title_focus_pm(*this, "window.title.focus.pixmap", "Window.Title.Focus.Pixmap"), | ||
53 | m_title_unfocus_pm(*this, "window.title.unfocus.pixmap", "Window.Title.UnFocus.Pixmap"), | ||
46 | m_stick_pm(*this, "window.stick.pixmap", "Window.Stick.Pixmap"), | 54 | m_stick_pm(*this, "window.stick.pixmap", "Window.Stick.Pixmap"), |
47 | m_stick_unfocus_pm(*this, "window.stick.unfocus.pixmap", "Window.Stick.Unfocus.Pixmap"), | 55 | m_stick_unfocus_pm(*this, "window.stick.unfocus.pixmap", "Window.Stick.Unfocus.Pixmap"), |
48 | m_stick_pressed_pm(*this, "window.stick.pressed.pixmap", "Window.Stick.Pressed.Pixmap"), | 56 | m_stick_pressed_pm(*this, "window.stick.pressed.pixmap", "Window.Stick.Pressed.Pixmap"), |
@@ -70,7 +78,7 @@ void WinButtonTheme::reconfigTheme() { | |||
70 | m_close_pm->scale(size, size); | 78 | m_close_pm->scale(size, size); |
71 | m_close_unfocus_pm->scale(size, size); | 79 | m_close_unfocus_pm->scale(size, size); |
72 | m_close_pressed_pm->scale(size, size); | 80 | m_close_pressed_pm->scale(size, size); |
73 | 81 | ||
74 | m_maximize_pm->scale(size, size); | 82 | m_maximize_pm->scale(size, size); |
75 | m_maximize_unfocus_pm->scale(size, size); | 83 | m_maximize_unfocus_pm->scale(size, size); |
76 | m_maximize_pressed_pm->scale(size, size); | 84 | m_maximize_pressed_pm->scale(size, size); |
@@ -83,6 +91,13 @@ void WinButtonTheme::reconfigTheme() { | |||
83 | m_shade_unfocus_pm->scale(size, size); | 91 | m_shade_unfocus_pm->scale(size, size); |
84 | m_shade_pressed_pm->scale(size, size); | 92 | m_shade_pressed_pm->scale(size, size); |
85 | 93 | ||
94 | m_unshade_pm->scale(size, size); | ||
95 | m_unshade_unfocus_pm->scale(size, size); | ||
96 | m_unshade_pressed_pm->scale(size, size); | ||
97 | |||
98 | m_title_focus_pm->scale(size, size); | ||
99 | m_title_unfocus_pm->scale(size, size); | ||
100 | |||
86 | m_stick_pm->scale(size, size); | 101 | m_stick_pm->scale(size, size); |
87 | m_stick_unfocus_pm->scale(size, size); | 102 | m_stick_unfocus_pm->scale(size, size); |
88 | m_stick_pressed_pm->scale(size, size); | 103 | m_stick_pressed_pm->scale(size, size); |
diff --git a/src/WinButtonTheme.hh b/src/WinButtonTheme.hh index 9a26a26..acd1785 100644 --- a/src/WinButtonTheme.hh +++ b/src/WinButtonTheme.hh | |||
@@ -36,38 +36,55 @@ public: | |||
36 | 36 | ||
37 | void reconfigTheme(); | 37 | void reconfigTheme(); |
38 | 38 | ||
39 | inline const FbTk::PixmapWithMask &closePixmap() const { return *m_close_pm; } | 39 | const FbTk::PixmapWithMask &closePixmap() const { return *m_close_pm; } |
40 | inline FbTk::PixmapWithMask &closePixmap() { return *m_close_pm; } | 40 | FbTk::PixmapWithMask &closePixmap() { return *m_close_pm; } |
41 | inline FbTk::PixmapWithMask &closeUnfocusPixmap() { return *m_close_unfocus_pm; } | 41 | FbTk::PixmapWithMask &closeUnfocusPixmap() { return *m_close_unfocus_pm; } |
42 | inline const FbTk::PixmapWithMask &closePressedPixmap() const { return *m_close_pressed_pm; } | 42 | const FbTk::PixmapWithMask &closePressedPixmap() const { return *m_close_pressed_pm; } |
43 | inline FbTk::PixmapWithMask &closePressedPixmap() { return *m_close_pressed_pm; } | 43 | FbTk::PixmapWithMask &closePressedPixmap() { return *m_close_pressed_pm; } |
44 | 44 | ||
45 | inline const FbTk::PixmapWithMask &maximizePixmap() const { return *m_maximize_pm; } | 45 | const FbTk::PixmapWithMask &maximizePixmap() const { return *m_maximize_pm; } |
46 | inline FbTk::PixmapWithMask &maximizePixmap() { return *m_maximize_pm; } | 46 | FbTk::PixmapWithMask &maximizePixmap() { return *m_maximize_pm; } |
47 | inline FbTk::PixmapWithMask &maximizeUnfocusPixmap() { return *m_maximize_unfocus_pm; } | 47 | FbTk::PixmapWithMask &maximizeUnfocusPixmap() { return *m_maximize_unfocus_pm; } |
48 | inline const FbTk::PixmapWithMask &maximizePressedPixmap() const { return *m_maximize_pressed_pm; } | 48 | const FbTk::PixmapWithMask &maximizePressedPixmap() const { return *m_maximize_pressed_pm; } |
49 | inline FbTk::PixmapWithMask &maximizePressedPixmap() { return *m_maximize_pressed_pm; } | 49 | FbTk::PixmapWithMask &maximizePressedPixmap() { return *m_maximize_pressed_pm; } |
50 | 50 | ||
51 | inline const FbTk::PixmapWithMask &iconifyPixmap() const { return *m_iconify_pm; } | 51 | const FbTk::PixmapWithMask &iconifyPixmap() const { return *m_iconify_pm; } |
52 | inline FbTk::PixmapWithMask &iconifyPixmap() { return *m_iconify_pm; } | 52 | FbTk::PixmapWithMask &iconifyPixmap() { return *m_iconify_pm; } |
53 | inline FbTk::PixmapWithMask &iconifyUnfocusPixmap() { return *m_iconify_unfocus_pm; } | 53 | FbTk::PixmapWithMask &iconifyUnfocusPixmap() { return *m_iconify_unfocus_pm; } |
54 | inline const FbTk::PixmapWithMask &iconifyPressedPixmap() const { return *m_iconify_pressed_pm; } | 54 | const FbTk::PixmapWithMask &iconifyPressedPixmap() const { return *m_iconify_pressed_pm; } |
55 | inline FbTk::PixmapWithMask &iconifyPressedPixmap() { return *m_iconify_pressed_pm; } | 55 | FbTk::PixmapWithMask &iconifyPressedPixmap() { return *m_iconify_pressed_pm; } |
56 | 56 | ||
57 | inline const FbTk::PixmapWithMask &stickPixmap() const { return *m_stick_pm; } | 57 | const FbTk::PixmapWithMask &stickPixmap() const { return *m_stick_pm; } |
58 | inline FbTk::PixmapWithMask &stickPixmap() { return *m_stick_pm; } | 58 | FbTk::PixmapWithMask &stickPixmap() { return *m_stick_pm; } |
59 | inline FbTk::PixmapWithMask &stickUnfocusPixmap() { return *m_stick_unfocus_pm; } | 59 | FbTk::PixmapWithMask &stickUnfocusPixmap() { return *m_stick_unfocus_pm; } |
60 | inline const FbTk::PixmapWithMask &stickPressedPixmap() const { return *m_stick_pressed_pm; } | 60 | const FbTk::PixmapWithMask &stickPressedPixmap() const { return *m_stick_pressed_pm; } |
61 | inline FbTk::PixmapWithMask &stickPressedPixmap() { return *m_stick_pressed_pm; } | 61 | FbTk::PixmapWithMask &stickPressedPixmap() { return *m_stick_pressed_pm; } |
62 | 62 | ||
63 | inline FbTk::PixmapWithMask &stuckPixmap() { return *m_stuck_pm; } | 63 | FbTk::PixmapWithMask &stuckPixmap() { return *m_stuck_pm; } |
64 | inline FbTk::PixmapWithMask &stuckUnfocusPixmap() { return *m_stuck_unfocus_pm; } | 64 | FbTk::PixmapWithMask &stuckUnfocusPixmap() { return *m_stuck_unfocus_pm; } |
65 | 65 | ||
66 | inline const FbTk::PixmapWithMask &shadePixmap() const { return *m_shade_pm; } | 66 | const FbTk::PixmapWithMask &shadePixmap() const { return *m_shade_pm; } |
67 | inline FbTk::PixmapWithMask &shadePixmap() { return *m_shade_pm; } | 67 | FbTk::PixmapWithMask &shadePixmap() { return *m_shade_pm; } |
68 | inline FbTk::PixmapWithMask &shadeUnfocusPixmap() { return *m_shade_unfocus_pm; } | 68 | FbTk::PixmapWithMask &shadeUnfocusPixmap() { return *m_shade_unfocus_pm; } |
69 | inline const FbTk::PixmapWithMask &shadePressedPixmap() const { return *m_shade_pressed_pm; } | 69 | const FbTk::PixmapWithMask &shadePressedPixmap() const { return *m_shade_pressed_pm; } |
70 | inline FbTk::PixmapWithMask &shadePressedPixmap() { return *m_shade_pressed_pm; } | 70 | FbTk::PixmapWithMask &shadePressedPixmap() { return *m_shade_pressed_pm; } |
71 | |||
72 | const FbTk::PixmapWithMask &unshadePixmap() const { return *m_unshade_pm; } | ||
73 | FbTk::PixmapWithMask &unshadePixmap() { return *m_unshade_pm; } | ||
74 | FbTk::PixmapWithMask &unshadeUnfocusPixmap() { return *m_unshade_unfocus_pm; } | ||
75 | const FbTk::PixmapWithMask &unshadePressedPixmap() const { return *m_unshade_pressed_pm; } | ||
76 | FbTk::PixmapWithMask &unshadePressedPixmap() { return *m_unshade_pressed_pm; } | ||
77 | |||
78 | const FbTk::PixmapWithMask &menuiconPixmap() const { return *m_menuicon_pm; } | ||
79 | FbTk::PixmapWithMask &menuiconPixmap() { return *m_menuicon_pm; } | ||
80 | FbTk::PixmapWithMask &menuiconUnfocusPixmap() { return *m_menuicon_unfocus_pm; } | ||
81 | const FbTk::PixmapWithMask &menuiconPressedPixmap() const { return *m_menuicon_pressed_pm; } | ||
82 | FbTk::PixmapWithMask &menuiconPressedPixmap() { return *m_menuicon_pressed_pm; } | ||
83 | |||
84 | FbTk::PixmapWithMask &titleFocusPixmap() { return *m_title_focus_pm; } | ||
85 | const FbTk::PixmapWithMask &titleFocusPixmap() const { return *m_title_focus_pm; } | ||
86 | FbTk::PixmapWithMask &titleUnfocusPixmap() { return *m_title_unfocus_pm; } | ||
87 | const FbTk::PixmapWithMask &titleUnfocusPixmap() const { return *m_title_unfocus_pm; } | ||
71 | 88 | ||
72 | private: | 89 | private: |
73 | 90 | ||
@@ -75,6 +92,10 @@ private: | |||
75 | FbTk::ThemeItem<FbTk::PixmapWithMask> m_maximize_pm, m_maximize_unfocus_pm, m_maximize_pressed_pm; | 92 | FbTk::ThemeItem<FbTk::PixmapWithMask> m_maximize_pm, m_maximize_unfocus_pm, m_maximize_pressed_pm; |
76 | FbTk::ThemeItem<FbTk::PixmapWithMask> m_iconify_pm, m_iconify_unfocus_pm, m_iconify_pressed_pm; | 93 | FbTk::ThemeItem<FbTk::PixmapWithMask> m_iconify_pm, m_iconify_unfocus_pm, m_iconify_pressed_pm; |
77 | FbTk::ThemeItem<FbTk::PixmapWithMask> m_shade_pm, m_shade_unfocus_pm, m_shade_pressed_pm; | 94 | FbTk::ThemeItem<FbTk::PixmapWithMask> m_shade_pm, m_shade_unfocus_pm, m_shade_pressed_pm; |
95 | FbTk::ThemeItem<FbTk::PixmapWithMask> m_unshade_pm, m_unshade_unfocus_pm, m_unshade_pressed_pm; | ||
96 | FbTk::ThemeItem<FbTk::PixmapWithMask> m_menuicon_pm, m_menuicon_unfocus_pm, m_menuicon_pressed_pm; | ||
97 | // why this? we need this for the background of the appicon in WinButtons | ||
98 | FbTk::ThemeItem<FbTk::PixmapWithMask> m_title_focus_pm, m_title_unfocus_pm; | ||
78 | FbTk::ThemeItem<FbTk::PixmapWithMask> m_stick_pm, m_stick_unfocus_pm, m_stick_pressed_pm; | 99 | FbTk::ThemeItem<FbTk::PixmapWithMask> m_stick_pm, m_stick_unfocus_pm, m_stick_pressed_pm; |
79 | FbTk::ThemeItem<FbTk::PixmapWithMask> m_stuck_pm, m_stuck_unfocus_pm; | 100 | FbTk::ThemeItem<FbTk::PixmapWithMask> m_stuck_pm, m_stuck_unfocus_pm; |
80 | 101 | ||
diff --git a/src/Window.cc b/src/Window.cc index 08a87ab..2c7103b 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -3834,7 +3834,18 @@ void FluxboxWindow::setupWindow() { | |||
3834 | WinButton::SHADE, | 3834 | WinButton::SHADE, |
3835 | frame().titlebar(), | 3835 | frame().titlebar(), |
3836 | 0, 0, 10, 10); | 3836 | 0, 0, 10, 10); |
3837 | stateSig().attach(winbtn); | ||
3837 | winbtn->setOnClick(shade_cmd); | 3838 | winbtn->setOnClick(shade_cmd); |
3839 | newbutton = winbtn; | ||
3840 | } else if ((*dir)[i] == Fluxbox::MENUICON) { | ||
3841 | WinButton* winbtn = new WinButton(*this, winbutton_theme, | ||
3842 | WinButton::MENUICON, | ||
3843 | frame().titlebar(), | ||
3844 | 0, 0, 10, 10); | ||
3845 | hintSig().attach(winbtn); | ||
3846 | titleSig().attach(winbtn); | ||
3847 | winbtn->setOnClick(show_menu_cmd); | ||
3848 | newbutton = winbtn; | ||
3838 | } | 3849 | } |
3839 | 3850 | ||
3840 | if (newbutton != 0) { | 3851 | if (newbutton != 0) { |
diff --git a/src/fluxbox.hh b/src/fluxbox.hh index f96e7eb..0da630d 100644 --- a/src/fluxbox.hh +++ b/src/fluxbox.hh | |||
@@ -109,7 +109,7 @@ public: | |||
109 | void removeAtomHandler(AtomHandler *atomh); | 109 | void removeAtomHandler(AtomHandler *atomh); |
110 | 110 | ||
111 | /// obsolete | 111 | /// obsolete |
112 | enum Titlebar{SHADE=0, MINIMIZE, MAXIMIZE, CLOSE, STICK, MENU, EMPTY}; | 112 | enum Titlebar{SHADE=0, MINIMIZE, MAXIMIZE, CLOSE, STICK, MENUICON, EMPTY}; |
113 | enum TabsAttachArea{ATTACH_AREA_WINDOW= 0, ATTACH_AREA_TITLEBAR}; | 113 | enum TabsAttachArea{ATTACH_AREA_WINDOW= 0, ATTACH_AREA_TITLEBAR}; |
114 | 114 | ||
115 | 115 | ||