summaryrefslogtreecommitdiff
path: root/plugingui/slider.h
diff options
context:
space:
mode:
Diffstat (limited to 'plugingui/slider.h')
-rw-r--r--plugingui/slider.h37
1 files changed, 23 insertions, 14 deletions
diff --git a/plugingui/slider.h b/plugingui/slider.h
index 7e4037f..9620fd0 100644
--- a/plugingui/slider.h
+++ b/plugingui/slider.h
@@ -53,6 +53,10 @@ public:
void setValue(float new_value);
float value() const;
+ enum class Colour { Green, Red, Blue };
+ // Changes the colour of the inner bar
+ void setColour(Colour colour);
+
Notifier<> clickNotifier;
protected:
@@ -73,31 +77,36 @@ private:
State state;
- TexturedBox bar{
- getImageCache(), ":slider.png", 0, 0, // atlas offset (x, y)
- 7, 1, 7, // dx1, dx2, dx3
- 7, 1, 7 // dy1, dy2, dy3
+ TexturedBox bar{getImageCache(), ":slider.png",
+ 0, 0, // atlas offset (x, y)
+ 7, 1, 7, // dx1, dx2, dx3
+ 7, 1, 7 // dy1, dy2, dy3
+ };
+ TexturedBox inner_bar_green{getImageCache(), ":slider.png",
+ 30, 0, // atlas offset (x, y)
+ 2, 1, 2, // dx1, dx2, dx3
+ 2, 1, 2 // dy1, dy2, dy3
+ };
+ TexturedBox inner_bar_red{getImageCache(), ":slider.png",
+ 30, 5, // atlas offset (x, y)
+ 2, 1, 2, // dx1, dx2, dx3
+ 2, 1, 2 // dy1, dy2, dy3
};
- // TexturedBox inner_bar_green{
- // getImageCache(), ":slider.png", 30, 0, // atlas offset (x, y)
- // 2, 1, 2, // dx1, dx2, dx3
- // 2, 1, 2 // dy1, dy2, dy3
- // };
- // TexturedBox inner_bar_red{getImageCache(), ":slider.png",
- // 30, 5, // atlas offset (x, y)
- // 2, 1, 2, // dx1, dx2, dx3
- // 2, 1, 2 // dy1, dy2, dy3
- // };
TexturedBox inner_bar_blue{getImageCache(), ":slider.png",
30, 10, // atlas offset (x, y)
2, 1, 2, // dx1, dx2, dx3
2, 1, 2 // dy1, dy2, dy3
};
+
Texture button{
getImageCache(), ":slider.png", 15, 0, // atlas offset (x, y)
15, 15 // width, height
};
+ // This points to the inner_bar_* of the current color.
+ // It should never be a nullptr!
+ TexturedBox* inner_bar{&inner_bar_blue};
+
std::size_t bar_boundary{5};
std::size_t button_offset{7};