diff --git a/rtdata/languages/default b/rtdata/languages/default index ec61230ff..bf56372e5 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1055,6 +1055,8 @@ PREFERENCES_PRTPROFILE;Color profile PREFERENCES_PSPATH;Adobe Photoshop installation directory PREFERENCES_REMEMBERZOOMPAN;Remember zoom % and pan offset PREFERENCES_REMEMBERZOOMPAN_TOOLTIP;Remember the zoom % and pan offset of the current image when opening a new image.\n\nThis option only works in "Single Editor Tab Mode" and when "Demosaicing method used for the preview at <100% zoom" is set to "As in PP3". +PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. (Requires a restart to take effect) PREFERENCES_RGBDTL_LABEL;Max number of threads for Noise Reduction and Wavelet Levels PREFERENCES_RGBDTL_TOOLTIP;Leave the setting at "0" to automatically use as many threads as possible. The more threads run in parallel, the faster the computation. Refer to RawPedia for memory requirements. PREFERENCES_SELECTFONT;Select main font diff --git a/rtgui/cropwindow.cc b/rtgui/cropwindow.cc index 996ec33f7..576997294 100644 --- a/rtgui/cropwindow.cc +++ b/rtgui/cropwindow.cc @@ -103,7 +103,9 @@ void CropWindow::initZoomSteps() float z = 10./float(s); sprintf(lbl, "% 2d%%", int(z * 100)); bool is_major = (s == s/10 * 10); - zoomSteps.push_back(ZoomStep(lbl, z, s, is_major)); + if (is_major || options.extendedZoomLevelsForFit) { + zoomSteps.push_back(ZoomStep(lbl, z, s, is_major)); + } } zoom11index = zoomSteps.size(); for (int s = 1; s <= 8; ++s) { diff --git a/rtgui/options.cc b/rtgui/options.cc index 2f71a7106..f05cfb63b 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -348,6 +348,7 @@ void Options::setDefaults () lastScale = 5; panAccelFactor = 5; rememberZoomAndPan = true; + extendedZoomLevelsForFit = false; lastCropSize = 1; fbOnlyRaw = false; fbShowDateTime = true; @@ -1348,6 +1349,10 @@ int Options::readFromFile (Glib::ustring fname) rememberZoomAndPan = keyFile.get_boolean ("GUI", "RememberZoomAndPan"); } + if (keyFile.has_key ("GUI", "ExtendedZoomLevelsForFit")) { + extendedZoomLevelsForFit = keyFile.get_boolean ("GUI", "ExtendedZoomLevelsForFit"); + } + if (keyFile.has_key ("GUI", "LastCropSize")) { lastCropSize = keyFile.get_integer ("GUI", "LastCropSize"); } @@ -2023,6 +2028,7 @@ int Options::saveToFile (Glib::ustring fname) keyFile.set_integer ("GUI", "LastPreviewScale", lastScale); keyFile.set_integer ("GUI", "PanAccelFactor", panAccelFactor); keyFile.set_boolean ("GUI", "RememberZoomAndPan", rememberZoomAndPan); + keyFile.set_boolean ("GUI", "ExtendedZoomLevelsForFit", extendedZoomLevelsForFit); keyFile.set_integer ("GUI", "LastCropSize", lastCropSize); keyFile.set_boolean ("GUI", "ShowHistory", showHistory); keyFile.set_integer ("GUI", "ShowFilePanelState", showFilePanelState); diff --git a/rtgui/options.h b/rtgui/options.h index 522fe2bf5..5581080cd 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -215,6 +215,7 @@ public: bool filmStripShowFileNames; bool tabbedUI; bool rememberZoomAndPan; + bool extendedZoomLevelsForFit; int multiDisplayMode; // 0=none, 1=Edit panels on other display std::vector cutOverlayBrush; // Red;Green;Blue;Alpha , all ranging 0..1 std::vector navGuideBrush; // Red;Green;Blue;Alpha , all ranging 0..1 diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index 5b28d94c1..a4267c116 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -1132,11 +1132,17 @@ Gtk::Widget* Preferences::getGeneralPanel () navigationGrid->attach_next_to(*panFactorLabel, Gtk::POS_LEFT, 1, 1); navigationGrid->attach_next_to(*panFactor, *panFactorLabel, Gtk::POS_RIGHT, 1, 1); + Gtk::HBox *zoombox = Gtk::manage(new Gtk::HBox()); rememberZoomPanCheckbutton = Gtk::manage( new Gtk::CheckButton (M("PREFERENCES_REMEMBERZOOMPAN")) ); - setExpandAlignProperties(rememberZoomPanCheckbutton, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE); rememberZoomPanCheckbutton->set_tooltip_text(M("PREFERENCES_REMEMBERZOOMPAN_TOOLTIP")); + extendedZoomLevelsCheckbutton = Gtk::manage( new Gtk::CheckButton (M("PREFERENCES_EXTENDEDZOOMLEVELS")) ); + extendedZoomLevelsCheckbutton->set_tooltip_text(M("PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP")); + zoombox->set_spacing(10); + zoombox->pack_start(*rememberZoomPanCheckbutton); + zoombox->pack_start(*extendedZoomLevelsCheckbutton); + setExpandAlignProperties(zoombox, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE); - navigationGrid->attach_next_to(*rememberZoomPanCheckbutton, *panFactorLabel, Gtk::POS_BOTTOM, 2, 1); + navigationGrid->attach_next_to(*zoombox, *panFactorLabel, Gtk::POS_BOTTOM, 2, 1); fnav->add (*navigationGrid); mvbsd->attach_next_to(*fnav, *fclip, Gtk::POS_RIGHT, 1, 1); @@ -1570,6 +1576,7 @@ void Preferences::storePreferences () moptions.dateFormat = dateformat->get_text(); moptions.panAccelFactor = (int)panFactor->get_value(); moptions.rememberZoomAndPan = rememberZoomPanCheckbutton->get_active(); + moptions.extendedZoomLevelsForFit = extendedZoomLevelsCheckbutton->get_active(); moptions.fbShowDateTime = showDateTime->get_active (); moptions.fbShowBasicExif = showBasicExif->get_active (); moptions.fbShowExpComp = showExpComp->get_active (); @@ -1792,6 +1799,7 @@ void Preferences::fillPreferences () dateformat->set_text (moptions.dateFormat); panFactor->set_value (moptions.panAccelFactor); rememberZoomPanCheckbutton->set_active (moptions.rememberZoomAndPan); + extendedZoomLevelsCheckbutton->set_active (moptions.extendedZoomLevelsForFit); ctiffserialize->set_active(moptions.serializeTiffRead); setActiveTextOrIndex (*prtProfile, moptions.rtSettings.printerProfile, 0); diff --git a/rtgui/preferences.h b/rtgui/preferences.h index 18c8a466b..8bcfed2f0 100644 --- a/rtgui/preferences.h +++ b/rtgui/preferences.h @@ -121,6 +121,7 @@ class Preferences : public Gtk::Dialog, public ProfileStoreListener Gtk::SpinButton* panFactor; Gtk::CheckButton* rememberZoomPanCheckbutton; + Gtk::CheckButton* extendedZoomLevelsCheckbutton; Gtk::ComboBoxText* view; Gtk::ComboBoxText* grey;