From 1fad3b82b55991122434b7a69dd0a80928a732e2 Mon Sep 17 00:00:00 2001 From: Soren Stoutner Date: Mon, 20 Mar 2023 14:21:00 -0700 Subject: [PATCH] Move the new tab actions to the top of the action menu. https://redmine.stoutner.com/issues/978 --- doc/index.docbook | 4 ++++ src/widgets/PrivacyWebEngineView.cpp | 14 +++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/doc/index.docbook b/doc/index.docbook index 7ccb177..c519d0e 100644 --- a/doc/index.docbook +++ b/doc/index.docbook @@ -59,6 +59,10 @@ &privacybrowser; is a web browser that respects your privacy. + + + The only way to prevent data from being abused is to prevent it from being collected in the first place. + diff --git a/src/widgets/PrivacyWebEngineView.cpp b/src/widgets/PrivacyWebEngineView.cpp index bc207cb..20ae259 100644 --- a/src/widgets/PrivacyWebEngineView.cpp +++ b/src/widgets/PrivacyWebEngineView.cpp @@ -229,7 +229,19 @@ void PrivacyWebEngineView::contextMenuEvent(QContextMenuEvent *contextMenuEvent) // Add the open link in new background tab action if the context menu already contains the open link in new window action. if (contextMenuActionsList.contains(webEnginePagePointer->action(QWebEnginePage::OpenLinkInNewWindow))) - contextMenu->insertAction(webEnginePagePointer->action(QWebEnginePage::OpenLinkInNewWindow), webEnginePagePointer->action(QWebEnginePage::OpenLinkInNewBackgroundTab)); + { + // Move the open in new tab action to the top of the list. + contextMenu->insertAction(webEnginePagePointer->action(QWebEnginePage::Back), webEnginePagePointer->action(QWebEnginePage::OpenLinkInNewTab)); + + // Add the open link in background tab action below the open in new tab action. + contextMenu->insertAction(webEnginePagePointer->action(QWebEnginePage::Back), webEnginePagePointer->action(QWebEnginePage::OpenLinkInNewBackgroundTab)); + + // Move the open in new window action below the open in background tab action. + contextMenu->insertAction(webEnginePagePointer->action(QWebEnginePage::Back), webEnginePagePointer->action(QWebEnginePage::OpenLinkInNewWindow)); + + // Add a separator below the open in new window action. + contextMenu->insertSeparator(webEnginePagePointer->action(QWebEnginePage::Back)); + } // Display the menu using the location in the context menu event. contextMenu->popup(contextMenuEvent->globalPos()); -- 2.43.0