summaryrefslogtreecommitdiff
path: root/Applications
diff options
context:
space:
mode:
authorFalseHonesty <thefalsehonesty@gmail.com>2020-05-22 15:59:14 -0400
committerAndreas Kling <kling@serenityos.org>2020-05-23 01:30:20 +0200
commitd32889b19d982ac4b409aae9ed16c3ccbf86ac61 (patch)
treeba8ee8999c4e2aa9f63224838e7b4529d70c83a5 /Applications
parent6caa5661f3833e7168387c1074379cabcd1e5acf (diff)
downloadserenity-d32889b19d982ac4b409aae9ed16c3ccbf86ac61.zip
Browser: Add "Paste & Go" action to the location box
Diffstat (limited to 'Applications')
-rw-r--r--Applications/Browser/Tab.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Applications/Browser/Tab.cpp b/Applications/Browser/Tab.cpp
index e098ea19c4..9b25870706 100644
--- a/Applications/Browser/Tab.cpp
+++ b/Applications/Browser/Tab.cpp
@@ -113,8 +113,14 @@ Tab::Tab()
}
m_html_widget->load(location);
+ m_location_box->set_focus(false);
};
+ m_location_box->add_custom_context_menu_action(GUI::Action::create("Paste & Go", [this](auto&) {
+ m_location_box->set_text(GUI::Clipboard::the().data());
+ m_location_box->on_return_pressed();
+ }));
+
m_bookmark_button = toolbar.add<GUI::Button>();
m_bookmark_button->set_button_style(Gfx::ButtonStyle::CoolBar);
m_bookmark_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/star-black.png"));