diff options
author | Timothy Flynn <trflynn89@pm.me> | 2023-05-15 11:49:44 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-05-16 12:48:39 +0200 |
commit | a0e31bf1de51a8b6cc28c65debb72581f740b7e6 (patch) | |
tree | 7a5985ac61a430f2f352c8c0da3c2924e120ec2c /Ladybird/BrowserWindow.h | |
parent | 1df0a141af8ddceb98d6d7ec9079805da5af2e65 (diff) | |
download | serenity-a0e31bf1de51a8b6cc28c65debb72581f740b7e6.zip |
Ladybird: Move the page context menu from the BrowserWindow to the Tab
This will allow us to show different context menus depending on what
element is clicked, much like we do for Browser on Serenity.
Diffstat (limited to 'Ladybird/BrowserWindow.h')
-rw-r--r-- | Ladybird/BrowserWindow.h | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/Ladybird/BrowserWindow.h b/Ladybird/BrowserWindow.h index 1cc0e2c63b..0724addbe1 100644 --- a/Ladybird/BrowserWindow.h +++ b/Ladybird/BrowserWindow.h @@ -47,6 +47,26 @@ public: return *m_reload_action; } + QAction& copy_selection_action() + { + return *m_copy_selection_action; + } + + QAction& select_all_action() + { + return *m_select_all_action; + } + + QAction& view_source_action() + { + return *m_view_source_action; + } + + QAction& inspect_dom_node_action() + { + return *m_inspect_dom_node_action; + } + public slots: void tab_title_changed(int index, QString const&); void tab_favicon_changed(int index, QIcon icon); @@ -64,7 +84,6 @@ public slots: void reset_zoom(); void select_all(); void copy_selected_text(); - void show_context_menu(QPoint const&); protected: bool eventFilter(QObject* obj, QEvent* event) override; @@ -83,10 +102,13 @@ private: Tab* m_current_tab { nullptr }; QMenu* m_zoom_menu { nullptr }; - OwnPtr<QMenu> m_context_menu {}; OwnPtr<QAction> m_go_back_action {}; OwnPtr<QAction> m_go_forward_action {}; OwnPtr<QAction> m_reload_action {}; + OwnPtr<QAction> m_copy_selection_action {}; + OwnPtr<QAction> m_select_all_action {}; + OwnPtr<QAction> m_view_source_action {}; + OwnPtr<QAction> m_inspect_dom_node_action {}; Browser::CookieJar& m_cookie_jar; |