@@ -509,6 +509,16 @@ Core::Id TextEditorSettings::languageId(const QString &mimeType)
509
509
return d->m_mimeTypeToLanguage .value (mimeType);
510
510
}
511
511
512
+ void showZoomIndicator (QWidget *editor, const int newZoom)
513
+ {
514
+ if (editor) {
515
+ Utils::FadingIndicator::showText (editor,
516
+ QCoreApplication::translate (" TextEditor::TextEditorSettings" ,
517
+ " Zoom: %1%" ).arg (newZoom),
518
+ Utils::FadingIndicator::SmallText);
519
+ }
520
+ }
521
+
512
522
void TextEditorSettings::fontZoomRequested (int zoom)
513
523
{
514
524
FontSettings &fs = const_cast <FontSettings&>(d->m_fontSettingsPage ->fontSettings ());
@@ -517,17 +527,14 @@ void TextEditorSettings::fontZoomRequested(int zoom)
517
527
if (newZoom == previousZoom)
518
528
return ;
519
529
fs.setFontZoom (newZoom);
520
- if (QWidget *editor = qobject_cast<QWidget *>(sender ())) {
521
- Utils::FadingIndicator::showText (editor,
522
- tr (" Zoom: %1%" ).arg (newZoom),
523
- Utils::FadingIndicator::SmallText);
524
- }
530
+ showZoomIndicator (qobject_cast<QWidget *>(sender ()), newZoom);
525
531
d->m_fontSettingsPage ->saveSettings ();
526
532
}
527
533
528
534
void TextEditorSettings::zoomResetRequested ()
529
535
{
530
536
FontSettings &fs = const_cast <FontSettings&>(d->m_fontSettingsPage ->fontSettings ());
531
537
fs.setFontZoom (100 );
538
+ showZoomIndicator (qobject_cast<QWidget *>(sender ()), 100 );
532
539
d->m_fontSettingsPage ->saveSettings ();
533
540
}
0 commit comments