summaryrefslogtreecommitdiff
path: root/plugingui/frame.cc
diff options
context:
space:
mode:
authorAndré Nusser <andre.nusser@googlemail.com>2018-06-08 01:18:02 +0200
committerAndré Nusser <andre.nusser@googlemail.com>2018-06-08 01:19:19 +0200
commit8f3f22bb5d9d6879bb21d0132a3e0d0af4cd5380 (patch)
treeb3aab48cde087b07d0152b5b6945c3eea305a6ad /plugingui/frame.cc
parentf532587d5c3576dc04d4c6eeee20c5dcdf642244 (diff)
Disable bleed control frame if drumkit doesn't support it.
Diffstat (limited to 'plugingui/frame.cc')
-rw-r--r--plugingui/frame.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/plugingui/frame.cc b/plugingui/frame.cc
index 81cc3c2..d552ff1 100644
--- a/plugingui/frame.cc
+++ b/plugingui/frame.cc
@@ -59,7 +59,7 @@ void FrameWidget::repaintEvent(RepaintEvent* repaintEvent)
auto title_buf = title.c_str();
// draw the dark grey box
- p.setColour(grey_box_colour);
+ p.setColour(enabled ? grey_box_colour : grey_box_colour_disabled);
p.drawFilledRectangle(1, 1, width() - 2, bar_height);
// frame
@@ -76,8 +76,9 @@ void FrameWidget::repaintEvent(RepaintEvent* repaintEvent)
p.drawFilledRectangle(1, bar_height, width() - 2, height() - 2);
// draw the label
- p.setColour(label_colour);
+ p.setColour(enabled ? label_colour : label_colour_disabled);
p.drawText(center_x - label_width, bar_height - 4, font, title_buf);
+ power_button.setEnabled(enabled);
}
void FrameWidget::powerButtonStateChanged(bool new_state)
@@ -104,6 +105,14 @@ void FrameWidget::setOnSwitch(bool on)
power_button.setChecked(is_switched_on);
}
+void FrameWidget::setEnabled(bool enabled)
+{
+ this->enabled = enabled;
+ onEnabledChanged(enabled);
+
+ redraw();
+}
+
void FrameWidget::sizeChanged(int width, int height)
{
if(content)