1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 18:56:34 +01:00

WebView: Fix zoom shortcuts with +/-/0 on numeric block

This commit is contained in:
David Rosca 2014-12-13 19:29:45 +01:00
parent fba9900775
commit 5d99f53fb8

View File

@ -1401,6 +1401,45 @@ void WebView::keyPressEvent(QKeyEvent* event)
} }
} }
switch (eventKey) {
case Qt::Key_ZoomIn:
zoomIn();
event->accept();
return;
case Qt::Key_ZoomOut:
zoomOut();
event->accept();
return;
case Qt::Key_Plus:
if (event->modifiers() & Qt::ControlModifier) {
zoomIn();
event->accept();
return;
}
break;
case Qt::Key_Minus:
if (event->modifiers() & Qt::ControlModifier) {
zoomOut();
event->accept();
return;
}
break;
case Qt::Key_0:
if (event->modifiers() & Qt::ControlModifier) {
zoomReset();
event->accept();
return;
}
break;
default:
break;
}
// Text navigation is handled automatically in editable elements // Text navigation is handled automatically in editable elements
const QString js = QSL("document.activeElement.contentEditable==='true'||typeof document.activeElement.value != 'undefined'"); const QString js = QSL("document.activeElement.contentEditable==='true'||typeof document.activeElement.value != 'undefined'");
QWebFrame* frame = page()->currentFrame(); QWebFrame* frame = page()->currentFrame();