Fix keeping settings visible when showing all settings

This commit is contained in:
fieldOfView 2018-03-09 16:51:46 +01:00
parent 711d60e8c7
commit 7123441db8

View file

@ -18,7 +18,6 @@ Item
property Action configureSettings property Action configureSettings
property bool findingSettings property bool findingSettings
property bool showingAllSettings property bool showingAllSettings
property bool inhibitSwitchToCustom: false
signal showTooltip(Item item, point location, string text) signal showTooltip(Item item, point location, string text)
signal hideTooltip() signal hideTooltip()
@ -559,13 +558,13 @@ Item
MenuItem MenuItem
{ {
//: Settings context menu action //: Settings context menu action
visible: !findingSettings; visible: !(findingSettings || showingAllSettings);
text: catalog.i18nc("@action:menu", "Hide this setting"); text: catalog.i18nc("@action:menu", "Hide this setting");
onTriggered: onTriggered:
{ {
definitionsModel.hide(contextMenu.key); definitionsModel.hide(contextMenu.key);
// visible settings have changed, so we're no longer showing a preset // visible settings have changed, so we're no longer showing a preset
if (Cura.SettingVisibilityPresetsModel.activePreset != "") if (Cura.SettingVisibilityPresetsModel.activePreset != "" && !showingAllSettings)
{ {
Cura.SettingVisibilityPresetsModel.setActivePreset("custom"); Cura.SettingVisibilityPresetsModel.setActivePreset("custom");
} }
@ -585,7 +584,7 @@ Item
return catalog.i18nc("@action:menu", "Keep this setting visible"); return catalog.i18nc("@action:menu", "Keep this setting visible");
} }
} }
visible: findingSettings; visible: (findingSettings || showingAllSettings);
onTriggered: onTriggered:
{ {
if (contextMenu.settingVisible) if (contextMenu.settingVisible)
@ -597,7 +596,7 @@ Item
definitionsModel.show(contextMenu.key); definitionsModel.show(contextMenu.key);
} }
// visible settings have changed, so we're no longer showing a preset // visible settings have changed, so we're no longer showing a preset
if (Cura.SettingVisibilityPresetsModel.activePreset != "") if (Cura.SettingVisibilityPresetsModel.activePreset != "" && !showingAllSettings)
{ {
Cura.SettingVisibilityPresetsModel.setActivePreset("custom"); Cura.SettingVisibilityPresetsModel.setActivePreset("custom");
} }