From 222e03c83e92cb22ad1482b7ec510ee44b521023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Mon, 17 Apr 2017 23:08:25 +0200 Subject: Fix some Slider issues. --- plugingui/diskstreamingframecontent.cc | 5 ++--- plugingui/slider.cc | 4 +++- 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 -- cgit v1.2.3