From cec1d9ea562e3d52c98f1219db5e186943f2f0d6 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sun, 12 Feb 2017 11:07:22 +0100 Subject: Refactor/introduce widget and windiow redraw/dirty mechanism to eradicate unnecessary rendering passes during event handling. --- plugingui/button.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'plugingui/button.cc') 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(); } } -- cgit v1.2.3