forked from qt-creator/qt-creator
TextEditor: follow "Enable scroll wheel zooming" setting behavior
When it is disabled, scroll wheel zooming should not work. Change-Id: Ie6a7e2620185ee4496830c614a6ccd48c9ec2427 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com> Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
committed by
David Schulz
parent
d7b3bf2879
commit
ae9ce6981c
@@ -5436,7 +5436,14 @@ void TextEditorWidgetPrivate::handleBackspaceKey()
|
||||
void TextEditorWidget::wheelEvent(QWheelEvent *e)
|
||||
{
|
||||
d->clearVisibleFoldedBlock();
|
||||
if (scrollWheelZoomingEnabled() && e->modifiers() & Qt::ControlModifier) {
|
||||
if (e->modifiers() & Qt::ControlModifier) {
|
||||
if (!scrollWheelZoomingEnabled()) {
|
||||
// When the setting is disabled globally,
|
||||
// we have to skip calling QPlainTextEdit::wheelEvent()
|
||||
// that changes zoom in it.
|
||||
return;
|
||||
}
|
||||
|
||||
const int delta = e->delta();
|
||||
if (delta < 0)
|
||||
zoomOut();
|
||||
|
||||
Reference in New Issue
Block a user