From 96a6b7559eec9d6c79925cc253c754e615a5bb68 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 2 Jan 2019 14:04:56 +0100 Subject: [PATCH] Remember opened state of settings panel So if you restart Cura while the settings panel was open, it'll stay open when Cura is started back up. Contributes to issue CURA-6069. --- cura/CuraApplication.py | 1 + resources/qml/ExpandableComponent.qml | 2 +- resources/qml/PrintSetupSelector/PrintSetupSelector.qml | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 0edf6c1899..4d1c530237 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -500,6 +500,7 @@ class CuraApplication(QtApplication): preferences.addPreference("cura/choice_on_open_project", "always_ask") preferences.addPreference("cura/use_multi_build_plate", False) preferences.addPreference("view/settings_list_height", 600) + preferences.addPreference("view/settings_visible", False) preferences.addPreference("cura/currency", "€") preferences.addPreference("cura/material_settings", "{}") diff --git a/resources/qml/ExpandableComponent.qml b/resources/qml/ExpandableComponent.qml index afe15bcb1d..025c63d754 100644 --- a/resources/qml/ExpandableComponent.qml +++ b/resources/qml/ExpandableComponent.qml @@ -64,7 +64,7 @@ Item property alias iconSize: collapseButton.height // Is the "drawer" open? - readonly property alias expanded: contentContainer.visible + property alias expanded: contentContainer.visible // What should the radius of the header be. This is also influenced by the headerCornerSide property alias headerRadius: background.radius diff --git a/resources/qml/PrintSetupSelector/PrintSetupSelector.qml b/resources/qml/PrintSetupSelector/PrintSetupSelector.qml index 2d4d7f6cf1..48ac07679d 100644 --- a/resources/qml/PrintSetupSelector/PrintSetupSelector.qml +++ b/resources/qml/PrintSetupSelector/PrintSetupSelector.qml @@ -29,4 +29,7 @@ Cura.ExpandableComponent property var extrudersModel: CuraApplication.getExtrudersModel() contentItem: PrintSetupSelectorContents {} + + onExpandedChanged: UM.Preferences.setValue("view/settings_visible", expanded) + Component.onCompleted: expanded = UM.Preferences.getValue("view/settings_visible") } \ No newline at end of file