User can configure "auto select layer" in quick mode independently

Now we have one "auto select layer" option for the quick mode of Move
tool (Ctrl/Cmd key, true by default) an other option for the regular
Move tool mode (false by default).
This commit is contained in:
David Capello 2020-04-18 21:21:14 -03:00
parent 0e32fb653d
commit 07f1510ebd
3 changed files with 10 additions and 2 deletions

View File

@ -157,6 +157,7 @@
<option id="auto_scroll" type="bool" default="true" />
<option id="right_click_mode" type="RightClickMode" default="RightClickMode::PAINT_BGCOLOR" />
<option id="auto_select_layer" type="bool" default="false" />
<option id="auto_select_layer_quick" type="bool" default="true" />
<option id="straight_line_preview" type="bool" default="true" />
<option id="play_once" type="bool" default="false" />
<option id="play_all" type="bool" default="false" />

View File

@ -1134,7 +1134,14 @@ protected:
void onClick(Event& ev) override {
CheckBox::onClick(ev);
Preferences::instance().editor.autoSelectLayer(isSelected());
auto atm = App::instance()->activeToolManager();
if (atm->quickTool() &&
atm->quickTool()->getInk(0)->isCelMovement()) {
Preferences::instance().editor.autoSelectLayerQuick(isSelected());
}
else {
Preferences::instance().editor.autoSelectLayer(isSelected());
}
releaseFocus();
}

View File

@ -1613,7 +1613,7 @@ void Editor::updateToolLoopModifiersIndicators()
// For move tool
action = m_customizationDelegate->getPressedKeyAction(KeyContext::MoveTool);
if (int(action & KeyAction::AutoSelectLayer))
newAutoSelectLayer = true;
newAutoSelectLayer = Preferences::instance().editor.autoSelectLayerQuick();
else
newAutoSelectLayer = Preferences::instance().editor.autoSelectLayer();
}