summaryrefslogtreecommitdiff
path: root/plugingui/button.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2013-04-18 22:22:52 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2013-04-18 22:22:52 +0200
commit615c1f1544cabbe7ed4b33a1bde10b1b2ab71d2e (patch)
tree659d8efb4711deaa3f7d1c32f55280d4ceb17482 /plugingui/button.h
parent6a5f7728f45926f0443a1577c3769020ca02f8aa (diff)
Make 'mouse button down, move mouse in/out of button' work correctly.
Diffstat (limited to 'plugingui/button.h')
-rw-r--r--plugingui/button.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugingui/button.h b/plugingui/button.h
index 89cabf5..682dfa2 100644
--- a/plugingui/button.h
+++ b/plugingui/button.h
@@ -39,6 +39,7 @@ public:
Button(Widget *parent);
bool isFocusable() { return true; }
+ bool catchMouse() { return true; }
void setText(std::string text);
@@ -52,8 +53,11 @@ public:
virtual void mouseLeaveEvent();
virtual void mouseEnterEvent();
+ virtual void mouseMoveEvent(MouseMoveEvent *e);
private:
+ bool in_button;
+
Painter::Box box_up;
Painter::Box box_down;
@@ -63,7 +67,9 @@ private:
} state_t;
std::string text;
- state_t state;
+
+ state_t draw_state;
+ state_t button_state;
void (*handler)(void *);
void *ptr;