From 4f8d58ba39a58b5a6f67d3b83cabc4add4cca0c6 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sat, 25 Apr 2020 21:09:22 +0200 Subject: WIP: UI adaptation for plugingui integration. --- plugingui/checkbox.cc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'plugingui/checkbox.cc') diff --git a/plugingui/checkbox.cc b/plugingui/checkbox.cc index 1893f59..f3601bd 100644 --- a/plugingui/checkbox.cc +++ b/plugingui/checkbox.cc @@ -32,19 +32,18 @@ namespace GUI { CheckBox::CheckBox(Widget* parent) - : Toggle(parent) - , bg_on(getImageCache(), ":resources/switch_back_on.png") - , bg_off(getImageCache(), ":resources/switch_back_off.png") - , knob(getImageCache(), ":resources/switch_front.png") + : Toggle(parent) + , bg_on(getImageCache(), ":resources/switch_back_on.png") + , bg_off(getImageCache(), ":resources/switch_back_off.png") + , knob(getImageCache(), ":resources/switch_front.png") { } void CheckBox::repaintEvent(RepaintEvent* repaintEvent) { Painter p(*this); - - p.drawImage( - 0, (knob.height() - bg_on.height()) / 2, state ? bg_on : bg_off); + p.clear(); + p.drawImage(0, (knob.height() - bg_on.height()) / 2, state ? bg_on : bg_off); if(clicked) { -- cgit v1.2.3