summaryrefslogtreecommitdiff
path: root/plugingui/button.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2017-02-12 11:07:22 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2017-02-12 11:07:22 +0100
commitcec1d9ea562e3d52c98f1219db5e186943f2f0d6 (patch)
tree3a66ff06ef16cce96e215644032e6c9fac2cbe8a /plugingui/button.cc
parentdc33f15a6b968139779c2b7d2003d3ef6e7d5748 (diff)
Refactor/introduce widget and windiow redraw/dirty mechanism to eradicate unnecessary rendering passes during event handling.
Diffstat (limited to 'plugingui/button.cc')
-rw-r--r--plugingui/button.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugingui/button.cc b/plugingui/button.cc
index 29d3deb..fb25390 100644
--- a/plugingui/button.cc
+++ b/plugingui/button.cc
@@ -57,14 +57,14 @@ void Button::buttonEvent(ButtonEvent* buttonEvent)
draw_state = down;
button_state = down;
in_button = true;
- repaintEvent(nullptr);
+ redraw();
}
if(buttonEvent->direction == Direction::up)
{
draw_state = up;
button_state = up;
- repaintEvent(nullptr);
+ redraw();
if(in_button)
{
clicked();
@@ -110,7 +110,7 @@ void Button::repaintEvent(RepaintEvent* repaintEvent)
void Button::setText(const std::string& text)
{
this->text = text;
- repaintEvent(nullptr);
+ redraw();
}
void Button::mouseLeaveEvent()
@@ -119,7 +119,7 @@ void Button::mouseLeaveEvent()
if(button_state == down)
{
draw_state = up;
- repaintEvent(nullptr);
+ redraw();
}
}
@@ -129,7 +129,7 @@ void Button::mouseEnterEvent()
if(button_state == down)
{
draw_state = down;
- repaintEvent(nullptr);
+ redraw();
}
}