summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI/Button.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-05-12 20:30:33 +0200
committerAndreas Kling <kling@serenityos.org>2020-05-12 20:31:16 +0200
commit977863ea078e829df10d351a2e9ac3097fb8f5d9 (patch)
tree5ea075feaa74d0ff74381399c85cae1bfbaaa6b0 /Libraries/LibGUI/Button.cpp
parent3a905aed063e84331aec82826926cdb89d777892 (diff)
downloadserenity-977863ea078e829df10d351a2e9ac3097fb8f5d9.zip
LibGUI: Include keyboard modifier state with button on_click calls
This will allow you us to implement special behavior when Ctrl+clicking a button.
Diffstat (limited to 'Libraries/LibGUI/Button.cpp')
-rw-r--r--Libraries/LibGUI/Button.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Libraries/LibGUI/Button.cpp b/Libraries/LibGUI/Button.cpp
index ace26362ec..f662c82de4 100644
--- a/Libraries/LibGUI/Button.cpp
+++ b/Libraries/LibGUI/Button.cpp
@@ -86,7 +86,7 @@ void Button::paint_event(PaintEvent& event)
paint_text(painter, text_rect, font, text_alignment());
}
-void Button::click()
+void Button::click(unsigned modifiers)
{
if (!is_enabled())
return;
@@ -96,7 +96,7 @@ void Button::click()
set_checked(!is_checked());
}
if (on_click)
- on_click();
+ on_click(modifiers);
if (m_action)
m_action->activate(this);
}