diff options
author | André Nusser <andre.nusser@googlemail.com> | 2017-04-21 08:55:00 +0200 |
---|---|---|
committer | André Nusser <andre.nusser@googlemail.com> | 2017-04-21 08:55:00 +0200 |
commit | 07b5f422e7d5172992127feca05a1cf1a551dab5 (patch) | |
tree | 8c247c3c3b77b806e5d22c0ad4bba9ff7bf5b037 /plugingui | |
parent | 46e70f2177976c3a9fe31b4a9ff28d47b018ca3b (diff) |
Change the slider color to grey when "unlimited".
Included a new slider texture for that.
Diffstat (limited to 'plugingui')
-rw-r--r-- | plugingui/diskstreamingframecontent.cc | 2 | ||||
-rw-r--r-- | plugingui/resources/slider.png | bin | 1079 -> 1234 bytes | |||
-rw-r--r-- | plugingui/slider.cc | 9 | ||||
-rw-r--r-- | plugingui/slider.h | 25 |
4 files changed, 30 insertions, 6 deletions
diff --git a/plugingui/diskstreamingframecontent.cc b/plugingui/diskstreamingframecontent.cc index 468cc7c..e423538 100644 --- a/plugingui/diskstreamingframecontent.cc +++ b/plugingui/diskstreamingframecontent.cc @@ -100,7 +100,7 @@ void DiskstreamingframeContent::limitSettingsValueChanged(std::size_t value) } else { label_size.setText("Unlimited"); - slider.setColour(Slider::Colour::Green); + slider.setColour(Slider::Colour::Grey); } button.setEnabled(true); diff --git a/plugingui/resources/slider.png b/plugingui/resources/slider.png Binary files differindex 7a87d34..3766e83 100644 --- a/plugingui/resources/slider.png +++ b/plugingui/resources/slider.png diff --git a/plugingui/slider.cc b/plugingui/slider.cc index 41ffb01..bd28f81 100644 --- a/plugingui/slider.cc +++ b/plugingui/slider.cc @@ -76,6 +76,15 @@ void Slider::setColour(Colour colour) case Colour::Blue: inner_bar = &inner_bar_blue; break; + case Colour::Yellow: + inner_bar = &inner_bar_yellow; + break; + case Colour::Purple: + inner_bar = &inner_bar_purple; + break; + case Colour::Grey: + inner_bar = &inner_bar_grey; + break; } } diff --git a/plugingui/slider.h b/plugingui/slider.h index 1543d6f..4480508 100644 --- a/plugingui/slider.h +++ b/plugingui/slider.h @@ -53,7 +53,7 @@ public: void setValue(float new_value); float value() const; - enum class Colour { Green, Red, Blue }; + enum class Colour { Green, Red, Blue, Yellow, Purple, Grey }; // Changes the colour of the inner bar void setColour(Colour colour); @@ -84,6 +84,11 @@ private: 7, 1, 7, // dx1, dx2, dx3 7, 1, 7 // dy1, dy2, dy3 }; + Texture button{ + getImageCache(), ":resources/slider.png", 15, 0, // atlas offset (x, y) + 15, 15 // width, height + }; + TexturedBox inner_bar_green{getImageCache(), ":resources/slider.png", 30, 0, // atlas offset (x, y) 2, 1, 2, // dx1, dx2, dx3 @@ -99,10 +104,20 @@ private: 2, 1, 2, // dx1, dx2, dx3 2, 1, 2 // dy1, dy2, dy3 }; - - Texture button{ - getImageCache(), ":resources/slider.png", 15, 0, // atlas offset (x, y) - 15, 15 // width, height + TexturedBox inner_bar_yellow{getImageCache(), ":resources/slider.png", + 35, 0, // atlas offset (x, y) + 2, 1, 2, // dx1, dx2, dx3 + 2, 1, 2 // dy1, dy2, dy3 + }; + TexturedBox inner_bar_purple{getImageCache(), ":resources/slider.png", + 35, 5, // atlas offset (x, y) + 2, 1, 2, // dx1, dx2, dx3 + 2, 1, 2 // dy1, dy2, dy3 + }; + TexturedBox inner_bar_grey{getImageCache(), ":resources/slider.png", + 35, 10, // atlas offset (x, y) + 2, 1, 2, // dx1, dx2, dx3 + 2, 1, 2 // dy1, dy2, dy3 }; // This points to the inner_bar_* of the current color. |