aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/texteditor.cpp
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2024-02-23 12:36:11 +0100
committerDavid Schulz <david.schulz@qt.io>2024-02-23 12:01:29 +0000
commit8feb31b2ac194af3b5da09e6c1636a7953b40ffb (patch)
tree30f51dbd542cbbe298dce6ff789e5c7e753ecda2 /src/plugins/texteditor/texteditor.cpp
parent9f7d8b06b26fc87e5f588519e53d39a0ed790142 (diff)
TextEditor: bound increase and decreaseFontZoom to a 10% grid
This allows to get back to a 100% font zoom with the keyboard shortcuts by zooming to an odd zoom factor by other means. Change-Id: Ie90853367b17c207e9c47fc108b8d6f451e0f838 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Diffstat (limited to 'src/plugins/texteditor/texteditor.cpp')
-rw-r--r--src/plugins/texteditor/texteditor.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp
index c8ef69c63e..70239b286e 100644
--- a/src/plugins/texteditor/texteditor.cpp
+++ b/src/plugins/texteditor/texteditor.cpp
@@ -6891,6 +6891,18 @@ static void showZoomIndicator(QWidget *editor, const int newZoom)
Utils::FadingIndicator::SmallText);
}
+void TextEditorWidget::increaseFontZoom()
+{
+ d->clearVisibleFoldedBlock();
+ showZoomIndicator(this, TextEditorSettings::increaseFontZoom());
+}
+
+void TextEditorWidget::decreaseFontZoom()
+{
+ d->clearVisibleFoldedBlock();
+ showZoomIndicator(this, TextEditorSettings::decreaseFontZoom());
+}
+
void TextEditorWidget::zoomF(float delta)
{
d->clearVisibleFoldedBlock();