From 7c50c15ede76869489a94503fa22028180f41cff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Thu, 7 Jun 2018 23:30:40 +0200 Subject: Add disabled visualization to powerbutton. --- plugingui/powerbutton.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'plugingui/powerbutton.h') diff --git a/plugingui/powerbutton.h b/plugingui/powerbutton.h index 53f8d88..14dbeca 100644 --- a/plugingui/powerbutton.h +++ b/plugingui/powerbutton.h @@ -38,15 +38,21 @@ public: PowerButton(Widget* parent); virtual ~PowerButton() = default; + void setEnabled(bool enabled); + protected: // From Widget: virtual void repaintEvent(RepaintEvent* repaintEvent) override; + bool enabled = true; + private: Texture on{getImageCache(), ":resources/bypass_button.png", 32, 0, 16, 16}; Texture on_clicked{getImageCache(), ":resources/bypass_button.png", 48, 0, 16, 16}; Texture off{getImageCache(), ":resources/bypass_button.png", 0, 0, 16, 16}; Texture off_clicked{getImageCache(), ":resources/bypass_button.png", 16, 0, 16, 16}; + Texture disabled{getImageCache(), ":resources/bypass_button.png", 64, 0, 16, 16}; + Texture disabled_clicked{getImageCache(), ":resources/bypass_button.png", 80, 0, 16, 16}; }; } // GUI:: -- cgit v1.2.3