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>
This commit is contained in:
David Schulz
2024-02-23 12:36:11 +01:00
parent 9f7d8b06b2
commit 8feb31b2ac
5 changed files with 40 additions and 11 deletions

View File

@@ -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();