1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

Middle click on Show image right-click context menu opens image in new tab

This commit is contained in:
Mladen Pejaković 2012-01-24 23:28:18 +01:00
parent a725a44c6b
commit b936f1b00f
5 changed files with 14 additions and 5 deletions

View File

@ -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))
{
}

View File

@ -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

View File

@ -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)

View File

@ -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;

View File

@ -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();