summaryrefslogtreecommitdiff
path: root/plugingui/frame.cc
diff options
context:
space:
mode:
authorAndré Nusser <andre.nusser@googlemail.com>2017-04-01 19:01:25 +0200
committerAndré Nusser <andre.nusser@googlemail.com>2017-04-01 19:01:25 +0200
commit1f41de14a04240dfd993b030306ac251d962a843 (patch)
tree08d5ef8b74793909a15cb8f3c0b7732819a41f8a /plugingui/frame.cc
parent4739f0bed6e6332fcf2c6ed2b04c4ae161c41060 (diff)
Fix a lot of style issues in the code for the new GUI.
Diffstat (limited to 'plugingui/frame.cc')
-rw-r--r--plugingui/frame.cc24
1 files changed, 13 insertions, 11 deletions
diff --git a/plugingui/frame.cc b/plugingui/frame.cc
index df468dd..ea2bfe3 100644
--- a/plugingui/frame.cc
+++ b/plugingui/frame.cc
@@ -31,24 +31,24 @@
namespace GUI
{
-FrameWidget::FrameWidget(Widget *parent, bool has_switch)
- : Widget(parent)
- , is_switched_on(!has_switch)
- , bar_height(24)
+FrameWidget::FrameWidget(Widget* parent, bool has_switch)
+ : Widget(parent), is_switched_on(!has_switch), bar_height(24)
{
- if (has_switch) {
+ if(has_switch)
+ {
// We only have to set this once as nothing happens on a resize
power_button.move(4, 4);
power_button.resize(16, 16);
- CONNECT(&power_button, stateChangedNotifier, this, &FrameWidget::powerButtonClicked);
+ CONNECT(&power_button, stateChangedNotifier, this,
+ &FrameWidget::powerButtonClicked);
}
power_button.setVisible(has_switch);
CONNECT(this, sizeChangeNotifier, this, &FrameWidget::sizeChanged);
}
-void FrameWidget::repaintEvent(RepaintEvent* repaintEvent)
+void FrameWidget::repaintEvent(RepaintEvent* repaintEvent)
{
Painter p(*this);
p.clear();
@@ -77,7 +77,8 @@ void FrameWidget::powerButtonClicked(bool clicked)
{
is_switched_on = !is_switched_on;
- if (content) {
+ if(content)
+ {
content->setVisible(true);
}
}
@@ -97,11 +98,12 @@ void FrameWidget::setContent(Widget* content)
void FrameWidget::sizeChanged(int width, int height)
{
- if (content) {
+ if(content)
+ {
content_start_x = content_margin;
content_start_y = bar_height + content_margin;
- content_width = width - 2*content_margin;
- content_height = height - (bar_height + 2*content_margin);
+ content_width = width - 2 * content_margin;
+ content_height = height - (bar_height + 2 * content_margin);
content->move(content_start_x, content_start_y);
content->resize(content_width, content_height);