diff --git a/rtdata/images/lock_off.png b/rtdata/images/lock_off.png new file mode 100644 index 000000000..96c1a6da4 Binary files /dev/null and b/rtdata/images/lock_off.png differ diff --git a/rtdata/images/lock_on.png b/rtdata/images/lock_on.png new file mode 100644 index 000000000..3e3cf12db Binary files /dev/null and b/rtdata/images/lock_on.png differ diff --git a/rtdata/languages/default b/rtdata/languages/default index c52e8be89..0b674fc2e 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -459,6 +459,7 @@ MAIN_TOOLTIP_HIDEFP;Show/hide the bottom panel (directory and file browser) F MAIN_TOOLTIP_HIDEHP;Show/hide the left panel (including the history) l MAIN_TOOLTIP_INDCLIPPEDH;Clipped highlight indication (Key <) MAIN_TOOLTIP_INDCLIPPEDS;Clipped shadow indication (Key >) +MAIN_TOOLTIP_BEFOREAFTERLOCK;Lock / Unlock the Before view\n\nLock: keep the Before view unchanged - \nuseful to evaluate the cumulative effect of multiple tools.\nAdditionally, comparison can be made to any state in the History\n\nUnlock: the Before view will follow the After view 1 step behind, showing image before the effect of the currently used tool MAIN_TOOLTIP_PREFERENCES;Set preferences MAIN_TOOLTIP_QINFO;Quick info on the image I MAIN_TOOLTIP_SAVEAS;Save image to a selected folder diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 792ecf1e5..2948ec136 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -82,6 +82,8 @@ EditorPanel::EditorPanel (FilePanel* filePanel) beforeAfter->set_relief(Gtk::RELIEF_NONE); beforeAfter->set_tooltip_markup (M("MAIN_TOOLTIP_TOGGLE")); + iBeforeLockON = new Gtk::Image(argv0+"/images/lock_on.png"); + iBeforeLockOFF = new Gtk::Image(argv0+"/images/lock_off.png"); Gtk::VSeparator* vsept = Gtk::manage (new Gtk::VSeparator ()); Gtk::VSeparator* vsepz = Gtk::manage (new Gtk::VSeparator ()); @@ -1221,7 +1223,7 @@ void EditorPanel::beforeAfterToggled () { return; removeIfThere (beforeAfterBox, beforeBox, false); - removeIfThere (afterBox, afterLabel, false); + removeIfThere (afterBox, afterHeaderBox, false); if (beforeIarea) { if (beforeIpc) @@ -1246,16 +1248,32 @@ void EditorPanel::beforeAfterToggled () { beforeIarea = new ImageAreaPanel (); + int HeaderBoxHeight = 15; + beforeLabel = Gtk::manage (new Gtk::Label ()); beforeLabel->set_markup (Glib::ustring("") + M("GENERAL_BEFORE") + ""); + tbBeforeLock = Gtk::manage (new Gtk::ToggleButton ()); + tbBeforeLock->set_tooltip_markup (M("MAIN_TOOLTIP_BEFOREAFTERLOCK")); + tbBeforeLock->signal_toggled().connect( sigc::mem_fun(*this, &EditorPanel::tbBeforeLock_toggled) ); + beforeHeaderBox = Gtk::manage (new Gtk::HBox ()); + beforeHeaderBox->pack_end (*tbBeforeLock, Gtk::PACK_SHRINK, 2); + beforeHeaderBox->pack_end (*beforeLabel, Gtk::PACK_SHRINK, 2); + beforeHeaderBox->set_size_request(0, HeaderBoxHeight); + + history->blistenerLock ? tbBeforeLock->set_image (*iBeforeLockON):tbBeforeLock->set_image (*iBeforeLockOFF); + tbBeforeLock->set_active(history->blistenerLock); + beforeBox = Gtk::manage (new Gtk::VBox ()); - beforeBox->pack_start (*beforeLabel, Gtk::PACK_SHRINK, 2); + beforeBox->pack_start (*beforeHeaderBox, Gtk::PACK_SHRINK, 2); beforeBox->pack_start (*beforeIarea); afterLabel = Gtk::manage (new Gtk::Label ()); afterLabel->set_markup (Glib::ustring("") + M("GENERAL_AFTER") + ""); - afterBox->pack_start (*afterLabel, Gtk::PACK_SHRINK, 2); - afterBox->reorder_child (*afterLabel, 0); + afterHeaderBox = Gtk::manage (new Gtk::HBox ()); + afterHeaderBox->set_size_request(0, HeaderBoxHeight); + afterHeaderBox->pack_end (*afterLabel, Gtk::PACK_SHRINK, 2); + afterBox->pack_start (*afterHeaderBox, Gtk::PACK_SHRINK, 2); + afterBox->reorder_child (*afterHeaderBox, 0); beforeAfterBox->pack_start (*beforeBox); beforeAfterBox->reorder_child (*beforeBox, 0); @@ -1278,6 +1296,11 @@ void EditorPanel::beforeAfterToggled () { } } +void EditorPanel::tbBeforeLock_toggled () { + history->blistenerLock = tbBeforeLock->get_active(); + tbBeforeLock->get_active()? tbBeforeLock->set_image (*iBeforeLockON) : tbBeforeLock->set_image (*iBeforeLockOFF); +} + void EditorPanel::histogramChanged (LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histToneCurve, LUTu & histLCurve, LUTu & histRedRaw, LUTu & histGreenRaw, LUTu & histBlueRaw) { diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h index 6e8ee6fcf..2bad97523 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -57,6 +57,7 @@ class EditorPanel : public Gtk::VBox, Gtk::ToggleButton* tbShowHideSidePanels; Gtk::ToggleButton* tbTopPanel_1; Gtk::ToggleButton* tbRightPanel_1; + Gtk::ToggleButton* tbBeforeLock; bool tbTopPanel_1_Active; bool tbRightPanel_1_Active; //bool bAllSidePanelsVisible; @@ -68,6 +69,7 @@ class EditorPanel : public Gtk::VBox, Gtk::Image *iTopPanel_1_Show, *iTopPanel_1_Hide; Gtk::Image *iRightPanel_1_Show, *iRightPanel_1_Hide; Gtk::Image *iShowHideSidePanels; + Gtk::Image *iBeforeLockON, *iBeforeLockOFF; Gtk::VBox *leftbox; Gtk::VBox *vboxright; @@ -85,6 +87,8 @@ class EditorPanel : public Gtk::VBox, Gtk::Label* beforeLabel; Gtk::Label* afterLabel; Gtk::HBox* beforeAfterBox; + Gtk::HBox* beforeHeaderBox; + Gtk::HBox* afterHeaderBox; Gtk::Frame* ppframe; ProfilePanel* profilep; @@ -163,6 +167,7 @@ class EditorPanel : public Gtk::VBox, void tbRightPanel_1_toggled (); void tbTopPanel_1_toggled (); void beforeAfterToggled (); + void tbBeforeLock_toggled(); void saveAsPressed (); void queueImgPressed (); void sendToGimpPressed (); diff --git a/rtgui/history.cc b/rtgui/history.cc index 7aca1ba1f..e538ea3c8 100644 --- a/rtgui/history.cc +++ b/rtgui/history.cc @@ -27,6 +27,8 @@ extern Glib::ustring argv0; History::History (bool bookmarkSupport) : blistener(NULL), tpc (NULL), bmnum (1) { + blistenerLock = false; // sets default that the Before preview will not be locked + // fill history event message array for (int i=0; iprofileChange (¶ms, EvHistoryBrowsed, row[historyColumns.text], ¶msEdited); } - if (blistener) { + if (blistener && blistenerLock==false) { Gtk::TreeModel::Path path = historyModel->get_path (iter); path.prev (); iter = historyModel->get_iter (path); @@ -208,9 +210,9 @@ void History::procParamsChanged (ProcParams* params, ProcEvent ev, Glib::ustring newrow[historyColumns.paramsEdited] = paramsEdited ? *paramsEdited : defParamsEdited; if (ev!=EvBookmarkSelected) selection->select (newrow); - if (blistener && row) + if (blistener && row && blistenerLock==false) blistener->historyBeforeLineChanged (row[historyColumns.params]); - else if (blistener && size==0) + else if (blistener && size==0 && blistenerLock==false) blistener->historyBeforeLineChanged (newrow[historyColumns.params]); } // else just update it diff --git a/rtgui/history.h b/rtgui/history.h index 134b30b0b..67e4b1e1d 100644 --- a/rtgui/history.h +++ b/rtgui/history.h @@ -100,6 +100,8 @@ class History : public Gtk::VBox, public PParamsChangeListener { void undo (); void redo (); + + bool blistenerLock; }; #endif