From c5e81df65de0dd4cfe9c1741490fb7310532c413 Mon Sep 17 00:00:00 2001 From: YiFang Xiao Date: Sun, 29 Dec 2024 10:19:50 +0800 Subject: [PATCH] opt: only change the font of translate line --- src/ui/mainwindow.cc | 9 +++++---- src/ui/scanpopup.cc | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/ui/mainwindow.cc b/src/ui/mainwindow.cc index e254fcb69..00b43bcbf 100644 --- a/src/ui/mainwindow.cc +++ b/src/ui/mainwindow.cc @@ -3633,14 +3633,14 @@ void MainWindow::scaleArticlesByCurrentZoomFactor() void MainWindow::doWordsZoomIn() { - ++cfg.preferences.wordsZoomLevel; + cfg.preferences.wordsZoomLevel = cfg.preferences.wordsZoomLevel + 2; applyWordsZoomLevel(); } void MainWindow::doWordsZoomOut() { - --cfg.preferences.wordsZoomLevel; + cfg.preferences.wordsZoomLevel = cfg.preferences.wordsZoomLevel - 2; applyWordsZoomLevel(); } @@ -3659,11 +3659,12 @@ void MainWindow::applyWordsZoomLevel() int ps = getIconSize(); ps += cfg.preferences.wordsZoomLevel; - if ( ps < 1 ) { - ps = 1; + if ( ps < 12 ) { + ps = 12; } font.setPixelSize( ps * 0.8 ); + font.setWeight( QFont::Normal ); translateLine->setFont( font ); // translateBox->completerWidget()->setFont( font ); wordsZoomBase->setEnabled( cfg.preferences.wordsZoomLevel != 0 ); diff --git a/src/ui/scanpopup.cc b/src/ui/scanpopup.cc index ce956eff7..bcb955920 100644 --- a/src/ui/scanpopup.cc +++ b/src/ui/scanpopup.cc @@ -354,8 +354,8 @@ void ScanPopup::applyWordsZoomLevel() if ( cfg.preferences.wordsZoomLevel != 0 ) { ps += cfg.preferences.wordsZoomLevel; - if ( ps < 1 ) { - ps = 1; + if ( ps < 12 ) { + ps = 12; } font.setPixelSize( ps * 0.8 ); }