diff --git a/src/webview/popupwebview.cpp b/src/webview/popupwebview.cpp index 196101810..9a9775018 100644 --- a/src/webview/popupwebview.cpp +++ b/src/webview/popupwebview.cpp @@ -4,11 +4,12 @@ #include "qupzilla.h" #include "tabwidget.h" #include "iconprovider.h" +#include "enhancedmenu.h" PopupWebView::PopupWebView(QWidget* parent) : WebView(parent) , m_page(0) - , m_menu(new QMenu(this)) + , m_menu(new Menu(this)) { } diff --git a/src/webview/popupwebview.h b/src/webview/popupwebview.h index d8ff4a8da..1ea61fb95 100644 --- a/src/webview/popupwebview.h +++ b/src/webview/popupwebview.h @@ -6,6 +6,7 @@ #include "webview.h" class PopupWebPage; +class Menu; class PopupWebView : public WebView { Q_OBJECT @@ -27,7 +28,7 @@ private: void contextMenuEvent(QContextMenuEvent* event); PopupWebPage* m_page; - QMenu* m_menu; + Menu* m_menu; }; #endif // POPUPWEBVIEW_H diff --git a/src/webview/tabbedwebview.cpp b/src/webview/tabbedwebview.cpp index 8b89983d7..150165f46 100644 --- a/src/webview/tabbedwebview.cpp +++ b/src/webview/tabbedwebview.cpp @@ -29,6 +29,7 @@ #include "navigationbar.h" #include "iconprovider.h" #include "searchenginesmanager.h" +#include "enhancedmenu.h" TabbedWebView::TabbedWebView(QupZilla* mainClass, WebTab* webTab) : WebView(webTab) @@ -36,7 +37,7 @@ TabbedWebView::TabbedWebView(QupZilla* mainClass, WebTab* webTab) , m_tabWidget(p_QupZilla->tabWidget()) , m_page(0) , m_webTab(webTab) - , m_menu(new QMenu(this)) + , m_menu(new Menu(this)) , m_mouseTrack(false) , m_navigationVisible(false) , m_hasRss(false) diff --git a/src/webview/tabbedwebview.h b/src/webview/tabbedwebview.h index 9ade0b8a5..77eaa6aa4 100644 --- a/src/webview/tabbedwebview.h +++ b/src/webview/tabbedwebview.h @@ -30,6 +30,7 @@ class QupZilla; class TabWidget; class WebPage; class WebTab; +class Menu; class TabbedWebView : public WebView { Q_OBJECT @@ -97,7 +98,7 @@ private: WebPage* m_page; WebTab* m_webTab; - QMenu* m_menu; + Menu* m_menu; bool m_mouseTrack; bool m_navigationVisible; diff --git a/src/webview/webview.cpp b/src/webview/webview.cpp index 9ad6f707b..4323377b0 100644 --- a/src/webview/webview.cpp +++ b/src/webview/webview.cpp @@ -31,6 +31,7 @@ #include "bookmarksmanager.h" #include "settings.h" #include "webviewsettings.h" +#include "enhancedmenu.h" WebView::WebView(QWidget* parent) : QWebView(parent) @@ -642,7 +643,11 @@ void WebView::createLinkContextMenu(QMenu* menu, const QWebHitTestResult &hitTes void WebView::createImageContextMenu(QMenu* menu, const QWebHitTestResult &hitTest) { menu->addSeparator(); - menu->addAction(tr("Show i&mage"), this, SLOT(openActionUrl()))->setData(hitTest.imageUrl()); + Action* act = new Action(tr("Show i&mage")); + act->setData(hitTest.imageUrl()); + connect(act, SIGNAL(triggered()), this, SLOT(openActionUrl())); + connect(act, SIGNAL(middleClicked()), this, SLOT(openUrlInBackgroundTab())); + menu->addAction(act); menu->addAction(tr("Copy im&age"), this, SLOT(copyImageToClipboard()))->setData(hitTest.imageUrl()); menu->addAction(QIcon::fromTheme("edit-copy"), tr("Copy image ad&dress"), this, SLOT(copyLinkToClipboard()))->setData(hitTest.imageUrl()); menu->addSeparator();