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"; title += " on link";
} }
QWebElement element = r.element(); if (r.isContentEditable()) {
if (!element.isNull() && (element.tagName().toLower() == "input" || element.tagName().toLower() == "textarea")) {
title += " on input"; title += " on input";
} }

View File

@ -185,10 +185,10 @@ QString QupZillaSchemeReply::aboutPage()
aPage.replace("%VERSION-INFO%", aPage.replace("%VERSION-INFO%",
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Version"), QupZilla::VERSION QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Version"), QupZilla::VERSION
#ifdef GIT_REVISION #ifdef GIT_REVISION
+ " (" + GIT_REVISION + ")" + " (" + GIT_REVISION + ")"
#endif #endif
) + ) +
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("WebKit version"), QupZilla::WEBKITVERSION)); QString("<dt>%1</dt><dd>%2<dd>").arg(tr("WebKit version"), QupZilla::WEBKITVERSION));
aPage.replace("%MAIN-DEVELOPER%", tr("Main developer")); aPage.replace("%MAIN-DEVELOPER%", tr("Main developer"));
aPage.replace("%MAIN-DEVELOPER-TEXT%", authorString(QupZilla::AUTHOR.toUtf8(), "nowrep@gmail.com")); aPage.replace("%MAIN-DEVELOPER-TEXT%", authorString(QupZilla::AUTHOR.toUtf8(), "nowrep@gmail.com"));
@ -199,7 +199,7 @@ QString QupZillaSchemeReply::aboutPage()
authorString("Mariusz Fik", "fisiu@opensuse.org") + "<br/>" + authorString("Mariusz Fik", "fisiu@opensuse.org") + "<br/>" +
authorString("Jan Rajnoha", "honza.rajny@hotmail.com") + "<br/>" + authorString("Jan Rajnoha", "honza.rajny@hotmail.com") + "<br/>" +
authorString("Daniele Cocca", "jmc@chakra-project.org") authorString("Daniele Cocca", "jmc@chakra-project.org")
); );
aPage.replace("%TRANSLATORS%", tr("Translators")); aPage.replace("%TRANSLATORS%", tr("Translators"));
aPage.replace("%TRANSLATORS-TEXT%", aPage.replace("%TRANSLATORS-TEXT%",
authorString("Heimen Stoffels", "vistausss@gmail.com") + " (Dutch)<br/>" + authorString("Heimen Stoffels", "vistausss@gmail.com") + " (Dutch)<br/>" +
@ -221,7 +221,7 @@ QString QupZillaSchemeReply::aboutPage()
authorString("Mladen Pejaković", "pejakm@gmail.com") + " (Serbian)<br/>" + authorString("Mladen Pejaković", "pejakm@gmail.com") + " (Serbian)<br/>" +
authorString("Unink-Lio", "unink4451@163.com") + " (Chinese)<br/>" + authorString("Unink-Lio", "unink4451@163.com") + " (Chinese)<br/>" +
authorString("Wu Cheng-Hong", "stu2731652@gmail.com") + " (Traditional Chinese)" authorString("Wu Cheng-Hong", "stu2731652@gmail.com") + " (Traditional Chinese)"
); );
} }
return aPage; return aPage;
@ -316,10 +316,10 @@ QString QupZillaSchemeReply::configPage()
cPage.replace("%VERSION-INFO%", cPage.replace("%VERSION-INFO%",
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Application version"), QupZilla::VERSION QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Application version"), QupZilla::VERSION
#ifdef GIT_REVISION #ifdef GIT_REVISION
+ " (" + GIT_REVISION + ")" + " (" + GIT_REVISION + ")"
#endif #endif
) + ) +
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Qt version"), QT_VERSION_STR) + QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Qt version"), QT_VERSION_STR) +
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("WebKit version"), QupZilla::WEBKITVERSION) + QString("<dt>%1</dt><dd>%2<dd>").arg(tr("WebKit version"), QupZilla::WEBKITVERSION) +
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Build time"), QupZilla::BUILDTIME) + QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Build time"), QupZilla::BUILDTIME) +

View File

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