diff --git a/src/lib/popupwindow/popupwebview.cpp b/src/lib/popupwindow/popupwebview.cpp index 260ac55a9..af7d97389 100644 --- a/src/lib/popupwindow/popupwebview.cpp +++ b/src/lib/popupwindow/popupwebview.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 David Rosca +* Copyright (C) 2010-2013 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -80,6 +80,11 @@ void PopupWebView::closeView() parentWidget()->close(); } +void PopupWebView::inspectElement() +{ + triggerPageAction(QWebPage::InspectElement); +} + void PopupWebView::contextMenuEvent(QContextMenuEvent* event) { m_menu->clear(); @@ -88,8 +93,11 @@ void PopupWebView::contextMenuEvent(QContextMenuEvent* event) createContextMenu(m_menu, hitTest, event->pos()); + m_menu->addSeparator(); + m_menu->addAction(tr("Inspect Element"), this, SLOT(inspectElement())); + if (!m_menu->isEmpty()) { - //Prevent choosing first option with double rightclick + // Prevent choosing first option with double rightclick const QPoint &pos = event->globalPos(); QPoint p(pos.x(), pos.y() + 1); m_menu->popup(p); diff --git a/src/lib/popupwindow/popupwebview.h b/src/lib/popupwindow/popupwebview.h index c6483a71d..cf62a5b81 100644 --- a/src/lib/popupwindow/popupwebview.h +++ b/src/lib/popupwindow/popupwebview.h @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 David Rosca +* Copyright (C) 2010-2013 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -40,6 +40,7 @@ signals: public slots: void closeView(); + void inspectElement(); private: void contextMenuEvent(QContextMenuEvent* event); diff --git a/src/lib/webview/tabbedwebview.cpp b/src/lib/webview/tabbedwebview.cpp index 7b1e93f83..2bc6badcf 100644 --- a/src/lib/webview/tabbedwebview.cpp +++ b/src/lib/webview/tabbedwebview.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 David Rosca +* Copyright (C) 2010-2013 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -270,7 +270,7 @@ void TabbedWebView::contextMenuEvent(QContextMenuEvent* event) m_menu->addAction(tr("Inspect Element"), this, SLOT(inspectElement())); if (!m_menu->isEmpty()) { - //Prevent choosing first option with double rightclick + // Prevent choosing first option with double rightclick const QPoint &pos = event->globalPos(); QPoint p(pos.x(), pos.y() + 1);