summaryrefslogtreecommitdiff
path: root/plugingui
diff options
context:
space:
mode:
authorAndré Nusser <andre.nusser@googlemail.com>2017-04-17 23:08:25 +0200
committerAndré Nusser <andre.nusser@googlemail.com>2017-04-17 23:08:25 +0200
commit222e03c83e92cb22ad1482b7ec510ee44b521023 (patch)
treec334bf9c81c4a642af3a7466423875e29a22b343 /plugingui
parent1a569cd1ef2879680fced10ea3e77e77b896e0c1 (diff)
Fix some Slider issues.
Diffstat (limited to 'plugingui')
-rw-r--r--plugingui/diskstreamingframecontent.cc5
-rw-r--r--plugingui/slider.cc4
2 files changed, 5 insertions, 4 deletions
diff --git a/plugingui/diskstreamingframecontent.cc b/plugingui/diskstreamingframecontent.cc
index 53e2c9d..af21bca 100644
--- a/plugingui/diskstreamingframecontent.cc
+++ b/plugingui/diskstreamingframecontent.cc
@@ -83,9 +83,8 @@ void DiskstreamingframeContent::resize(std::size_t width, std::size_t height)
void DiskstreamingframeContent::limitSettingsValueChanged(float value)
{
- char buf[32];
- snprintf(buf, sizeof(buf) - 1, "%.2f MB", value / (1024 * 1024));
- label_size.setText(buf);
+ int value_in_mb = value/(1024 * 1024);
+ label_size.setText(std::to_string(value_in_mb) + " MB");
slider.setValue(value);
}
diff --git a/plugingui/slider.cc b/plugingui/slider.cc
index 2a82a54..ed23fad 100644
--- a/plugingui/slider.cc
+++ b/plugingui/slider.cc
@@ -135,7 +135,7 @@ void Slider::mouseMoveEvent(MouseMoveEvent* mouseMoveEvent)
void Slider::scrollEvent(ScrollEvent* scrollEvent)
{
- current_value += scrollEvent->delta/(float)getControlWidth();
+ current_value -= scrollEvent->delta/(float)getControlWidth();
if (current_value < 0.)
{
current_value = 0.;
@@ -145,6 +145,8 @@ void Slider::scrollEvent(ScrollEvent* scrollEvent)
}
redraw();
+ clickNotifier();
+ valueChangedNotifier(current_value * _4GB); // TODO: Scale up to full range
}
std::size_t Slider::getControlWidth() const