mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 02:58:59 +08:00
CURA-4234 view mode button now also moves with the sidebar
This commit is contained in:
parent
4519f9b46a
commit
63eec848fc
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user