diff --git a/rtgui/toolbar.cc b/rtgui/toolbar.cc index 9bed78768..f0a08b263 100644 --- a/rtgui/toolbar.cc +++ b/rtgui/toolbar.cc @@ -107,7 +107,7 @@ void ToolBar::setTool (ToolMode tool) ConnectionBlocker cropBlocker(cropConn); ConnectionBlocker wbWasBlocked(wbTool, wbConn), cpWasBlocked(colPickerTool, cpConn); - stopEdit = tool == TMHand && handTool->get_active() && editingMode; + stopEdit = tool == TMHand && handTool->get_active() && editingMode && !blockEdit; handTool->set_active (false); @@ -204,7 +204,7 @@ void ToolBar::hand_pressed () ConnectionBlocker cropBlocker(cropConn); ConnectionBlocker wbWasBlocked(wbTool, wbConn), cpWasBlocked(colPickerTool, cpConn); - if (editingMode) { + if (editingMode && !blockEdit) { stopEditMode(); if (listener) { listener->editModeSwitchedOff (); @@ -289,7 +289,7 @@ void ToolBar::colPicker_pressed (GdkEventButton* event) if (current != TMColorPicker) { // Disabling all other tools, enabling the Picker tool and entering the "visible pickers" mode - if (editingMode) { + if (editingMode && !blockEdit) { stopEditMode(); if (listener) { listener->editModeSwitchedOff (); diff --git a/rtgui/toolbar.h b/rtgui/toolbar.h index 2d859eac7..b86aff6ca 100644 --- a/rtgui/toolbar.h +++ b/rtgui/toolbar.h @@ -64,6 +64,7 @@ protected: ToolMode current; bool allowNoTool; bool editingMode; // true if the cursor is being used to remotely edit tool's values + bool blockEdit; // true if edit tool shoudn't be disabled when pressing hand button or h/H key sigc::connection handConn; sigc::connection wbConn; sigc::connection cpConn; @@ -98,6 +99,11 @@ public: bool handleShortcutKey (GdkEventKey* event); void setBatchMode(); + + void blockEditDeactivation(bool cond = true) + { + blockEdit = cond; + } }; #endif diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index 1f8988c03..b3072326e 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -281,8 +281,10 @@ void ToolPanelCoordinator::notebookPageChanged(Gtk::Widget* page, guint page_num // segfault) and locallab panel is active if (photoLoadedOnce) { if (page == locallabPanelSW) { + toolBar->blockEditDeactivation(); // Avoid edit tool deactivation when Locallab page is active (except if pressing other tools button) locallab->subscribe(); } else { + toolBar->blockEditDeactivation(false); locallab->unsubscribe(); } }