aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/webengine/webview.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/webengine/webview.cpp b/src/webengine/webview.cpp
index 9f7385e..8e137de 100644
--- a/src/webengine/webview.cpp
+++ b/src/webengine/webview.cpp
@@ -162,9 +162,14 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
page()->triggerAction(QWebEnginePage::CopyImageUrlToClipboard);
});
if(!ctxdata.mediaUrl().isEmpty()) {
- connect(menu->addAction(tr("Open image in new tab")), &QAction::triggered, this, [this, ctxdata]() {
- createWindow(QWebEnginePage::WebBrowserTab)->load(ctxdata.mediaUrl());
- });
+ if(this->url() != ctxdata.mediaUrl()) {
+ connect(menu->addAction(tr("Open image")), &QAction::triggered, this, [this, ctxdata]() {
+ load(ctxdata.mediaUrl());
+ });
+ connect(menu->addAction(tr("Open image in new tab")), &QAction::triggered, this, [this, ctxdata]() {
+ createWindow(QWebEnginePage::WebBrowserTab)->load(ctxdata.mediaUrl());
+ });
+ }
connect(menu->addAction(tr("Save image")), &QAction::triggered, this, [this, ctxdata]() {
page()->download(ctxdata.mediaUrl());
});