summaryrefslogtreecommitdiff
path: root/Userland/Applications/Browser/BrowserWindow.cpp
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2021-07-14 08:55:36 -0400
committerAndreas Kling <kling@serenityos.org>2021-07-14 17:16:39 +0200
commit615a1c721019a10501dda7a680dbd5e85a7a3a90 (patch)
tree8bf412f921858ce216d1baddc62cb9e25ce8a0be /Userland/Applications/Browser/BrowserWindow.cpp
parentae910e437038481bc3c15d07ed1bf03c1e40a236 (diff)
downloadserenity-615a1c721019a10501dda7a680dbd5e85a7a3a90.zip
Browser: Add context menu item for selecting all text
Diffstat (limited to 'Userland/Applications/Browser/BrowserWindow.cpp')
-rw-r--r--Userland/Applications/Browser/BrowserWindow.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Userland/Applications/Browser/BrowserWindow.cpp b/Userland/Applications/Browser/BrowserWindow.cpp
index b45fc44a0b..5838fd4265 100644
--- a/Userland/Applications/Browser/BrowserWindow.cpp
+++ b/Userland/Applications/Browser/BrowserWindow.cpp
@@ -189,6 +189,15 @@ void BrowserWindow::build_menus()
GUI::Clipboard::the().set_plain_text(selected_text);
});
+ m_select_all_action = GUI::CommonActions::make_select_all_action([this](auto&) {
+ auto& tab = active_tab();
+
+ if (tab.m_type == Tab::Type::InProcessWebView)
+ tab.m_page_view->select_all();
+ else
+ tab.m_web_content_view->select_all();
+ });
+
m_view_source_action = GUI::Action::create(
"View &Source", { Mod_Ctrl, Key_U }, [this](auto&) {
auto& tab = active_tab();