CURA-4234 rename to cura/sidebar_collapse, fix spelling errors, styling

This commit is contained in:
Jack Ha 2017-12-13 14:04:02 +01:00
parent 80afda1912
commit 4519f9b46a
2 changed files with 14 additions and 14 deletions

View file

@ -313,7 +313,7 @@ class CuraApplication(QtApplication):
preferences.addPreference("cura/material_settings", "{}") preferences.addPreference("cura/material_settings", "{}")
preferences.addPreference("view/invert_zoom", False) preferences.addPreference("view/invert_zoom", False)
preferences.addPreference("general/sidebar_collapse", False) preferences.addPreference("cura/sidebar_collapse", False)
self._need_to_show_user_agreement = not Preferences.getInstance().getValue("general/accepted_user_agreement") self._need_to_show_user_agreement = not Preferences.getInstance().getValue("general/accepted_user_agreement")

View file

@ -392,16 +392,16 @@ UM.MainWindow
function callExpandOrCollapse() { function callExpandOrCollapse() {
if (collapsed) { if (collapsed) {
sidebar.visible = true sidebar.visible = true;
sidebar.initialWidth = UM.Theme.getSize("sidebar").width sidebar.initialWidth = UM.Theme.getSize("sidebar").width;
viewportRect = Qt.rect(0, 0, (base.width - sidebar.width) / base.width, 1.0) viewportRect = Qt.rect(0, 0, (base.width - sidebar.width) / base.width, 1.0);
expandSidebarAnimation.start(); expandSidebarAnimation.start();
} else { } else {
viewportRect = Qt.rect(0, 0, 1, 1.0) viewportRect = Qt.rect(0, 0, 1, 1.0);
collapsSidebarAnimation.start(); collapseSidebarAnimation.start();
} }
collapsed = !collapsed; collapsed = !collapsed;
UM.Preferences.setValue("general/sidebar_collapse", collapsed); UM.Preferences.setValue("cura/sidebar_collapse", collapsed);
} }
anchors anchors
@ -415,7 +415,7 @@ UM.MainWindow
source: UM.Controller.activeStage.sidebarComponent source: UM.Controller.activeStage.sidebarComponent
NumberAnimation { NumberAnimation {
id: collapsSidebarAnimation id: collapseSidebarAnimation
target: sidebar target: sidebar
properties: "x" properties: "x"
to: base.width to: base.width
@ -432,12 +432,12 @@ UM.MainWindow
Component.onCompleted: Component.onCompleted:
{ {
var sidebarCollaps = UM.Preferences.getValue("general/sidebar_collapse") var sidebarCollapsed = UM.Preferences.getValue("cura/sidebar_collapse");
if (sidebarCollaps == true){ if (sidebarCollapsed) {
sidebar.collapsed = true; sidebar.collapsed = true;
viewportRect = Qt.rect(0, 0, 1, 1.0) viewportRect = Qt.rect(0, 0, 1, 1.0)
collapsSidebarAnimation.start(); collapseSidebarAnimation.start();
} }
} }
} }