diff options
Diffstat (limited to 'src/WinButtonTheme.hh')
-rw-r--r-- | src/WinButtonTheme.hh | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/WinButtonTheme.hh b/src/WinButtonTheme.hh index af2f011..dea88cf 100644 --- a/src/WinButtonTheme.hh +++ b/src/WinButtonTheme.hh | |||
@@ -19,25 +19,30 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: WinButtonTheme.hh,v 1.2 2003/05/06 23:52:55 fluxgen Exp $ | 22 | // $Id: WinButtonTheme.hh,v 1.3 2003/08/22 14:48:10 fluxgen Exp $ |
23 | 23 | ||
24 | #ifndef WINBUTTONTHEME_HH | 24 | #ifndef WINBUTTONTHEME_HH |
25 | #define WINBUTTONTHEME_HH | 25 | #define WINBUTTONTHEME_HH |
26 | 26 | ||
27 | #include "Theme.hh" | 27 | #include "Theme.hh" |
28 | #include "Subject.hh" | ||
29 | #include "FbPixmap.hh" | 28 | #include "FbPixmap.hh" |
30 | 29 | ||
30 | class FbWinFrameTheme; | ||
31 | |||
31 | class WinButtonTheme: public FbTk::Theme { | 32 | class WinButtonTheme: public FbTk::Theme { |
32 | public: | 33 | public: |
34 | /// holds pixmap and a mask | ||
33 | struct PixmapWithMask { | 35 | struct PixmapWithMask { |
36 | /// scale both pixmap and mask to specified size | ||
37 | void scale(unsigned int width, unsigned int height) { | ||
38 | pixmap.scale(width, height); | ||
39 | mask.scale(width, height); | ||
40 | } | ||
34 | FbTk::FbPixmap pixmap; | 41 | FbTk::FbPixmap pixmap; |
35 | FbTk::FbPixmap pixmap_scaled; | ||
36 | FbTk::FbPixmap mask; | 42 | FbTk::FbPixmap mask; |
37 | FbTk::FbPixmap mask_scaled; | ||
38 | }; | 43 | }; |
39 | 44 | ||
40 | explicit WinButtonTheme(int screen_num); | 45 | WinButtonTheme(int screen_num, const FbWinFrameTheme &frame_theme); |
41 | ~WinButtonTheme(); | 46 | ~WinButtonTheme(); |
42 | 47 | ||
43 | void reconfigTheme(); | 48 | void reconfigTheme(); |
@@ -74,9 +79,8 @@ public: | |||
74 | inline PixmapWithMask &shadeUnfocusPixmap() { return *m_shade_unfocus_pm; } | 79 | inline PixmapWithMask &shadeUnfocusPixmap() { return *m_shade_unfocus_pm; } |
75 | inline const PixmapWithMask &shadePressedPixmap() const { return *m_shade_pressed_pm; } | 80 | inline const PixmapWithMask &shadePressedPixmap() const { return *m_shade_pressed_pm; } |
76 | inline PixmapWithMask &shadePressedPixmap() { return *m_shade_pressed_pm; } | 81 | inline PixmapWithMask &shadePressedPixmap() { return *m_shade_pressed_pm; } |
77 | FbTk::Subject &reconfigSig() { return m_reconf_sig; } | 82 | |
78 | private: | 83 | private: |
79 | FbTk::Subject m_reconf_sig; | ||
80 | 84 | ||
81 | FbTk::ThemeItem<PixmapWithMask> m_close_pm, m_close_unfocus_pm, m_close_pressed_pm; | 85 | FbTk::ThemeItem<PixmapWithMask> m_close_pm, m_close_unfocus_pm, m_close_pressed_pm; |
82 | FbTk::ThemeItem<PixmapWithMask> m_maximize_pm, m_maximize_unfocus_pm, m_maximize_pressed_pm; | 86 | FbTk::ThemeItem<PixmapWithMask> m_maximize_pm, m_maximize_unfocus_pm, m_maximize_pressed_pm; |
@@ -84,6 +88,8 @@ private: | |||
84 | FbTk::ThemeItem<PixmapWithMask> m_shade_pm, m_shade_unfocus_pm, m_shade_pressed_pm; | 88 | FbTk::ThemeItem<PixmapWithMask> m_shade_pm, m_shade_unfocus_pm, m_shade_pressed_pm; |
85 | FbTk::ThemeItem<PixmapWithMask> m_stick_pm, m_stick_unfocus_pm, m_stick_pressed_pm; | 89 | FbTk::ThemeItem<PixmapWithMask> m_stick_pm, m_stick_unfocus_pm, m_stick_pressed_pm; |
86 | FbTk::ThemeItem<PixmapWithMask> m_stuck_pm, m_stuck_unfocus_pm; | 90 | FbTk::ThemeItem<PixmapWithMask> m_stuck_pm, m_stuck_unfocus_pm; |
91 | |||
92 | const FbWinFrameTheme &m_frame_theme; | ||
87 | }; | 93 | }; |
88 | 94 | ||
89 | #endif // WINBUTTONTHEME_HH | 95 | #endif // WINBUTTONTHEME_HH |