summaryrefslogtreecommitdiff
path: root/plugingui/diskstreamingframecontent.cc
diff options
context:
space:
mode:
authorAndré Nusser <andre.nusser@googlemail.com>2017-04-21 09:16:02 +0200
committerAndré Nusser <andre.nusser@googlemail.com>2017-04-21 09:16:02 +0200
commitaf01e8e8031bc9c0c29cc3afe17a63fded5dbeeb (patch)
tree7e7eb1485ed8a2f5beb12fa8e7b8443746df27fc /plugingui/diskstreamingframecontent.cc
parent07b5f422e7d5172992127feca05a1cf1a551dab5 (diff)
Add minimum memory value to the diskstreaming slider.
Diffstat (limited to 'plugingui/diskstreamingframecontent.cc')
-rw-r--r--plugingui/diskstreamingframecontent.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugingui/diskstreamingframecontent.cc b/plugingui/diskstreamingframecontent.cc
index e423538..87e8b8b 100644
--- a/plugingui/diskstreamingframecontent.cc
+++ b/plugingui/diskstreamingframecontent.cc
@@ -90,7 +90,7 @@ void DiskstreamingframeContent::resize(std::size_t width, std::size_t height)
void DiskstreamingframeContent::limitSettingsValueChanged(std::size_t value)
{
- float new_slider_value = (float)value/max_limit;
+ float new_slider_value = (float)(value - min_limit)/(max_limit - min_limit);
slider.setValue(new_slider_value);
if (new_slider_value < 0.99) {
@@ -109,7 +109,7 @@ void DiskstreamingframeContent::limitSettingsValueChanged(std::size_t value)
void DiskstreamingframeContent::limitValueChanged(float value)
{
std::size_t new_limit = value < 0.99 ?
- value * max_limit :
+ value * (max_limit - min_limit) + min_limit :
std::numeric_limits<std::size_t>::max();
settings.disk_cache_upper_limit.store(new_limit);