mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-27 12:51:07 -07:00
Add a selector for the intent profile
CURA-6534
This commit is contained in:
parent
2d8c19203e
commit
35ec70a3cf
5 changed files with 95 additions and 4 deletions
44
resources/qml/Menus/IntentMenu.qml
Normal file
44
resources/qml/Menus/IntentMenu.qml
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
// Copyright (c) 2019 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 1.4
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.6 as Cura
|
||||
|
||||
Menu
|
||||
{
|
||||
id: menu
|
||||
title: "Intent"
|
||||
|
||||
property int extruderIndex: 0
|
||||
|
||||
Cura.IntentModel
|
||||
{
|
||||
id: intentModel
|
||||
}
|
||||
|
||||
Instantiator
|
||||
{
|
||||
model: intentModel
|
||||
|
||||
MenuItem
|
||||
{
|
||||
text: model.name
|
||||
checkable: true
|
||||
checked: false
|
||||
Binding on checked
|
||||
{
|
||||
when: Cura.MachineManager.activeStack != null
|
||||
value: Cura.MachineManager.activeStack.intent == model.container
|
||||
}
|
||||
exclusiveGroup: group
|
||||
onTriggered: Cura.MachineManager.activeStack.intent = model.container
|
||||
}
|
||||
|
||||
onObjectAdded: menu.insertItem(index, object)
|
||||
onObjectRemoved: menu.removeItem(object)
|
||||
}
|
||||
ExclusiveGroup { id: group }
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
import QtQuick 2.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
|
||||
|
|
@ -24,12 +25,55 @@ Item
|
|||
anchors
|
||||
{
|
||||
top: parent.top
|
||||
topMargin: parent.padding
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
margins: parent.padding
|
||||
}
|
||||
}
|
||||
Item
|
||||
{
|
||||
id: intent
|
||||
height: childrenRect.height
|
||||
|
||||
anchors
|
||||
{
|
||||
top: globalProfileRow.bottom
|
||||
topMargin: UM.Theme.getSize("default_margin").height
|
||||
left: parent.left
|
||||
leftMargin: parent.padding
|
||||
right: parent.right
|
||||
rightMargin: parent.padding
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
id: intentLabel
|
||||
anchors
|
||||
{
|
||||
top: parent.top
|
||||
bottom: parent.bottom
|
||||
left: parent.left
|
||||
right: intentSelection.left
|
||||
}
|
||||
text: catalog.i18nc("@label", "Intent")
|
||||
font: UM.Theme.getFont("medium")
|
||||
color: UM.Theme.getColor("text")
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
OldControls.ToolButton
|
||||
{
|
||||
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
|
||||
anchors.right: parent.right
|
||||
style: UM.Theme.styles.print_setup_header_button
|
||||
activeFocusOnPress: true
|
||||
|
||||
menu: Cura.IntentMenu { extruderIndex: Cura.ExtruderManager.activeExtruderIndex }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
UM.TabRow
|
||||
|
|
@ -40,7 +84,7 @@ Item
|
|||
|
||||
anchors
|
||||
{
|
||||
top: globalProfileRow.bottom
|
||||
top: intent.bottom
|
||||
topMargin: UM.Theme.getSize("default_margin").height
|
||||
left: parent.left
|
||||
leftMargin: parent.padding
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue