Skip to content

Commit 279859b

Browse files
committed
Move presliced data warning to print setup summary
1 parent 158b329 commit 279859b

3 files changed

Lines changed: 40 additions & 24 deletions

File tree

resources/qml/PrintSetupSummary.qml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,18 @@ import Cura 1.1 as Cura
99

1010
Cura.RoundedRectangle
1111
{
12-
color: mouseArea.containsMouse ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button")
12+
color:
13+
{
14+
if (preSlicedData)
15+
{
16+
return UM.Theme.getColor("action_button_disabled")
17+
}
18+
else if (mouseArea.containsMouse)
19+
{
20+
return UM.Theme.getColor("action_button_hovered")
21+
}
22+
return UM.Theme.getColor("action_button")
23+
}
1324
border.width: UM.Theme.getSize("default_lining").width
1425
border.color: UM.Theme.getColor("lining")
1526
radius: UM.Theme.getSize("default_radius").width
@@ -20,6 +31,7 @@ Cura.RoundedRectangle
2031
Cura.PrintSetupSelectorHeader
2132
{
2233
id: printSetupSummary
34+
visible: !preSlicedData
2335

2436
anchors
2537
{
@@ -43,7 +55,7 @@ Cura.RoundedRectangle
4355
rightMargin: UM.Theme.getSize("default_margin").width
4456
}
4557
source: UM.Theme.getIcon("pencil")
46-
visible: source != ""
58+
visible: !preSlicedData
4759
width: UM.Theme.getSize("action_button_icon").width
4860
height: UM.Theme.getSize("action_button_icon").height
4961
color: UM.Theme.getColor("small_button_text")
@@ -53,6 +65,7 @@ Cura.RoundedRectangle
5365
{
5466
id: extruderSummary
5567
enabled: false
68+
visible: !preSlicedData
5669

5770
anchors
5871
{
@@ -66,10 +79,26 @@ Cura.RoundedRectangle
6679
}
6780
}
6881

82+
Label
83+
{
84+
visible: preSlicedData
85+
anchors.top: parent.top
86+
anchors.topMargin: UM.Theme.getSize("thick_margin").height
87+
anchors.left: parent.left
88+
anchors.leftMargin: UM.Theme.getSize("thick_margin").height
89+
width: parent.width
90+
font: UM.Theme.getFont("medium_bold")
91+
color: UM.Theme.getColor("text")
92+
renderType: Text.NativeRendering
93+
94+
text: catalog.i18nc("@label shown when we load a Gcode file", "Print setup disabled. G-code file can not be modified.")
95+
}
96+
6997
MouseArea
7098
{
7199
id: mouseArea
72100
hoverEnabled: true
101+
enabled: !preSlicedData
73102
anchors.fill: parent
74103

75104
onClicked:

resources/qml/SidebarContents.qml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ Cura.RoundedRectangle
1919

2020
width: UM.Theme.getSize("print_setup_widget").width
2121

22-
property bool preSlicedData: PrintInformation !== null && PrintInformation.preSliced
23-
2422
Column
2523
{
2624
id: settingsHeader
@@ -29,8 +27,6 @@ Cura.RoundedRectangle
2927
anchors.top: parent.top
3028
anchors.topMargin: UM.Theme.getSize("default_margin").height
3129

32-
visible: !preSlicedData
33-
3430
Loader
3531
{
3632
width: parent.width
@@ -167,7 +163,6 @@ Cura.RoundedRectangle
167163
Item
168164
{
169165
id: settingsViewContainer
170-
visible: !preSlicedData
171166
children: [ printSetupSelector.contentItem ]
172167
anchors
173168
{
@@ -183,19 +178,4 @@ Cura.RoundedRectangle
183178
printSetupSelector.contentItem.parent = printSetupSelector;
184179
}
185180
}
186-
187-
Label
188-
{
189-
visible: preSlicedData
190-
anchors.top: parent.top
191-
anchors.topMargin: UM.Theme.getSize("thick_margin").height
192-
anchors.left: parent.left
193-
anchors.leftMargin: UM.Theme.getSize("thick_margin").height
194-
width: parent.width
195-
font: UM.Theme.getFont("medium_bold")
196-
color: UM.Theme.getColor("text")
197-
renderType: Text.NativeRendering
198-
199-
text: catalog.i18nc("@label shown when we load a Gcode file", "Print setup disabled. G-code file can not be modified.")
200-
}
201181
}

resources/qml/SidebarStageMenu.qml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ Item
2121
property bool isLE44
2222
property bool isLE46
2323

24-
property bool sidebarVisible: UM.Preferences.getValue("view/settings_visible")
24+
property bool preSlicedData: PrintInformation !== null && PrintInformation.preSliced
25+
property bool sidebarVisible: UM.Preferences.getValue("view/settings_visible") && !preSlicedData
2526
property real sidebarWidth: sidebarVisible ? printSetupSelector.width : 0
2627

2728
Component.onCompleted:
@@ -147,12 +148,18 @@ Item
147148
{
148149
if (preference == "view/settings_visible")
149150
{
150-
sidebarVisible = UM.Preferences.getValue("view/settings_visible")
151+
sidebarVisible = UM.Preferences.getValue("view/settings_visible") && !preSlicedData
151152
base.onWidthChanged(base.width)
152153
}
153154
}
154155
}
155156

157+
onPreSlicedDataChanged:
158+
{
159+
sidebarVisible = UM.Preferences.getValue("view/settings_visible") && !preSlicedData
160+
base.onWidthChanged(base.width)
161+
}
162+
156163
OpenFileButton {}
157164

158165
Cura.MachineSelector

0 commit comments

Comments
 (0)