summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas CHOLLET <lucas.chollet@free.fr>2023-01-17 17:15:25 -0500
committerAndreas Kling <kling@serenityos.org>2023-01-21 14:49:46 +0100
commitc15a7b79efa53cf0ca5e5c2fe628f16ddcb2ea8a (patch)
tree1e2fa9ba6c0af891dfd632f19ab3f8a4bdf53780
parent56ceb6a10618fab5ead03f1067738ca4d846f30e (diff)
downloadserenity-c15a7b79efa53cf0ca5e5c2fe628f16ddcb2ea8a.zip
LibGUI: Remove public getter `Button::is_mimic_pressed()`
This method shouldn't be used outside the class and having a getter for a bool seems a bit overkill.
-rw-r--r--Userland/Libraries/LibGUI/Button.cpp4
-rw-r--r--Userland/Libraries/LibGUI/Button.h1
2 files changed, 2 insertions, 3 deletions
diff --git a/Userland/Libraries/LibGUI/Button.cpp b/Userland/Libraries/LibGUI/Button.cpp
index 44616283a1..621ad87743 100644
--- a/Userland/Libraries/LibGUI/Button.cpp
+++ b/Userland/Libraries/LibGUI/Button.cpp
@@ -57,7 +57,7 @@ void Button::paint_event(PaintEvent& event)
Painter painter(*this);
painter.add_clip_rect(event.rect());
- bool paint_pressed = is_being_pressed() || is_mimic_pressed() || (m_menu && m_menu->is_visible());
+ bool paint_pressed = is_being_pressed() || m_mimic_pressed || (m_menu && m_menu->is_visible());
Gfx::StylePainter::paint_button(painter, rect(), palette(), m_button_style, paint_pressed, is_hovered(), is_checked(), is_enabled(), is_focused(), is_default() && !another_button_has_focus());
@@ -260,7 +260,7 @@ void Button::set_mimic_pressed(bool mimic_pressed)
void Button::timer_event(Core::TimerEvent&)
{
- if (is_mimic_pressed()) {
+ if (m_mimic_pressed) {
m_mimic_pressed = false;
update();
diff --git a/Userland/Libraries/LibGUI/Button.h b/Userland/Libraries/LibGUI/Button.h
index 900517302d..1fdadfb18f 100644
--- a/Userland/Libraries/LibGUI/Button.h
+++ b/Userland/Libraries/LibGUI/Button.h
@@ -64,7 +64,6 @@ public:
bool another_button_has_focus() const { return m_another_button_has_focus; }
void set_mimic_pressed(bool mimic_pressed);
- bool is_mimic_pressed() const { return m_mimic_pressed; };
virtual Optional<UISize> calculated_min_size() const override;