Skip to content

Commit 03cf3b9

Browse files
committed
Add initial support for Cura 4.11
1 parent fe79096 commit 03cf3b9

7 files changed

Lines changed: 107 additions & 32 deletions

File tree

plugin.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"author": "fieldOfView",
44
"version": "4.1.3-DEV",
55
"minimum_cura_version": "4.0",
6-
"maximum_cura_version": "4.10",
6+
"maximum_cura_version": "4.11",
77
"description": "Provides an alternative interface which restores the sidebar",
88
"api": "6.0.0",
9-
"supported_sdk_versions": ["6.0.0", "6.1.0", "6.2.0", "6.3.0", "7.0.0", "7.1.0", "7.2.0", "7.3.0", "7.4.0", "7.5.0", "7.6.0"],
9+
"supported_sdk_versions": ["6.0.0", "6.1.0", "6.2.0", "6.3.0", "7.0.0", "7.1.0", "7.2.0", "7.3.0", "7.4.0", "7.5.0", "7.6.0", "7.7.0"],
1010
"i18n-catalog": "cura"
1111
}

resources/qml/MonitorStageMenu.qml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ Item
1717
property bool is40
1818
property bool isLE44
1919
property bool isLE46
20+
property bool isLE410
2021

2122
Component.onCompleted:
2223
{
2324
is40 = (CuraSDKVersion == "6.0.0")
2425
isLE44 = (CuraSDKVersion <= "7.0.0")
25-
isLE46 = (CuraSDKVersion <= "7.2.0") && UM.Application.version != "master"
26+
isLE46 = (CuraSDKVersion <= "7.2.0")
27+
isLE410 = (CuraSDKVersion <= "7.6.0") && UM.Application.version != "master"
2628

2729
// adjust message stack position for sidebar
2830
var messageStack
@@ -70,8 +72,13 @@ Item
7072

7173
Component.onCompleted:
7274
{
73-
machineSelection.children[1].visible = false // remove shadow
74-
if(isLE46) {
75+
if(isLE410)
76+
{
77+
machineSelection.children[1].visible = false // remove shadow
78+
}
79+
80+
if(isLE46)
81+
{
7582
var machineSelectionHeader = machineSelection.children[0].children[3].children[0]
7683
} else {
7784
var machineSelectionHeader = machineSelection.children[0].children[3].children[1]
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// Copyright (c) 2020 Aldo Hoeben / fieldOfView
2+
// SidebarGUIPlugin is released under the terms of the AGPLv3 or higher.
3+
4+
import QtQuick 2.7
5+
import QtQuick.Controls 2.3
6+
7+
import UM 1.3 as UM
8+
import Cura 1.1 as Cura
9+
10+
Button
11+
{
12+
id: openFileButton
13+
14+
height: UM.Theme.getSize("button").height
15+
width: height + 4 * UM.Theme.getSize("default_lining").width // There's some magic going on here
16+
onClicked: Cura.Actions.open.trigger()
17+
hoverEnabled: true
18+
19+
contentItem: Rectangle
20+
{
21+
anchors.left: parent.left
22+
anchors.leftMargin: UM.Theme.getSize("thin_margin").width
23+
24+
opacity: parent.enabled ? 1.0 : 0.2
25+
radius: Math.round(width * 0.5)
26+
27+
color:
28+
{
29+
if(parent.hovered)
30+
{
31+
return UM.Theme.getColor("toolbar_button_hover")
32+
}
33+
return UM.Theme.getColor("toolbar_background")
34+
}
35+
36+
UM.RecolorImage
37+
{
38+
id: buttonIcon
39+
anchors.centerIn: parent
40+
width: parent.width - UM.Theme.getSize("default_margin").width
41+
height: parent.height - UM.Theme.getSize("default_margin").height
42+
source: UM.Theme.getIcon("load")
43+
color: UM.Theme.getColor("icon")
44+
45+
sourceSize.height: height
46+
}
47+
}
48+
49+
background: Cura.RoundedRectangle
50+
{
51+
id: background
52+
height: UM.Theme.getSize("button").height
53+
width: UM.Theme.getSize("button").width + UM.Theme.getSize("narrow_margin").width
54+
55+
radius: UM.Theme.getSize("default_radius").width
56+
cornerSide: Cura.RoundedRectangle.Direction.Right
57+
58+
color: UM.Theme.getColor("toolbar_background")
59+
border.width: UM.Theme.getSize("default_lining").width
60+
border.color: UM.Theme.getColor("lining")
61+
}
62+
}

resources/qml/PrintSetupSummary.qml

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,31 +47,14 @@ Cura.RoundedRectangle
4747
anchors
4848
{
4949
left: parent.left
50-
right: collapseButton.left
50+
right: parent.right
5151
top: parent.top
5252

5353
leftMargin: UM.Theme.getSize("default_margin").width
5454
topMargin: UM.Theme.getSize("default_margin").width
5555
}
5656
}
5757

58-
UM.RecolorImage
59-
{
60-
id: collapseButton
61-
anchors
62-
{
63-
verticalCenter: printSetupSummary.verticalCenter
64-
65-
right: parent.right
66-
rightMargin: UM.Theme.getSize("default_margin").width
67-
}
68-
source: UM.Theme.getIcon("pencil")
69-
visible: summaryEnabled
70-
width: UM.Theme.getSize("action_button_icon").width
71-
height: UM.Theme.getSize("action_button_icon").height
72-
color: UM.Theme.getColor("small_button_text")
73-
}
74-
7558
property bool hasMaterials:
7659
{
7760
if (CuraSDKVersion >= "6.2.0") {

resources/qml/ProfileSelector44.qml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ Item
194194
rightMargin: UM.Theme.getSize("thin_margin").width
195195
}
196196
iconSource: settingsDocked ? "../icons/settings_undock.svg" : "../icons/settings_dock.svg"
197-
width: UM.Theme.getSize("print_setup_icon").width
198-
height: UM.Theme.getSize("print_setup_icon").height
197+
width: UM.Theme.getSize("default_arrow").width + UM.Theme.getSize("default_lining").width
198+
height: width
199199
color: UM.Theme.getColor("small_button_text")
200200

201201
onClicked:
@@ -217,8 +217,8 @@ Item
217217
rightMargin: UM.Theme.getSize("default_margin").width
218218
}
219219
iconSource: UM.Theme.getIcon("cross1")
220-
width: UM.Theme.getSize("default_arrow").width
221-
height: UM.Theme.getSize("default_arrow").height
220+
width: UM.Theme.getSize("default_arrow").width + UM.Theme.getSize("default_lining").width
221+
height: width
222222
color: UM.Theme.getColor("small_button_text")
223223

224224
onClicked:

resources/qml/SidebarStageMenu.qml

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Item
1616
property bool is40
1717
property bool isLE44
1818
property bool isLE46
19+
property bool isLE410
1920

2021
property bool prepareStageActive: UM.Controller.activeStage.toString().indexOf("PrepareStage") == 0
2122
property bool preSlicedData: PrintInformation !== null && PrintInformation.preSliced
@@ -30,7 +31,8 @@ Item
3031
{
3132
is40 = (CuraSDKVersion == "6.0.0")
3233
isLE44 = (CuraSDKVersion <= "7.0.0")
33-
isLE46 = (CuraSDKVersion <= "7.2.0") && UM.Application.version != "master"
34+
isLE46 = (CuraSDKVersion <= "7.2.0")
35+
isLE410 = (CuraSDKVersion <= "7.6.0") && UM.Application.version != "master"
3436
if(is40)
3537
{
3638
CuraApplication.log("SidebarGUIPlugin patching interface for Cura 4.0")
@@ -43,9 +45,13 @@ Item
4345
{
4446
CuraApplication.log("SidebarGUIPlugin patching interface for Cura 4.5 - 4.6")
4547
}
48+
else if(isLE410)
49+
{
50+
CuraApplication.log("SidebarGUIPlugin patching interface for Cura 4.7 - 4.10")
51+
}
4652
else
4753
{
48-
CuraApplication.log("SidebarGUIPlugin patching interface for Cura 4.7 and newer")
54+
CuraApplication.log("SidebarGUIPlugin patching interface for Cura 4.11 and newer")
4955
}
5056

5157
// top-align toolbar (defined in Cura.qml)
@@ -179,7 +185,19 @@ Item
179185
}
180186
}
181187

182-
OpenFileButton {}
188+
Loader
189+
{
190+
anchors.left: parent.left
191+
anchors.leftMargin: -UM.Theme.getSize("default_lining").width
192+
source:
193+
{
194+
if(isLE410) {
195+
return "OpenFileButton40.qml";
196+
} else {
197+
return "OpenFileButton411.qml";
198+
}
199+
}
200+
}
183201

184202
Cura.MachineSelector
185203
{
@@ -191,8 +209,13 @@ Item
191209
y: - Math.floor((UM.Theme.getSize("main_window_header").height + height) / 2)
192210

193211
Component.onCompleted: {
194-
machineSelection.children[1].visible = false // remove shadow
195-
if(isLE46) {
212+
if(isLE410)
213+
{
214+
machineSelection.children[1].visible = false // remove shadow
215+
}
216+
217+
if(isLE46)
218+
{
196219
var machineSelectionHeader = machineSelection.children[0].children[3].children[0]
197220
} else {
198221
var machineSelectionHeader = machineSelection.children[0].children[3].children[1]

0 commit comments

Comments
 (0)