diff options
author | Nico Weber <thakis@chromium.org> | 2020-08-11 21:32:40 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-12 11:02:30 +0200 |
commit | 8eee5312c5d5a8d1bd6bb64a5d2cc4bac24f65bd (patch) | |
tree | 73a604328c4e3390225cb30f7dadde4ac0a1c094 /Libraries | |
parent | cb2d56b9096ddbde8278f4040e60bc708c05f023 (diff) | |
download | serenity-8eee5312c5d5a8d1bd6bb64a5d2cc4bac24f65bd.zip |
GUI: Rename ScrollBar::scrubber_size() to ScrollBar::visibile_scrubber_size()
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibGUI/ScrollBar.cpp | 14 | ||||
-rw-r--r-- | Libraries/LibGUI/ScrollBar.h | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/Libraries/LibGUI/ScrollBar.cpp b/Libraries/LibGUI/ScrollBar.cpp index 313fd1f588..e447aa3a83 100644 --- a/Libraries/LibGUI/ScrollBar.cpp +++ b/Libraries/LibGUI/ScrollBar.cpp @@ -179,9 +179,9 @@ Gfx::IntRect ScrollBar::increment_gutter_rect() const int ScrollBar::scrubbable_range_in_pixels() const { if (orientation() == Orientation::Vertical) - return height() - button_height() * 2 - scrubber_size(); + return height() - button_height() * 2 - visible_scrubber_size(); else - return width() - button_width() * 2 - scrubber_size(); + return width() - button_width() * 2 - visible_scrubber_size(); } bool ScrollBar::has_scrubber() const @@ -189,7 +189,7 @@ bool ScrollBar::has_scrubber() const return m_max != m_min; } -int ScrollBar::scrubber_size() const +int ScrollBar::visible_scrubber_size() const { int pixel_range = length(orientation()) - button_size() * 2; int value_range = m_max - m_min; @@ -205,13 +205,13 @@ int ScrollBar::scrubber_size() const Gfx::IntRect ScrollBar::scrubber_rect() const { - if (!has_scrubber() || length(orientation()) <= (button_size() * 2) + scrubber_size()) + if (!has_scrubber() || length(orientation()) <= (button_size() * 2) + visible_scrubber_size()) return {}; float x_or_y; if (m_value == m_min) x_or_y = button_size(); else if (m_value == m_max) - x_or_y = (length(orientation()) - button_size() - scrubber_size()) + 1; + x_or_y = (length(orientation()) - button_size() - visible_scrubber_size()) + 1; else { float range_size = m_max - m_min; float available = scrubbable_range_in_pixels(); @@ -220,9 +220,9 @@ Gfx::IntRect ScrollBar::scrubber_rect() const } if (orientation() == Orientation::Vertical) - return { 0, (int)x_or_y, button_width(), scrubber_size() }; + return { 0, (int)x_or_y, button_width(), visible_scrubber_size() }; else - return { (int)x_or_y, 0, scrubber_size(), button_height() }; + return { (int)x_or_y, 0, visible_scrubber_size(), button_height() }; } void ScrollBar::paint_event(PaintEvent& event) diff --git a/Libraries/LibGUI/ScrollBar.h b/Libraries/LibGUI/ScrollBar.h index 0604d719cb..4398667295 100644 --- a/Libraries/LibGUI/ScrollBar.h +++ b/Libraries/LibGUI/ScrollBar.h @@ -87,7 +87,7 @@ private: Gfx::IntRect decrement_gutter_rect() const; Gfx::IntRect increment_gutter_rect() const; Gfx::IntRect scrubber_rect() const; - int scrubber_size() const; + int visible_scrubber_size() const; int scrubbable_range_in_pixels() const; void on_automatic_scrolling_timer_fired(); void set_automatic_scrolling_active(bool); |