Skip to content

Commit 48bad5e

Browse files
committed
Fix an issue with the custom configurations not showing in Cura 5.2
1 parent 52b3cd0 commit 48bad5e

File tree

3 files changed

+25
-9
lines changed

3 files changed

+25
-9
lines changed

resources/qml/MonitorStageMenu.qml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,16 @@ Item
1919
property bool isLE46
2020
property bool isLE410
2121
property bool isLE413
22+
property bool isLE51
2223

2324
Component.onCompleted:
2425
{
2526
is40 = (CuraSDKVersion == "6.0.0")
2627
isLE44 = (CuraSDKVersion <= "7.0.0")
2728
isLE46 = (CuraSDKVersion <= "7.2.0")
2829
isLE410 = (CuraSDKVersion <= "7.6.0")
29-
isLE413 = (CuraSDKVersion <= "7.9.0") && UM.Application.version != "master" && UM.Application.version != "dev"
30+
isLE413 = (CuraSDKVersion <= "7.9.0")
31+
isLE51 = (CuraSDKVersion <= "8.1.0") && UM.Application.version != "master" && UM.Application.version != "dev"
3032

3133
// adjust message stack position for sidebar
3234
var messageStack

resources/qml/SidebarContents.qml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,21 @@ Cura.RoundedRectangle
165165
var customConfiguration = configurationMenu.contentItem.children[0].children[1];
166166
customConfiguration.children[0].visible = false // "Custom" label
167167
customConfiguration.children[0].height = 0
168-
customConfiguration.children[2].visible = false // extruder tabs
169-
customConfiguration.children[2].height = 0
170-
customConfiguration.children[2].anchors.topMargin = 0
171-
customConfiguration.children[3].children[0].visible = false // some spacer rectangle
172-
customConfiguration.children[3].children[0].height = 0
173168

174-
selectors = customConfiguration.children[3].children[1]
169+
var extruderTabs = customConfiguration.children[1]
170+
if (isLE51)
171+
extruderTabs = customConfiguration.children[2]
172+
extruderTabs.visible = false // extruder tabs
173+
extruderTabs.height = 0
174+
extruderTabs.anchors.topMargin = 0
175+
176+
var customSelectors = customConfiguration.children[2]
177+
if (isLE51)
178+
customSelectors = customConfiguration.children[3]
179+
customSelectors.children[0].visible = false // some spacer rectangle
180+
customSelectors.children[0].height = 0
181+
182+
selectors = customSelectors.children[1]
175183
selectors.padding = 0 // enabled/material/variant column
176184
selectors.spacing = UM.Theme.getSize("default_lining").height
177185

resources/qml/SidebarStageMenu.qml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Item
1616
property bool isLE46
1717
property bool isLE410
1818
property bool isLE413
19+
property bool isLE51
1920

2021
property bool prepareStageActive: UM.Controller.activeStage.toString().indexOf("PrepareStage") == 0
2122
property bool preSlicedData: PrintInformation !== null && PrintInformation.preSliced
@@ -32,7 +33,8 @@ Item
3233
isLE44 = (CuraSDKVersion <= "7.0.0")
3334
isLE46 = (CuraSDKVersion <= "7.2.0")
3435
isLE410 = (CuraSDKVersion <= "7.6.0")
35-
isLE413 = (CuraSDKVersion <= "7.9.0") && UM.Application.version != "master" && UM.Application.version != "dev"
36+
isLE413 = (CuraSDKVersion <= "7.9.0")
37+
isLE51 = (CuraSDKVersion <= "8.1.0") && UM.Application.version != "master" && UM.Application.version != "dev"
3638
if(is40)
3739
{
3840
CuraApplication.log("SidebarGUIPlugin patching interface for Cura 4.0")
@@ -53,9 +55,13 @@ Item
5355
{
5456
CuraApplication.log("SidebarGUIPlugin patching interface for Cura 4.10 - 4.13")
5557
}
58+
else if(isLE51)
59+
{
60+
CuraApplication.log("SidebarGUIPlugin patching interface for Cura 5.0 - 5.1")
61+
}
5662
else
5763
{
58-
CuraApplication.log("SidebarGUIPlugin patching interface for Cura 5.0 and newer")
64+
CuraApplication.log("SidebarGUIPlugin patching interface for Cura 5.2 and newer")
5965
}
6066

6167
// top-align toolbar (defined in Cura.qml)

0 commit comments

Comments
 (0)