summaryrefslogtreecommitdiff
path: root/plugingui/frame.cc
diff options
context:
space:
mode:
Diffstat (limited to 'plugingui/frame.cc')
-rw-r--r--plugingui/frame.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/plugingui/frame.cc b/plugingui/frame.cc
index d0e7dff..ed4a67b 100644
--- a/plugingui/frame.cc
+++ b/plugingui/frame.cc
@@ -32,7 +32,9 @@ namespace GUI
{
FrameWidget::FrameWidget(Widget* parent, bool has_switch)
- : Widget(parent), is_switched_on(!has_switch), bar_height(24)
+ : Widget(parent)
+ , is_switched_on(!has_switch)
+ , bar_height(24)
{
if(has_switch)
{
@@ -82,6 +84,8 @@ void FrameWidget::powerButtonClicked(bool clicked)
{
is_switched_on = !is_switched_on;
+ onSwitchChangeNotifier(is_switched_on);
+
if(content)
{
content->setVisible(true);
@@ -101,6 +105,13 @@ void FrameWidget::setContent(Widget* content)
content->setVisible(true);
}
+void FrameWidget::setOnSwitch(bool on)
+{
+ is_switched_on = on;
+ onSwitchChangeNotifier(is_switched_on);
+ redraw();
+}
+
void FrameWidget::sizeChanged(int width, int height)
{
if(content)