mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 18:59:10 +08:00
Rename sidebar_collapsed and code style
sidebar_collapsed is more consistent with other options and setting names we use. Better change it before the next release rolls out otherwise we'd have to do a version upgrade. Also changed some code style things to be in line with our guidelines. Contributes to issue CURA-4234.
This commit is contained in:
parent
147278e455
commit
689a18ee57
@ -316,7 +316,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("cura/sidebar_collapse", False)
|
preferences.addPreference("cura/sidebar_collapsed", 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")
|
||||||
|
|
||||||
|
@ -401,7 +401,7 @@ UM.MainWindow
|
|||||||
collapseSidebarAnimation.start();
|
collapseSidebarAnimation.start();
|
||||||
}
|
}
|
||||||
collapsed = !collapsed;
|
collapsed = !collapsed;
|
||||||
UM.Preferences.setValue("cura/sidebar_collapse", collapsed);
|
UM.Preferences.setValue("cura/sidebar_collapsed", collapsed);
|
||||||
}
|
}
|
||||||
|
|
||||||
anchors
|
anchors
|
||||||
@ -432,9 +432,10 @@ UM.MainWindow
|
|||||||
|
|
||||||
Component.onCompleted:
|
Component.onCompleted:
|
||||||
{
|
{
|
||||||
var sidebarCollapsed = UM.Preferences.getValue("cura/sidebar_collapse");
|
var sidebar_collapsed = UM.Preferences.getValue("cura/sidebar_collapsed");
|
||||||
|
|
||||||
if (sidebarCollapsed) {
|
if (sidebar_collapsed)
|
||||||
|
{
|
||||||
sidebar.collapsed = true;
|
sidebar.collapsed = true;
|
||||||
viewportRect = Qt.rect(0, 0, 1, 1.0)
|
viewportRect = Qt.rect(0, 0, 1, 1.0)
|
||||||
collapseSidebarAnimation.start();
|
collapseSidebarAnimation.start();
|
||||||
|
@ -25,9 +25,12 @@ Rectangle
|
|||||||
property int allItemsWidth: 0;
|
property int allItemsWidth: 0;
|
||||||
|
|
||||||
function updateMarginsAndSizes() {
|
function updateMarginsAndSizes() {
|
||||||
if (UM.Preferences.getValue("cura/sidebar_collapse")) {
|
if (UM.Preferences.getValue("cura/sidebar_collapsed"))
|
||||||
|
{
|
||||||
rightMargin = UM.Theme.getSize("default_margin").width;
|
rightMargin = UM.Theme.getSize("default_margin").width;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
rightMargin = UM.Theme.getSize("sidebar").width + UM.Theme.getSize("default_margin").width;
|
rightMargin = UM.Theme.getSize("sidebar").width + UM.Theme.getSize("default_margin").width;
|
||||||
}
|
}
|
||||||
allItemsWidth = (
|
allItemsWidth = (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user