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:
parent
a725a44c6b
commit
b936f1b00f
@ -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))
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user