[Gui] TextEdit, zoom on Ctrl + wheel

Fixes #13861
This commit is contained in:
Benjamin Bræstrup Sayoc
2024-10-14 08:31:45 -05:00
committed by Chris Hennes
parent de1b1dca21
commit c4e71656db
2 changed files with 12 additions and 0 deletions
+11
View File
@@ -96,6 +96,17 @@ void TextEdit::keyPressEvent(QKeyEvent* e)
}
}
void TextEdit::wheelEvent(QWheelEvent* e)
{
// Reimplement from QPlainText::wheelEvent as zoom is only allowed natively if !isReadOnly
if (e->modifiers() & Qt::ControlModifier) {
float delta = e->angleDelta().y() / 120.f;
zoomInF(delta);
return;
}
QPlainTextEdit::wheelEvent(e);
}
/**
* Completes the word.
*/
+1
View File
@@ -70,6 +70,7 @@ Q_SIGNALS:
protected:
void keyPressEvent(QKeyEvent *) override;
void wheelEvent(QWheelEvent* e) override;
private:
void createListBox();