mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 19:29:16 +00:00
LibGUI: Add hook when a context menu is requested on a button
This commit is contained in:
committed by
Andreas Kling
parent
040c75a3cc
commit
28f74df2e6
@@ -101,6 +101,14 @@ void Button::click(unsigned modifiers)
|
||||
m_action->activate(this);
|
||||
}
|
||||
|
||||
void Button::context_menu_event(ContextMenuEvent& context_menu_event)
|
||||
{
|
||||
if (!is_enabled())
|
||||
return;
|
||||
if (on_context_menu_request)
|
||||
on_context_menu_request(context_menu_event);
|
||||
}
|
||||
|
||||
void Button::set_action(Action& action)
|
||||
{
|
||||
m_action = action.make_weak_ptr();
|
||||
|
||||
Reference in New Issue
Block a user