mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:37:45 +00:00
LibGUI: Add movement methods to AbstractSlider
These methods give us a simple way to move up and down the slider, without needing to repeat the 'set_value(value() + some_value)' pattern that multiple applications and libraries use.
This commit is contained in:
parent
4427386d5f
commit
8b8f404146
1 changed files with 7 additions and 0 deletions
|
@ -38,6 +38,13 @@ public:
|
|||
void set_page_step(int page_step);
|
||||
void set_jump_to_cursor(bool b) { m_jump_to_cursor = b; }
|
||||
|
||||
void increase_slider_by(int delta) { set_value(value() + delta); }
|
||||
void decrease_slider_by(int delta) { set_value(value() - delta); }
|
||||
void increase_slider_by_page_steps(int page_steps) { set_value(value() + page_step() * page_steps); }
|
||||
void decrease_slider_by_page_steps(int page_steps) { set_value(value() - page_step() * page_steps); }
|
||||
void increase_slider_by_steps(int steps) { set_value(value() + step() * steps); }
|
||||
void decrease_slider_by_steps(int steps) { set_value(value() - step() * steps); }
|
||||
|
||||
Function<void(int)> on_change;
|
||||
|
||||
protected:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue