mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
LibGUI: Add track_margin() to Sliders
Less magic numbers! :^)
This commit is contained in:
parent
1cbab1c7e6
commit
dabbe4ee27
Notes:
sideshowbarker
2024-07-19 17:16:08 +09:00
Author: https://github.com/krkk Commit: https://github.com/SerenityOS/serenity/commit/dabbe4ee27a Pull-request: https://github.com/SerenityOS/serenity/pull/9759
1 changed files with 3 additions and 2 deletions
|
@ -25,6 +25,7 @@ public:
|
|||
KnobSizeMode knob_size_mode() const { return m_knob_size_mode; }
|
||||
|
||||
int track_size() const { return 2; }
|
||||
int track_margin() const { return 10; }
|
||||
int knob_fixed_primary_size() const { return 8; }
|
||||
int knob_secondary_size() const { return 20; }
|
||||
|
||||
|
@ -34,8 +35,8 @@ public:
|
|||
Gfx::IntRect inner_rect() const
|
||||
{
|
||||
if (orientation() == Orientation::Horizontal)
|
||||
return rect().shrunken(20, 0);
|
||||
return rect().shrunken(0, 20);
|
||||
return rect().shrunken(track_margin() * 2, 0);
|
||||
return rect().shrunken(0, track_margin() * 2);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
|
Loading…
Reference in a new issue