|
@@ -4,6 +4,7 @@
|
|
|
import QtQuick 2.10
|
|
|
import QtQuick.Controls 2.3
|
|
|
import QtQuick.Controls 1.4 as OldControls
|
|
|
+import QtQuick.Layouts 1.3
|
|
|
|
|
|
import UM 1.3 as UM
|
|
|
import Cura 1.6 as Cura
|
|
@@ -66,7 +67,6 @@ Item
|
|
|
{
|
|
|
id: intentSelection
|
|
|
onClicked: menu.opened ? menu.close() : menu.open()
|
|
|
- text: generateActiveQualityText()
|
|
|
|
|
|
anchors.right: parent.right
|
|
|
width: UM.Theme.getSize("print_setup_big_item").width
|
|
@@ -75,62 +75,76 @@ Item
|
|
|
|
|
|
baselineOffset: null // If we don't do this, there is a binding loop. WHich is a bit weird, since we override the contentItem anyway...
|
|
|
|
|
|
- contentItem: Label
|
|
|
+ contentItem: RowLayout
|
|
|
{
|
|
|
- id: textLabel
|
|
|
- text: intentSelection.text
|
|
|
- font: UM.Theme.getFont("default")
|
|
|
- color: UM.Theme.getColor("text")
|
|
|
+ spacing: 0
|
|
|
anchors.left: parent.left
|
|
|
+ anchors.right: customisedSettings.left
|
|
|
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
|
|
- anchors.verticalCenter: intentSelection.verticalCenter
|
|
|
- height: contentHeight
|
|
|
- verticalAlignment: Text.AlignVCenter
|
|
|
- renderType: Text.NativeRendering
|
|
|
- }
|
|
|
-
|
|
|
- background: Rectangle
|
|
|
- {
|
|
|
- id: backgroundItem
|
|
|
- border.color: intentSelection.hovered ? UM.Theme.getColor("setting_control_border_highlight") : UM.Theme.getColor("setting_control_border")
|
|
|
- border.width: UM.Theme.getSize("default_lining").width
|
|
|
- radius: UM.Theme.getSize("default_radius").width
|
|
|
- color: UM.Theme.getColor("main_background")
|
|
|
- }
|
|
|
-
|
|
|
- function generateActiveQualityText()
|
|
|
- {
|
|
|
- var resultMap = Cura.MachineManager.activeQualityDisplayNameMap
|
|
|
- var resultMain = resultMap["main"]
|
|
|
- var resultSuffix = resultMap["suffix"]
|
|
|
- var result = ""
|
|
|
|
|
|
- if (Cura.MachineManager.isActiveQualityExperimental)
|
|
|
+ Label
|
|
|
{
|
|
|
- resultSuffix += " (Experimental)"
|
|
|
+ id: textLabel
|
|
|
+ text: Cura.MachineManager.activeQualityDisplayNameMap["main"]
|
|
|
+ font: UM.Theme.getFont("default")
|
|
|
+ color: UM.Theme.getColor("text")
|
|
|
+ Layout.margins: 0
|
|
|
+ Layout.maximumWidth: Math.floor(parent.width * 0.7) // Always leave >= 30% for the rest of the row.
|
|
|
+ height: contentHeight
|
|
|
+ verticalAlignment: Text.AlignVCenter
|
|
|
+ renderType: Text.NativeRendering
|
|
|
+ elide: Text.ElideRight
|
|
|
}
|
|
|
|
|
|
- if (Cura.MachineManager.isActiveQualitySupported)
|
|
|
+ Label
|
|
|
{
|
|
|
- if (Cura.MachineManager.activeQualityLayerHeight > 0)
|
|
|
+ text: activeQualityDetailText()
|
|
|
+ font: UM.Theme.getFont("default")
|
|
|
+ color: UM.Theme.getColor("text_detail")
|
|
|
+ Layout.margins: 0
|
|
|
+ Layout.fillWidth: true
|
|
|
+
|
|
|
+ height: contentHeight
|
|
|
+ verticalAlignment: Text.AlignVCenter
|
|
|
+ renderType: Text.NativeRendering
|
|
|
+ elide: Text.ElideRight
|
|
|
+
|
|
|
+ function activeQualityDetailText()
|
|
|
{
|
|
|
- result = resultMain
|
|
|
- if (resultSuffix)
|
|
|
+ var resultMap = Cura.MachineManager.activeQualityDisplayNameMap
|
|
|
+ var resultSuffix = resultMap["suffix"]
|
|
|
+ var result = ""
|
|
|
+
|
|
|
+ if (Cura.MachineManager.isActiveQualityExperimental)
|
|
|
{
|
|
|
- result += " - "
|
|
|
+ resultSuffix += " (Experimental)"
|
|
|
}
|
|
|
- result += "<font color=\"" + UM.Theme.getColor("text_detail") + "\">"
|
|
|
- if (resultSuffix)
|
|
|
+
|
|
|
+ if (Cura.MachineManager.isActiveQualitySupported)
|
|
|
{
|
|
|
- result += resultSuffix
|
|
|
+ if (Cura.MachineManager.activeQualityLayerHeight > 0)
|
|
|
+ {
|
|
|
+ if (resultSuffix)
|
|
|
+ {
|
|
|
+ result += " - " + resultSuffix
|
|
|
+ }
|
|
|
+ result += " - "
|
|
|
+ result += Cura.MachineManager.activeQualityLayerHeight + "mm"
|
|
|
+ }
|
|
|
}
|
|
|
- result += " - "
|
|
|
- result += Cura.MachineManager.activeQualityLayerHeight + "mm"
|
|
|
- result += "</font>"
|
|
|
+
|
|
|
+ return result
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- return result
|
|
|
+ background: Rectangle
|
|
|
+ {
|
|
|
+ id: backgroundItem
|
|
|
+ border.color: intentSelection.hovered ? UM.Theme.getColor("setting_control_border_highlight") : UM.Theme.getColor("setting_control_border")
|
|
|
+ border.width: UM.Theme.getSize("default_lining").width
|
|
|
+ radius: UM.Theme.getSize("default_radius").width
|
|
|
+ color: UM.Theme.getColor("main_background")
|
|
|
}
|
|
|
|
|
|
UM.SimpleButton
|
|
@@ -164,7 +178,6 @@ Item
|
|
|
{
|
|
|
id: downArrow
|
|
|
|
|
|
-
|
|
|
source: UM.Theme.getIcon("arrow_bottom")
|
|
|
width: UM.Theme.getSize("standard_arrow").width
|
|
|
height: UM.Theme.getSize("standard_arrow").height
|