Skip to content

Commit 08bbbaa

Browse files
committed
Fix Machine Selector in Monitor page
1 parent 7859180 commit 08bbbaa

2 files changed

Lines changed: 25 additions & 6 deletions

File tree

resources/qml/MonitorStageMenu.qml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ Item
1818
property bool isLE44
1919
property bool isLE46
2020
property bool isLE410
21+
property bool isLE413
2122

2223
Component.onCompleted:
2324
{
2425
is40 = (CuraSDKVersion == "6.0.0")
2526
isLE44 = (CuraSDKVersion <= "7.0.0")
2627
isLE46 = (CuraSDKVersion <= "7.2.0")
27-
isLE410 = (CuraSDKVersion <= "7.6.0") && UM.Application.version != "master"
28+
isLE410 = (CuraSDKVersion <= "7.6.0")
29+
isLE413 = (CuraSDKVersion <= "7.9.0") && UM.Application.version != "master"
2830

2931
// adjust message stack position for sidebar
3032
var messageStack
@@ -36,24 +38,32 @@ Item
3638
{
3739
messageStack = base.contentItem.children[2].children[3].children[7]
3840
}
39-
else
41+
else if(isLE413)
4042
{
4143
messageStack = base.contentItem.children[2].children[3].children[8]
4244
}
45+
else
46+
{
47+
messageStack = base.contentItem.children[3].children[3].children[8]
48+
}
49+
messageStack.anchors.horizontalCenter = undefined
50+
messageStack.anchors.left = messageStack.parent.left
4351
messageStack.anchors.leftMargin = Qt.binding(function()
4452
{
45-
return Math.floor((base.width) / 2)
53+
return Math.floor((base.width - printSetupSelector.width) / 2)
4654
})
4755

4856
// adjust stages menu position for sidebar
4957
var stagesListContainer = mainWindowHeader.children[1]
58+
stagesListContainer.anchors.horizontalCenter = undefined
59+
stagesListContainer.anchors.left = stagesListContainer.parent.left
5060
stagesListContainer.anchors.leftMargin = Qt.binding(function()
5161
{
5262
return Math.floor((base.width - printSetupSelector.width - stagesListContainer.width) / 2)
5363
})
5464

5565
// hide application logo if there is no room for it
56-
var applicationLogo = mainWindowHeader.children[0] // declared as property above
66+
var applicationLogo = mainWindowHeader.children[0]
5767
applicationLogo.visible = Qt.binding(function()
5868
{
5969
return stagesListContainer.anchors.leftMargin > applicationLogo.width + 2 * UM.Theme.getSize("default_margin").width
@@ -65,7 +75,15 @@ Item
6575
id: machineSelection
6676
headerCornerSide: Cura.RoundedRectangle.Direction.All
6777
width: UM.Theme.getSize("machine_selector_widget").width
68-
height: UM.Theme.getSize("main_window_header_button").height
78+
height:
79+
{
80+
if (isLE413)
81+
{
82+
return UM.Theme.getSize("main_window_header_button").height
83+
} else {
84+
return Math.round(0.5 * UM.Theme.getSize("main_window_header").height)
85+
}
86+
}
6987
anchors.right: parent.right
7088
anchors.rightMargin: UM.Theme.getSize("print_setup_widget").width - width
7189
y: - Math.floor((UM.Theme.getSize("main_window_header").height + height) / 2)

resources/qml/SidebarStageMenu.qml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ Item
226226
anchors.left: printSetupSidebar.left
227227
y: - Math.floor((UM.Theme.getSize("main_window_header").height + height) / 2)
228228

229-
Component.onCompleted: {
229+
Component.onCompleted:
230+
{
230231
if(isLE410)
231232
{
232233
machineSelection.children[1].visible = false // remove shadow

0 commit comments

Comments
 (0)