diff options
author | Mathias Gumz <akira@fluxbox.org> | 2015-01-23 14:23:02 (GMT) |
---|---|---|
committer | Mathias Gumz <akira@fluxbox.org> | 2015-01-23 14:23:02 (GMT) |
commit | 63d9d695be8156530fabf1d2e033225bfa71bab1 (patch) | |
tree | 51c0195272efd5321dc674fa1e10a3007dde1ef2 /src/FbWinFrame.hh | |
parent | 0d8a3dfb6b47753577881b11f25b2a95163ce158 (diff) | |
download | fluxbox-63d9d695be8156530fabf1d2e033225bfa71bab1.zip fluxbox-63d9d695be8156530fabf1d2e033225bfa71bab1.tar.bz2 |
Refactor FbWinFrame
FbWinFrame is now simpler to read due to less overall noise.
Diffstat (limited to 'src/FbWinFrame.hh')
-rw-r--r-- | src/FbWinFrame.hh | 63 |
1 files changed, 17 insertions, 46 deletions
diff --git a/src/FbWinFrame.hh b/src/FbWinFrame.hh index 46c6a7c..f8961c8 100644 --- a/src/FbWinFrame.hh +++ b/src/FbWinFrame.hh | |||
@@ -30,7 +30,6 @@ | |||
30 | #include "FbTk/Color.hh" | 30 | #include "FbTk/Color.hh" |
31 | #include "FbTk/LayerItem.hh" | 31 | #include "FbTk/LayerItem.hh" |
32 | #include "FbTk/TextButton.hh" | 32 | #include "FbTk/TextButton.hh" |
33 | #include "FbTk/DefaultValue.hh" | ||
34 | #include "FbTk/Container.hh" | 33 | #include "FbTk/Container.hh" |
35 | #include "FbTk/Shape.hh" | 34 | #include "FbTk/Shape.hh" |
36 | #include "FbTk/Signal.hh" | 35 | #include "FbTk/Signal.hh" |
@@ -73,12 +72,6 @@ public: | |||
73 | FbWinFrame(BScreen &screen, unsigned int client_depth, WindowState &state, | 72 | FbWinFrame(BScreen &screen, unsigned int client_depth, WindowState &state, |
74 | FocusableTheme<FbWinFrameTheme> &theme); | 73 | FocusableTheme<FbWinFrameTheme> &theme); |
75 | 74 | ||
76 | /* /// create a frame window inside another FbWindow, NOT IMPLEMENTED! | ||
77 | FbWinFrame(BScreen &screen, FbWinFrameTheme &theme, FbTk::ImageControl &imgctrl, | ||
78 | const FbTk::FbWindow &parent, | ||
79 | int x, int y, | ||
80 | unsigned int width, unsigned int height); | ||
81 | */ | ||
82 | /// destroy frame | 75 | /// destroy frame |
83 | ~FbWinFrame(); | 76 | ~FbWinFrame(); |
84 | 77 | ||
@@ -119,8 +112,8 @@ public: | |||
119 | 112 | ||
120 | /// Alpha settings | 113 | /// Alpha settings |
121 | void setAlpha(bool focused, int value); | 114 | void setAlpha(bool focused, int value); |
122 | void applyAlpha(); | ||
123 | int getAlpha(bool focused) const; | 115 | int getAlpha(bool focused) const; |
116 | void applyAlpha(); | ||
124 | 117 | ||
125 | void setDefaultAlpha(); | 118 | void setDefaultAlpha(); |
126 | bool getUseDefaultAlpha() const; | 119 | bool getUseDefaultAlpha() const; |
@@ -258,10 +251,6 @@ private: | |||
258 | 251 | ||
259 | void renderButtons(); // subset of renderTitlebar - don't call directly | 252 | void renderButtons(); // subset of renderTitlebar - don't call directly |
260 | 253 | ||
261 | /// renders to pixmap or sets color | ||
262 | void render(const FbTk::Texture &tex, FbTk::Color &col, Pixmap &pm, | ||
263 | unsigned int width, unsigned int height, FbTk::Orientation orient = FbTk::ROT0); | ||
264 | |||
265 | //@} | 254 | //@} |
266 | 255 | ||
267 | // these return true/false for if something changed | 256 | // these return true/false for if something changed |
@@ -286,8 +275,10 @@ private: | |||
286 | void applyTabContainer(); // and label buttons | 275 | void applyTabContainer(); // and label buttons |
287 | void applyButtons(); // only called within applyTitlebar | 276 | void applyButtons(); // only called within applyTitlebar |
288 | 277 | ||
278 | #if 0 | ||
289 | void getCurrentFocusPixmap(Pixmap &label_pm, Pixmap &title_pm, | 279 | void getCurrentFocusPixmap(Pixmap &label_pm, Pixmap &title_pm, |
290 | FbTk::Color &label_color, FbTk::Color &title_color); | 280 | FbTk::Color &label_color, FbTk::Color &title_color); |
281 | #endif | ||
291 | 282 | ||
292 | /// initiate inserted button for current theme | 283 | /// initiate inserted button for current theme |
293 | void applyButton(FbTk::Button &btn); | 284 | void applyButton(FbTk::Button &btn); |
@@ -338,36 +329,19 @@ private: | |||
338 | @name pixmaps and colors for rendering | 329 | @name pixmaps and colors for rendering |
339 | */ | 330 | */ |
340 | //@{ | 331 | //@{ |
341 | Pixmap m_title_focused_pm; ///< pixmap for focused title | 332 | |
342 | FbTk::Color m_title_focused_color; ///< color for focused title | 333 | // 0-unfocus, 1-focus |
343 | Pixmap m_title_unfocused_pm; ///< pixmap for unfocused title | 334 | struct Face { Pixmap pm[2]; FbTk::Color color[2]; }; |
344 | FbTk::Color m_title_unfocused_color; ///< color for unfocused title | 335 | // 0-unfocus, 1-focus, 2-pressed |
345 | 336 | struct BtnFace { Pixmap pm[3]; FbTk::Color color[3]; }; | |
346 | Pixmap m_label_focused_pm; ///< pixmap for focused label (only visible with external tabs) | 337 | |
347 | FbTk::Color m_label_focused_color; ///< color for focused label | 338 | Face m_title_face; |
348 | Pixmap m_label_unfocused_pm; ///< pixmap for unfocused label | 339 | Face m_label_face; |
349 | FbTk::Color m_label_unfocused_color; ///< color for unfocused label | 340 | Face m_tabcontainer_face; |
350 | 341 | Face m_handle_face; | |
351 | Pixmap m_tabcontainer_focused_pm; ///< pixmap for focused tab container | 342 | Face m_grip_face; |
352 | FbTk::Color m_tabcontainer_focused_color; ///< color for focused tab container | 343 | BtnFace m_button_face; |
353 | Pixmap m_tabcontainer_unfocused_pm; ///< pixmap for unfocused tab container | 344 | |
354 | FbTk::Color m_tabcontainer_unfocused_color; ///< color for unfocused tab container | ||
355 | |||
356 | FbTk::Color m_handle_focused_color, m_handle_unfocused_color; | ||
357 | Pixmap m_handle_focused_pm, m_handle_unfocused_pm; | ||
358 | |||
359 | |||
360 | Pixmap m_button_pm; ///< normal button | ||
361 | FbTk::Color m_button_color; ///< normal color button | ||
362 | Pixmap m_button_unfocused_pm; ///< unfocused button | ||
363 | FbTk::Color m_button_unfocused_color; ///< unfocused color button | ||
364 | Pixmap m_button_pressed_pm; ///< pressed button | ||
365 | FbTk::Color m_button_pressed_color; ///< pressed button color | ||
366 | |||
367 | Pixmap m_grip_focused_pm; | ||
368 | FbTk::Color m_grip_focused_color; ///< if no pixmap is given for grip, use this color | ||
369 | Pixmap m_grip_unfocused_pm; ///< unfocused pixmap for grip | ||
370 | FbTk::Color m_grip_unfocused_color; ///< unfocused color for grip if no pixmap is given | ||
371 | //@} | 345 | //@} |
372 | 346 | ||
373 | TabMode m_tabmode; | 347 | TabMode m_tabmode; |
@@ -376,10 +350,7 @@ private: | |||
376 | 350 | ||
377 | bool m_need_render; | 351 | bool m_need_render; |
378 | int m_button_size; ///< size for all titlebar buttons | 352 | int m_button_size; ///< size for all titlebar buttons |
379 | /// alpha values | 353 | int m_alpha[2]; // 0-unfocused, 1-focused |
380 | typedef FbTk::ConstObjectAccessor<int, FbWinFrameTheme> AlphaAcc; | ||
381 | FbTk::DefaultValue<int, AlphaAcc> m_focused_alpha; | ||
382 | FbTk::DefaultValue<int, AlphaAcc> m_unfocused_alpha; | ||
383 | 354 | ||
384 | FbTk::Shape m_shape; | 355 | FbTk::Shape m_shape; |
385 | }; | 356 | }; |