From cbb0f0f34e71630cb59ac4a831daf445f58a6427 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Mon, 17 Apr 2017 16:33:45 +0200 Subject: Connect humanizer controls to settings. --- plugingui/frame.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'plugingui/frame.cc') 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) -- cgit v1.2.3