diff --git a/src/config.cc b/src/config.cc index d1c44d7e..04758a2f 100644 --- a/src/config.cc +++ b/src/config.cc @@ -357,13 +357,7 @@ Class load() throw( exError ) c.preferences.autoStart = ( preferences.namedItem( "autoStart" ).toElement().text() == "1" ); if ( !preferences.namedItem( "zoomFactor" ).isNull() ) - { c.preferences.zoomFactor = preferences.namedItem( "zoomFactor" ).toElement().text().toDouble(); - if ( c.preferences.zoomFactor < 0.5 ) - c.preferences.zoomFactor = 0.5; - else if ( c.preferences.zoomFactor > 5 ) - c.preferences.zoomFactor = 5; - } applyBoolOption( c.preferences.enableMainWindowHotkey, preferences.namedItem( "enableMainWindowHotkey" ) ); if ( !preferences.namedItem( "mainWindowHotkey" ).isNull() ) diff --git a/src/mainwindow.cc b/src/mainwindow.cc index ad30fcff..26ca8c0b 100644 --- a/src/mainwindow.cc +++ b/src/mainwindow.cc @@ -241,6 +241,9 @@ MainWindow::MainWindow( Config::Class & cfg_ ): updateTrayIcon(); + // Update zoomers + applyZoomFactor(); + // Update autostart info setAutostart(cfg.preferences.autoStart); @@ -1217,18 +1220,12 @@ void MainWindow::on_actionCloseToTray_activated() void MainWindow::zoomin() { - if ( cfg.preferences.zoomFactor >= 5 ) - return; // 5x is maximum - cfg.preferences.zoomFactor += 0.1; applyZoomFactor(); } void MainWindow::zoomout() { - if ( cfg.preferences.zoomFactor <= 0.5 ) - return; // 0.5x is minimum - cfg.preferences.zoomFactor -= 0.1; applyZoomFactor(); } @@ -1241,6 +1238,15 @@ void MainWindow::unzoom() void MainWindow::applyZoomFactor() { + if ( cfg.preferences.zoomFactor >= 3 ) + cfg.preferences.zoomFactor = 3; + else if ( cfg.preferences.zoomFactor <= 0.8 ) + cfg.preferences.zoomFactor = 0.8; + + zoomIn->setEnabled( cfg.preferences.zoomFactor < 3 ); + zoomOut->setEnabled( cfg.preferences.zoomFactor > 0.8 ); + zoomBase->setEnabled( cfg.preferences.zoomFactor != 1.0 ); + for ( int i = 0; i < ui.tabWidget->count(); i++ ) { ArticleView & view =