Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime van Kessel <nallath@gmail.com>2019-08-06 11:49:42 +0300
committerJaime van Kessel <nallath@gmail.com>2019-08-29 12:53:25 +0300
commit92be2611783a8d391e216711e6b0c3892da1bd24 (patch)
treed2858b05a322005f2672e5cd89827a280442453c /resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml
parent7d65951f437f3e532eea573b59b2b7a5d37cd5c1 (diff)
Update the profile selector to new style for the intents
CURA-6598
Diffstat (limited to 'resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml')
-rw-r--r--resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml105
1 files changed, 83 insertions, 22 deletions
diff --git a/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml b/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml
index e6a35455f2..1af3444e67 100644
--- a/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml
+++ b/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml
@@ -6,7 +6,7 @@ import QtQuick.Controls 2.0
import QtQuick.Controls 1.1 as OldControls
import UM 1.3 as UM
-import Cura 1.0 as Cura
+import Cura 1.6 as Cura
Item
@@ -18,18 +18,6 @@ Item
property var extrudersModel: CuraApplication.getExtrudersModel()
- // Profile selector row
- GlobalProfileSelector
- {
- id: globalProfileRow
- anchors
- {
- top: parent.top
- left: parent.left
- right: parent.right
- margins: parent.padding
- }
- }
Item
{
id: intent
@@ -37,7 +25,7 @@ Item
anchors
{
- top: globalProfileRow.bottom
+ top: parent.top
topMargin: UM.Theme.getSize("default_margin").height
left: parent.left
leftMargin: parent.padding
@@ -60,20 +48,93 @@ Item
color: UM.Theme.getColor("text")
verticalAlignment: Text.AlignVCenter
}
- OldControls.ToolButton
+
+ Button
{
id: intentSelection
- text: Cura.MachineManager.activeStack != null ? Cura.MachineManager.activeStack.intent.name : ""
- tooltip: text
- height: UM.Theme.getSize("print_setup_big_item").height
- width: UM.Theme.getSize("print_setup_big_item").width
+ onClicked: menu.opened ? menu.close() : menu.open()
+ text: generateActiveQualityText()
+
anchors.right: parent.right
- style: UM.Theme.styles.print_setup_header_button
- activeFocusOnPress: true
+ width: UM.Theme.getSize("print_setup_big_item").width
+ height: textLabel.contentHeight + 2 * UM.Theme.getSize("narrow_margin").height
+
+ contentItem: Label
+ {
+ id: textLabel
+ text: intentSelection.text
+ anchors.left: parent.left
+ anchors.leftMargin: UM.Theme.getSize("default_margin").width
+ anchors.verticalCenter: intentSelection.verticalCenter
+ height: contentHeight
+ verticalAlignment: Text.AlignVCenter
+ }
- menu: Cura.IntentMenu { extruderIndex: Cura.ExtruderManager.activeExtruderIndex }
+ background: Rectangle
+ {
+ border.color: UM.Theme.getColor("lining")
+ border.width: UM.Theme.getSize("default_lining").width
+ radius: UM.Theme.getSize("default_radius").width
+ }
+
+ function generateActiveQualityText()
+ {
+ var result = Cura.MachineManager.activeQualityOrQualityChangesName
+ if (Cura.MachineManager.isActiveQualityExperimental)
+ {
+ result += " (Experimental)"
+ }
+
+ if (Cura.MachineManager.isActiveQualitySupported)
+ {
+ if (Cura.MachineManager.activeQualityLayerHeight > 0)
+ {
+ result += " <font color=\"" + UM.Theme.getColor("text_detail") + "\">"
+ result += " - "
+ result += Cura.MachineManager.activeQualityLayerHeight + "mm"
+ result += "</font>"
+ }
+ }
+
+ return result
+ }
+
+ UM.SimpleButton
+ {
+ id: customisedSettings
+
+ visible: Cura.MachineManager.hasUserSettings
+ width: UM.Theme.getSize("print_setup_icon").width
+ height: UM.Theme.getSize("print_setup_icon").height
+
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ anchors.rightMargin: UM.Theme.getSize("thick_margin").width
+
+ color: hovered ? UM.Theme.getColor("setting_control_button_hover") : UM.Theme.getColor("setting_control_button");
+ iconSource: UM.Theme.getIcon("star")
+
+ onClicked:
+ {
+ forceActiveFocus();
+ Cura.Actions.manageProfiles.trigger()
+ }
+ onEntered:
+ {
+ var content = catalog.i18nc("@tooltip", "Some setting/override values are different from the values stored in the profile.\n\nClick to open the profile manager.")
+ base.showTooltip(intent, Qt.point(-UM.Theme.getSize("default_margin").width, 0), content)
+ }
+ onExited: base.hideTooltip()
+ }
}
+ QualitiesWithIntentMenu
+ {
+ id: menu
+ y: intentSelection.y + intentSelection.height
+ x: intentSelection.x
+ width: intentSelection.width
+ }
}
UM.TabRow