mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:07:34 +00:00
WindowServer+LibGUI: Notify GUI clients about menu item enter/leave
We now send out MenuItemEntered and MenuItemLeft messages to the client when the user hovers/unhovers menu items. On the client side, these become GUI::ActionEvent, with one of two types: ActionEnter or ActionLeave. They are sent to the Application. This will allow GUI applications to react to these events.
This commit is contained in:
parent
f8c2beec7c
commit
ba7e1ca2fb
7 changed files with 91 additions and 19 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -26,6 +26,7 @@
|
|||
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <LibCore/MimeData.h>
|
||||
#include <LibGUI/Action.h>
|
||||
#include <LibGUI/Event.h>
|
||||
|
||||
namespace GUI {
|
||||
|
@ -69,4 +70,14 @@ String KeyEvent::to_string() const
|
|||
return builder.to_string();
|
||||
}
|
||||
|
||||
ActionEvent::ActionEvent(Type type, Action& action)
|
||||
: Event(type)
|
||||
, m_action(action)
|
||||
{
|
||||
}
|
||||
|
||||
ActionEvent::~ActionEvent()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue