Skip to content

Commit

Permalink
opt: only change the font of translate line
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyifang committed Dec 29, 2024
1 parent b393900 commit c5e81df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions src/ui/mainwindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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 );
Expand Down
4 changes: 2 additions & 2 deletions src/ui/scanpopup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand Down

0 comments on commit c5e81df

Please sign in to comment.