diff options
Diffstat (limited to 'src/FbTk')
-rw-r--r-- | src/FbTk/FbWindow.hh | 10 | ||||
-rw-r--r-- | src/FbTk/MenuSeparator.cc | 17 | ||||
-rw-r--r-- | src/FbTk/MenuSeparator.hh | 2 | ||||
-rw-r--r-- | src/FbTk/TextButton.cc | 2 |
4 files changed, 17 insertions, 14 deletions
diff --git a/src/FbTk/FbWindow.hh b/src/FbTk/FbWindow.hh index f02c63e..b08df5e 100644 --- a/src/FbTk/FbWindow.hh +++ b/src/FbTk/FbWindow.hh | |||
@@ -116,7 +116,7 @@ public: | |||
116 | XResizeWindow(s_display, m_window, width, height); | 116 | XResizeWindow(s_display, m_window, width, height); |
117 | m_width = width; | 117 | m_width = width; |
118 | m_height = height; | 118 | m_height = height; |
119 | updateBackground(true); | 119 | updateBackground(false); |
120 | } | 120 | } |
121 | 121 | ||
122 | virtual inline void moveResize(int x, int y, unsigned int width, unsigned int height) { | 122 | virtual inline void moveResize(int x, int y, unsigned int width, unsigned int height) { |
@@ -127,7 +127,7 @@ public: | |||
127 | m_y = y; | 127 | m_y = y; |
128 | m_width = width; | 128 | m_width = width; |
129 | m_height = height; | 129 | m_height = height; |
130 | updateBackground(true); | 130 | updateBackground(false); |
131 | 131 | ||
132 | } | 132 | } |
133 | virtual void lower(); | 133 | virtual void lower(); |
@@ -185,9 +185,11 @@ public: | |||
185 | void setOpaque(unsigned char alpha); | 185 | void setOpaque(unsigned char alpha); |
186 | 186 | ||
187 | void setRenderer(FbWindowRenderer &renderer) { m_renderer = &renderer; } | 187 | void setRenderer(FbWindowRenderer &renderer) { m_renderer = &renderer; } |
188 | |||
189 | void sendConfigureNotify(int x, int y, unsigned int width, unsigned int height); | 188 | void sendConfigureNotify(int x, int y, unsigned int width, unsigned int height); |
190 | 189 | ||
190 | /// forces full background change, recalcing of alpha values if necessary | ||
191 | void updateBackground(bool only_if_alpha); | ||
192 | |||
191 | protected: | 193 | protected: |
192 | /// creates a window with x window client (m_window = client) | 194 | /// creates a window with x window client (m_window = client) |
193 | explicit FbWindow(Window client); | 195 | explicit FbWindow(Window client); |
@@ -204,8 +206,6 @@ private: | |||
204 | bool save_unders, | 206 | bool save_unders, |
205 | int depth, | 207 | int depth, |
206 | int class_type); | 208 | int class_type); |
207 | /// forces full background change, recalcing of alpha values if necessary | ||
208 | void updateBackground(bool only_if_alpha); | ||
209 | 209 | ||
210 | const FbWindow *m_parent; ///< parent FbWindow | 210 | const FbWindow *m_parent; ///< parent FbWindow |
211 | int m_screen_num; ///< screen num on which this window exist | 211 | int m_screen_num; ///< screen num on which this window exist |
diff --git a/src/FbTk/MenuSeparator.cc b/src/FbTk/MenuSeparator.cc index a82ccdb..01aa24a 100644 --- a/src/FbTk/MenuSeparator.cc +++ b/src/FbTk/MenuSeparator.cc | |||
@@ -32,16 +32,19 @@ namespace FbTk { | |||
32 | 32 | ||
33 | void MenuSeparator::draw(FbDrawable &drawable, | 33 | void MenuSeparator::draw(FbDrawable &drawable, |
34 | const MenuTheme &theme, | 34 | const MenuTheme &theme, |
35 | bool highlight, | 35 | bool highlight, bool draw_foreground, bool draw_background, |
36 | int x, int y, | 36 | int x, int y, |
37 | unsigned int width, unsigned int height) const { | 37 | unsigned int width, unsigned int height) const { |
38 | const GContext &tgc = | ||
39 | (highlight ? theme.hiliteTextGC() : | ||
40 | (isEnabled() ? theme.frameTextGC() : theme.disableTextGC() ) ); | ||
41 | 38 | ||
42 | drawable.drawRectangle(tgc.gc(), | 39 | if (draw_background) { |
43 | x + theme.bevelWidth() + height + 1, y + height / 2, | 40 | const GContext &tgc = |
44 | width - ((theme.bevelWidth() + height) * 2) - 1, 0); | 41 | (highlight ? theme.hiliteTextGC() : |
42 | (isEnabled() ? theme.frameTextGC() : theme.disableTextGC() ) ); | ||
43 | |||
44 | drawable.drawRectangle(tgc.gc(), | ||
45 | x + theme.bevelWidth() + height + 1, y + height / 2, | ||
46 | width - ((theme.bevelWidth() + height) * 2) - 1, 0); | ||
47 | } | ||
45 | } | 48 | } |
46 | 49 | ||
47 | } | 50 | } |
diff --git a/src/FbTk/MenuSeparator.hh b/src/FbTk/MenuSeparator.hh index 1cab4fc..3162193 100644 --- a/src/FbTk/MenuSeparator.hh +++ b/src/FbTk/MenuSeparator.hh | |||
@@ -33,7 +33,7 @@ class MenuSeparator: public MenuItem { | |||
33 | public: | 33 | public: |
34 | virtual void draw(FbDrawable &drawable, | 34 | virtual void draw(FbDrawable &drawable, |
35 | const MenuTheme &theme, | 35 | const MenuTheme &theme, |
36 | bool highlight, | 36 | bool highlight, bool draw_foreground, bool draw_background, |
37 | int x, int y, | 37 | int x, int y, |
38 | unsigned int width, unsigned int height) const; | 38 | unsigned int width, unsigned int height) const; |
39 | 39 | ||
diff --git a/src/FbTk/TextButton.cc b/src/FbTk/TextButton.cc index 9a16c2c..e95b1c9 100644 --- a/src/FbTk/TextButton.cc +++ b/src/FbTk/TextButton.cc | |||
@@ -63,7 +63,7 @@ void TextButton::setJustify(FbTk::Justify just) { | |||
63 | void TextButton::setText(const std::string &text) { | 63 | void TextButton::setText(const std::string &text) { |
64 | if (m_text != text) { | 64 | if (m_text != text) { |
65 | m_text = text; | 65 | m_text = text; |
66 | parentMoved(); | 66 | updateBackground(false); |
67 | clear(); | 67 | clear(); |
68 | } | 68 | } |
69 | } | 69 | } |