CURA-4234 view mode button now also moves with the sidebar

This commit is contained in:
Jack Ha 2017-12-13 14:15:27 +01:00
parent 4519f9b46a
commit 63eec848fc

View File

@ -153,11 +153,21 @@ Rectangle
ComboBox ComboBox
{ {
id: viewModeButton id: viewModeButton
property int rightMargin: UM.Theme.getSize("sidebar").width + UM.Theme.getSize("default_margin").width;
anchors { anchors {
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
right: parent.right right: parent.right
rightMargin: UM.Theme.getSize("sidebar").width + UM.Theme.getSize("default_margin").width rightMargin: rightMargin
}
function updateMargins() {
CuraApplication.log("update margin");
if (UM.Preferences.getValue("cura/sidebar_collapse")) {
rightMargin = UM.Theme.getSize("default_margin").width;
} else {
rightMargin = UM.Theme.getSize("sidebar").width + UM.Theme.getSize("default_margin").width;
}
} }
style: UM.Theme.styles.combobox style: UM.Theme.styles.combobox
@ -201,6 +211,13 @@ Rectangle
} }
} }
// Expand or collapse sidebar
Connections
{
target: Cura.Actions.expandSidebar
onTriggered: viewModeButton.updateMargins()
}
Loader Loader
{ {
id: view_panel id: view_panel