summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Nusser <andre.nusser@googlemail.com>2017-04-19 23:00:36 +0200
committerAndré Nusser <andre.nusser@googlemail.com>2017-04-19 23:00:36 +0200
commit00006863cb9b7438c1259bda9ab0772afe3f39d0 (patch)
tree11d9937cc72ec78889d97307934d21c371e7fd33
parentb6c321a0a88d6b4a78e8e75954079e89bcfe8491 (diff)
Remove two TODOs in Slider. Clamp new_value in Slider::setValue.
-rw-r--r--plugingui/diskstreamingframecontent.cc2
-rw-r--r--plugingui/slider.cc10
2 files changed, 9 insertions, 3 deletions
diff --git a/plugingui/diskstreamingframecontent.cc b/plugingui/diskstreamingframecontent.cc
index f2536f7..75666c2 100644
--- a/plugingui/diskstreamingframecontent.cc
+++ b/plugingui/diskstreamingframecontent.cc
@@ -42,7 +42,7 @@ DiskstreamingframeContent::DiskstreamingframeContent(Widget* parent,
label_text.setText("Cache limit (max memory usage):");
label_text.setAlignment(TextAlignment::center);
- button.setText("Apply"); // TODO connect
+ button.setText("Apply");
label_size.setText("0 MB");
label_size.setAlignment(TextAlignment::center);
diff --git a/plugingui/slider.cc b/plugingui/slider.cc
index b558468..41ffb01 100644
--- a/plugingui/slider.cc
+++ b/plugingui/slider.cc
@@ -45,9 +45,15 @@ Slider::Slider(Widget* parent) : Widget(parent)
void Slider::setValue(float new_value)
{
- // TODO make sure that we get values in range [0, 1]
-
current_value = new_value;
+ if (current_value < 0.)
+ {
+ current_value = 0.;
+ }
+ else if (current_value > 1.0) {
+ current_value = 1.0;
+ }
+
redraw();
clickNotifier();
valueChangedNotifier(current_value);