Skip to content

Commit 78c5c3e

Browse files
committed
Disable XRay View when Paint Tool is active
1 parent 0441bb1 commit 78c5c3e

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

resources/qml/PrepareStageLegend50.qml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,22 @@ Cura.ExpandableComponent
3535
height: implicitHeight
3636
spacing: UM.Theme.getSize("layerview_row_spacing").height
3737

38+
property string activeView:
39+
{
40+
var viewString = UM.Controller.activeView + "";
41+
return viewString.substr(0, viewString.indexOf("("));
42+
}
43+
3844
onActiveViewChanged:
3945
{
4046
xrayViewCheckBox.checked = (activeView == "XRayView")
41-
xrayViewCheckBox.visible = (activeView != "FastView" && activeView != "SmartSliceView")
47+
xrayViewCheckBox.visible = ["PaintView", "FastView", "SmartSliceView"].indexOf(activeView) == -1
4248
switch(activeView)
4349
{
50+
case "PaintView":
51+
externalViewLabel.visible = true
52+
externalViewLabel.text = catalog.i18nc("@label", "Paint Tool")
53+
break;
4454
case "FastView":
4555
externalViewLabel.visible = true
4656
externalViewLabel.text = catalog.i18nc("@label", "Fast View")
@@ -55,17 +65,12 @@ Cura.ExpandableComponent
5565
}
5666
}
5767

58-
property string activeView:
59-
{
60-
var viewString = UM.Controller.activeView + "";
61-
return viewString.substr(0, viewString.indexOf("("));
62-
}
63-
6468
UM.CheckBox
6569
{
6670
id: xrayViewCheckBox
6771
checked: parent.activeView == "XRayView"
6872
visible: !externalViewLabel.visible
73+
enabled: visible
6974
onClicked:
7075
{
7176
if(checked && parent.activeView != "XRayView")
@@ -85,7 +90,7 @@ Cura.ExpandableComponent
8590
{
8691
id: externalViewLabel
8792

88-
height: UM.Theme.getSize("layerview_row").height
93+
height: visible ? UM.Theme.getSize("checkbox").height : 0
8994
width: parent.width
9095
color: UM.Theme.getColor("setting_control_text")
9196
}

0 commit comments

Comments
 (0)