mirror of
https://github.com/RGBCube/serenity
synced 2025-07-02 23:32:06 +00:00
GTextEditor: Add add_custom_context_menu_action()
This allows embedders to add their own custom GAction set to a text editor's context menu.
This commit is contained in:
parent
0df7213670
commit
a6be213287
2 changed files with 15 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
|||
#include <AK/Function.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/NonnullOwnPtrVector.h>
|
||||
#include <AK/NonnullRefPtrVector.h>
|
||||
#include <LibDraw/TextAlignment.h>
|
||||
#include <LibGUI/GScrollableWidget.h>
|
||||
|
||||
|
@ -162,6 +163,8 @@ public:
|
|||
GAction& paste_action() { return *m_paste_action; }
|
||||
GAction& delete_action() { return *m_delete_action; }
|
||||
|
||||
void add_custom_context_menu_action(GAction&);
|
||||
|
||||
private:
|
||||
virtual void paint_event(GPaintEvent&) override;
|
||||
virtual void mousedown_event(GMouseEvent&) override;
|
||||
|
@ -266,6 +269,7 @@ private:
|
|||
RefPtr<GAction> m_paste_action;
|
||||
RefPtr<GAction> m_delete_action;
|
||||
CElapsedTimer m_triple_click_timer;
|
||||
NonnullRefPtrVector<GAction> m_custom_context_menu_actions;
|
||||
};
|
||||
|
||||
inline const LogStream& operator<<(const LogStream& stream, const GTextPosition& value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue