summaryrefslogtreecommitdiff
path: root/plugingui/slider.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2017-04-17 17:44:05 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2017-04-17 17:44:05 +0200
commitcce58a93617507a4f2e6927de4445e30b7b46617 (patch)
tree5b6fb81171028d46c3a147275a74226444133809 /plugingui/slider.cc
parent5186102ef5f44b72f655528a45df9f0fa5c49545 (diff)
Connected streaming controls.
Diffstat (limited to 'plugingui/slider.cc')
-rw-r--r--plugingui/slider.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugingui/slider.cc b/plugingui/slider.cc
index 7d5cdb4..2a82a54 100644
--- a/plugingui/slider.cc
+++ b/plugingui/slider.cc
@@ -34,6 +34,8 @@
namespace GUI
{
+static constexpr float _4GB = 1024.0 * 1024.0 * 1024.0 * 4.0;
+
Slider::Slider(Widget* parent) : Widget(parent)
{
state = State::up;
@@ -45,9 +47,10 @@ Slider::Slider(Widget* parent) : Widget(parent)
void Slider::setValue(float new_value)
{
- current_value = new_value;
+ current_value = new_value / (float)_4GB; // TODO: Scale to [0, 1] range
redraw();
clickNotifier();
+ valueChangedNotifier(current_value * _4GB); // TODO: Scale up to full range
}
float Slider::value() const
@@ -126,6 +129,7 @@ void Slider::mouseMoveEvent(MouseMoveEvent* mouseMoveEvent)
redraw();
clickNotifier();
+ valueChangedNotifier(current_value * _4GB); // TODO: Scale up to full range
}
}