mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:08:12 +00:00
LibGUI: Add page_step setting to AbstractSlider and use it in Slider
This makes clicking on the track of a GUI::Slider actually move the knob more than 1 value unit (assuming page_step > 1)
This commit is contained in:
parent
fa836a4dda
commit
3b445bc66a
3 changed files with 12 additions and 2 deletions
|
@ -43,6 +43,7 @@ public:
|
|||
int min() const { return m_min; }
|
||||
int max() const { return m_max; }
|
||||
int step() const { return m_step; }
|
||||
int page_step() const { return m_page_step; }
|
||||
|
||||
void set_range(int min, int max);
|
||||
void set_value(int);
|
||||
|
@ -50,6 +51,7 @@ public:
|
|||
void set_min(int min) { set_range(min, max()); }
|
||||
void set_max(int max) { set_range(min(), max); }
|
||||
void set_step(int step) { m_step = step; }
|
||||
void set_page_step(int page_step);
|
||||
|
||||
Function<void(int)> on_value_changed;
|
||||
|
||||
|
@ -63,6 +65,7 @@ private:
|
|||
int m_min { 0 };
|
||||
int m_max { 100 };
|
||||
int m_step { 1 };
|
||||
int m_page_step { 10 };
|
||||
Orientation m_orientation { Orientation::Horizontal };
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue