mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:28:12 +00:00
LibGUI: Make scrollbar thumb size relative to content size
In order to calculate a thumb size that is a representation of the visible portion (page) of the content, that information needs to be taken into account.
This commit is contained in:
parent
6df87b51f7
commit
fc568ea13a
3 changed files with 22 additions and 8 deletions
|
@ -43,12 +43,15 @@ public:
|
|||
int value() const { return m_value; }
|
||||
int min() const { return m_min; }
|
||||
int max() const { return m_max; }
|
||||
int page() const { return m_page; }
|
||||
int step() const { return m_step; }
|
||||
int big_step() const { return m_big_step; }
|
||||
|
||||
void set_min(int min) { set_range(min, max()); }
|
||||
void set_max(int max) { set_range(min(), max); }
|
||||
void set_range(int min, int max);
|
||||
void set_min(int min) { set_range(min, max(), page()); }
|
||||
void set_max(int max) { set_range(min(), max, page()); }
|
||||
void set_page(int page) { set_range(min(), max(), page); }
|
||||
void set_range(int min, int max) { set_range(min, max, page()); }
|
||||
void set_range(int min, int max, int page);
|
||||
void set_value(int value);
|
||||
void set_step(int step) { m_step = step; }
|
||||
void set_big_step(int big_step) { m_big_step = big_step; }
|
||||
|
@ -91,6 +94,7 @@ private:
|
|||
|
||||
int m_min { 0 };
|
||||
int m_max { 0 };
|
||||
int m_page { 0 };
|
||||
int m_value { 0 };
|
||||
int m_step { 1 };
|
||||
int m_big_step { 5 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue