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

Fixed showing edit context menu on gmail.com

This commit is contained in:
nowrep 2012-02-20 18:28:09 +01:00
parent 88de940dc1
commit 119090c28c
3 changed files with 18 additions and 17 deletions

View File

@ -87,8 +87,7 @@ void TestPlugin::populateWebViewMenu(QMenu* menu, WebView* view, const QWebHitTe
title += " on link";
}
QWebElement element = r.element();
if (!element.isNull() && (element.tagName().toLower() == "input" || element.tagName().toLower() == "textarea")) {
if (r.isContentEditable()) {
title += " on input";
}

View File

@ -511,8 +511,7 @@ void WebView::createContextMenu(QMenu* menu, const QWebHitTestResult &hitTest, c
createMediaContextMenu(menu, hitTest);
}
QWebElement element = hitTest.element();
if (!element.isNull() && (element.tagName().toLower() == "input" || element.tagName().toLower() == "textarea")) {
if (hitTest.isContentEditable()) {
if (menu->isEmpty()) {
QMenu* pageMenu = page()->createStandardContextMenu();
@ -523,10 +522,13 @@ void WebView::createContextMenu(QMenu* menu, const QWebHitTestResult &hitTest, c
continue;
}
// Hiding double Direction menu (bug in QtWebKit 2.2)
if (i == 0 && act->menu()) {
// Hiding double Direction + Fonts menu (bug in QtWebKit 2.2)
if (i <= 1 && act->menu()) {
if (act->menu()->actions().contains(pageAction(QWebPage::SetTextDirectionDefault)) ||
act->menu()->actions().contains(pageAction(QWebPage::ToggleBold))) {
act->setVisible(false);
}
}
menu->addAction(act);