UI/Qt: Simplify link context menu and update keyboard shortcuts
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run

Removes the unnecessary separator, redundant open action, and changes
shortcuts to match other browsers.
This commit is contained in:
rmg-x 2024-09-23 17:20:51 -05:00 committed by Sam Atkins
parent 797e1d3ee6
commit 1f365ba44a
Notes: github-actions[bot] 2024-10-04 06:41:13 +00:00

View file

@ -523,19 +523,13 @@ Tab::Tab(BrowserWindow* window, RefPtr<WebView::WebContentClient> parent_client,
m_page_context_menu->exec(view().map_point_to_global_position(content_position));
};
auto* open_link_action = new QAction("&Open", this);
open_link_action->setIcon(load_icon_from_uri("resource://icons/16x16/go-forward.png"sv));
QObject::connect(open_link_action, &QAction::triggered, this, [this]() {
open_link(m_link_context_menu_url);
});
auto* open_link_in_new_tab_action = new QAction("&Open in New &Tab", this);
auto* open_link_in_new_tab_action = new QAction("Open Link in New &Tab", this);
open_link_in_new_tab_action->setIcon(load_icon_from_uri("resource://icons/16x16/new-tab.png"sv));
QObject::connect(open_link_in_new_tab_action, &QAction::triggered, this, [this]() {
open_link_in_new_tab(m_link_context_menu_url);
});
m_link_context_menu_copy_url_action = new QAction("Copy &URL", this);
m_link_context_menu_copy_url_action = new QAction("Copy &Link Address", this);
m_link_context_menu_copy_url_action->setIcon(load_icon_from_uri("resource://icons/16x16/edit-copy.png"sv));
QObject::connect(m_link_context_menu_copy_url_action, &QAction::triggered, this, [this]() {
copy_link_url(m_link_context_menu_url);
@ -543,8 +537,6 @@ Tab::Tab(BrowserWindow* window, RefPtr<WebView::WebContentClient> parent_client,
m_link_context_menu = new QMenu("Link context menu", this);
m_link_context_menu->addAction(open_link_in_new_tab_action);
m_link_context_menu->addAction(open_link_action);
m_link_context_menu->addSeparator();
m_link_context_menu->addAction(m_link_context_menu_copy_url_action);
m_link_context_menu->addSeparator();
m_link_context_menu->addAction(&m_window->inspect_dom_node_action());
@ -560,7 +552,7 @@ Tab::Tab(BrowserWindow* window, RefPtr<WebView::WebContentClient> parent_client,
m_link_context_menu_copy_url_action->setText("Copy &Phone Number");
break;
case WebView::URLType::Other:
m_link_context_menu_copy_url_action->setText("Copy &URL");
m_link_context_menu_copy_url_action->setText("Copy &Link Address");
break;
}