aboutsummaryrefslogtreecommitdiff
path: root/src/IconButton.cc
diff options
context:
space:
mode:
authorrathnor <rathnor>2004-06-16 15:38:19 (GMT)
committerrathnor <rathnor>2004-06-16 15:38:19 (GMT)
commit8f88c1fecb28dc15ecfd2ee210a8e466afe5456c (patch)
tree5adbb44deec68449ee216c10ff047d4446c2a510 /src/IconButton.cc
parentdb6e78bba9fbd0e216f0ebbe5d4f55090ca62069 (diff)
downloadfluxbox_pavel-8f88c1fecb28dc15ecfd2ee210a8e466afe5456c.zip
fluxbox_pavel-8f88c1fecb28dc15ecfd2ee210a8e466afe5456c.tar.bz2
toolbar fixes, updates and optimisations
Diffstat (limited to 'src/IconButton.cc')
-rw-r--r--src/IconButton.cc17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/IconButton.cc b/src/IconButton.cc
index 6f0b0b7..748d87b 100644
--- a/src/IconButton.cc
+++ b/src/IconButton.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: IconButton.cc,v 1.20 2004/05/04 14:33:37 rathnor Exp $ 23// $Id: IconButton.cc,v 1.21 2004/06/16 15:38:19 rathnor Exp $
24 24
25#include "IconButton.hh" 25#include "IconButton.hh"
26 26
@@ -107,7 +107,7 @@ IconButton::IconButton(const FbTk::FbWindow &parent, const FbTk::Font &font,
107 m_win.hintSig().attach(this); 107 m_win.hintSig().attach(this);
108 108
109 FbTk::EventManager::instance()->add(*this, m_icon_window); 109 FbTk::EventManager::instance()->add(*this, m_icon_window);
110 110
111 update(0); 111 update(0);
112} 112}
113 113
@@ -122,21 +122,24 @@ void IconButton::exposeEvent(XExposeEvent &event) {
122 else 122 else
123 FbTk::TextButton::exposeEvent(event); 123 FbTk::TextButton::exposeEvent(event);
124} 124}
125
125void IconButton::moveResize(int x, int y, 126void IconButton::moveResize(int x, int y,
126 unsigned int width, unsigned int height) { 127 unsigned int width, unsigned int height) {
127 128
128 FbTk::TextButton::moveResize(x, y, width, height); 129 FbTk::TextButton::moveResize(x, y, width, height);
129 130
130 if (m_icon_window.width() != FbTk::Button::width() || 131 if (m_icon_window.width() != FbTk::Button::width() ||
131 m_icon_window.height() != FbTk::Button::height()) 132 m_icon_window.height() != FbTk::Button::height()) {
132 update(0); // update icon window 133 update(0); // update icon window
134 }
133} 135}
134 136
135void IconButton::resize(unsigned int width, unsigned int height) { 137void IconButton::resize(unsigned int width, unsigned int height) {
136 FbTk::TextButton::resize(width, height); 138 FbTk::TextButton::resize(width, height);
137 if (m_icon_window.width() != FbTk::Button::width() || 139 if (m_icon_window.width() != FbTk::Button::width() ||
138 m_icon_window.height() != FbTk::Button::height()) 140 m_icon_window.height() != FbTk::Button::height()) {
139 update(0); // update icon window 141 update(0); // update icon window
142 }
140} 143}
141 144
142void IconButton::clear() { 145void IconButton::clear() {
@@ -210,7 +213,11 @@ void IconButton::update(FbTk::Subject *subj) {
210 213
211#endif // SHAPE 214#endif // SHAPE
212 215
213 setupWindow(); 216 if (subj != 0) {
217 setupWindow();
218 } else {
219 m_icon_window.clear();
220 }
214} 221}
215 222
216void IconButton::setupWindow() { 223void IconButton::setupWindow() {