From be675587812c27fac9838af844f8ecb44703ff08 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sat, 30 Mar 2013 22:02:20 +0100 Subject: Implemented new mouseLeave/Enter Events. Use for buttons. --- plugingui/button.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'plugingui/button.cc') diff --git a/plugingui/button.cc b/plugingui/button.cc index 05d16a2..2370f29 100644 --- a/plugingui/button.cc +++ b/plugingui/button.cc @@ -29,6 +29,7 @@ #include "painter.h" #include +#include GUI::Button::Button(Widget *parent) : GUI::Widget(parent) @@ -110,6 +111,21 @@ void GUI::Button::setText(std::string text) repaintEvent(NULL); } +void GUI::Button::mouseLeaveEvent() +{ + DEBUG(button, "Leave\n"); + if(state == down) { + state = up; + repaintEvent(NULL); + } +} + +void GUI::Button::mouseEnterEvent() +{ + DEBUG(button, "Enter\n"); +} + + #ifdef TEST_BUTTON //Additional dependency files //deps: -- cgit v1.2.3