mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 17:55:08 +00:00
LibGUI: Give GTextEditor a context menu.
Now GTextEditor manages its own editing actions (cut/copy/paste/etc) and will show a context menu containing them when requested. Apps that want to put a GTextEditor's actions in its menu can get to the actions via public getters. :^)
This commit is contained in:
parent
67d7fc94fc
commit
ae3ec3fc37
6 changed files with 83 additions and 45 deletions
|
@ -2,6 +2,8 @@
|
|||
|
||||
#include <LibGUI/GMenuItem.h>
|
||||
#include <AK/Function.h>
|
||||
#include <AK/Retainable.h>
|
||||
#include <AK/Retained.h>
|
||||
#include <AK/Vector.h>
|
||||
|
||||
class GAction;
|
||||
|
@ -16,7 +18,7 @@ public:
|
|||
|
||||
GAction* action_at(int);
|
||||
|
||||
void add_action(Retained<GAction>&&);
|
||||
void add_action(Retained<GAction>);
|
||||
void add_separator();
|
||||
|
||||
void popup(const Point& screen_position);
|
||||
|
@ -26,6 +28,7 @@ public:
|
|||
|
||||
private:
|
||||
friend class GMenuBar;
|
||||
|
||||
int menu_id() const { return m_menu_id; }
|
||||
int realize_menu();
|
||||
void unrealize_menu();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue