mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-20 21:27:50 -06:00
Add the row for the support selection in the recommended mode
Contributes to CURA-5941.
This commit is contained in:
parent
1caccfb577
commit
1cea36b08a
4 changed files with 134 additions and 95 deletions
|
@ -57,13 +57,13 @@ Item
|
|||
// TODO Create a reusable component with these properties to not define them separately for each component
|
||||
labelColumnWidth: parent.firstColumnWidth
|
||||
}
|
||||
//
|
||||
// RecommendedSupportSelector
|
||||
// {
|
||||
// width: parent.width
|
||||
// // TODO Create a reusable component with these properties to not define them separately for each component
|
||||
// property real firstColumnWidth: parent.labelColumnWidth
|
||||
// }
|
||||
|
||||
RecommendedSupportSelector
|
||||
{
|
||||
width: parent.width
|
||||
// TODO Create a reusable component with these properties to not define them separately for each component
|
||||
labelColumnWidth: parent.firstColumnWidth
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
|
@ -128,7 +128,6 @@ Item
|
|||
// }
|
||||
}
|
||||
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
{
|
||||
id: platformAdhesionType
|
||||
|
|
|
@ -8,114 +8,142 @@ import QtQuick.Controls.Styles 1.4
|
|||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
|
||||
//
|
||||
// Enable support
|
||||
//
|
||||
Row
|
||||
Item
|
||||
{
|
||||
id: enableSupportRow
|
||||
height: childrenRect.height
|
||||
|
||||
property real labelColumnWidth: Math.round(width / 3)
|
||||
|
||||
Cura.IconWithText
|
||||
{
|
||||
id: enableSupportLabel
|
||||
id: enableSupportRowTitle
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
visible: enableSupportCheckBox.visible
|
||||
source: UM.Theme.getIcon("category_support")
|
||||
text: catalog.i18nc("@label", "Support")
|
||||
width: labelColumnWidth
|
||||
}
|
||||
|
||||
CheckBox
|
||||
Item
|
||||
{
|
||||
id: enableSupportCheckBox
|
||||
property alias _hovered: enableSupportMouseArea.containsMouse
|
||||
id: enableSupportContainer
|
||||
height: childrenRect.height
|
||||
|
||||
style: UM.Theme.styles.checkbox
|
||||
enabled: base.settingsEnabled
|
||||
|
||||
visible: supportEnabled.properties.enabled == "True"
|
||||
checked: supportEnabled.properties.value == "True"
|
||||
|
||||
MouseArea
|
||||
anchors
|
||||
{
|
||||
id: enableSupportMouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked: supportEnabled.setPropertyValue("value", supportEnabled.properties.value != "True")
|
||||
|
||||
onEntered: base.showTooltip(enableSupportCheckBox, Qt.point(-enableSupportCheckBox.x, 0),
|
||||
catalog.i18nc("@label", "Generate structures to support parts of the model which have overhangs. Without these structures, such parts would collapse during printing."))
|
||||
|
||||
onExited: base.hideTooltip()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
ComboBox
|
||||
{
|
||||
id: supportExtruderCombobox
|
||||
visible: enableSupportCheckBox.visible && (supportEnabled.properties.value == "True") && (extrudersEnabledCount.properties.value > 1)
|
||||
model: extruderModel
|
||||
|
||||
property string color_override: "" // for manually setting values
|
||||
property string color: // is evaluated automatically, but the first time is before extruderModel being filled
|
||||
{
|
||||
var current_extruder = extruderModel.get(currentIndex);
|
||||
color_override = "";
|
||||
if (current_extruder === undefined) return ""
|
||||
return (current_extruder.color) ? current_extruder.color : "";
|
||||
left: enableSupportRowTitle.right
|
||||
right: parent.right
|
||||
verticalCenter: enableSupportRowTitle.verticalCenter
|
||||
}
|
||||
|
||||
textRole: "text" // this solves that the combobox isn't populated in the first time Cura is started
|
||||
|
||||
width: Math.round(UM.Theme.getSize("print_setup_widget").width * .55) - Math.round(UM.Theme.getSize("thick_margin").width / 2) - enableSupportCheckBox.width
|
||||
height: ((supportEnabled.properties.value == "True") && (machineExtruderCount.properties.value > 1)) ? UM.Theme.getSize("setting_control").height : 0
|
||||
|
||||
Behavior on height { NumberAnimation { duration: 100 } }
|
||||
|
||||
style: UM.Theme.styles.combobox_color
|
||||
enabled: base.settingsEnabled
|
||||
property alias _hovered: supportExtruderMouseArea.containsMouse
|
||||
|
||||
currentIndex:
|
||||
CheckBox
|
||||
{
|
||||
if (supportExtruderNr.properties == null)
|
||||
id: enableSupportCheckBox
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
property alias _hovered: enableSupportMouseArea.containsMouse
|
||||
|
||||
style: UM.Theme.styles.checkbox
|
||||
enabled: base.settingsEnabled
|
||||
|
||||
visible: supportEnabled.properties.enabled == "True"
|
||||
checked: supportEnabled.properties.value == "True"
|
||||
|
||||
MouseArea
|
||||
{
|
||||
return Cura.MachineManager.defaultExtruderPosition
|
||||
id: enableSupportMouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked: supportEnabled.setPropertyValue("value", supportEnabled.properties.value != "True")
|
||||
|
||||
onEntered:
|
||||
{
|
||||
base.showTooltip(enableSupportCheckBox, Qt.point(-enableSupportContainer.x - UM.Theme.getSize("thick_margin").width, 0),
|
||||
catalog.i18nc("@label", "Generate structures to support parts of the model which have overhangs. Without these structures, such parts would collapse during printing."))
|
||||
}
|
||||
onExited: base.hideTooltip()
|
||||
}
|
||||
else
|
||||
}
|
||||
|
||||
ComboBox
|
||||
{
|
||||
id: supportExtruderCombobox
|
||||
|
||||
height: UM.Theme.getSize("print_setup_support_extruder_selector").height
|
||||
anchors
|
||||
{
|
||||
var extruder = parseInt(supportExtruderNr.properties.value)
|
||||
if ( extruder === -1)
|
||||
left: enableSupportCheckBox.right
|
||||
right: parent.right
|
||||
leftMargin: UM.Theme.getSize("thick_margin").width
|
||||
rightMargin: UM.Theme.getSize("thick_margin").width
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
style: UM.Theme.styles.combobox_color
|
||||
enabled: base.settingsEnabled
|
||||
visible: enableSupportCheckBox.visible && (supportEnabled.properties.value == "True") && (extrudersEnabledCount.properties.value > 1)
|
||||
textRole: "text" // this solves that the combobox isn't populated in the first time Cura is started
|
||||
|
||||
model: extruderModel
|
||||
|
||||
property alias _hovered: supportExtruderMouseArea.containsMouse
|
||||
property string color_override: "" // for manually setting values
|
||||
property string color: // is evaluated automatically, but the first time is before extruderModel being filled
|
||||
{
|
||||
var current_extruder = extruderModel.get(currentIndex);
|
||||
color_override = "";
|
||||
if (current_extruder === undefined) return ""
|
||||
return (current_extruder.color) ? current_extruder.color : "";
|
||||
}
|
||||
|
||||
currentIndex:
|
||||
{
|
||||
if (supportExtruderNr.properties == null)
|
||||
{
|
||||
return Cura.MachineManager.defaultExtruderPosition
|
||||
}
|
||||
return extruder;
|
||||
else
|
||||
{
|
||||
var extruder = parseInt(supportExtruderNr.properties.value)
|
||||
if ( extruder === -1)
|
||||
{
|
||||
return Cura.MachineManager.defaultExtruderPosition
|
||||
}
|
||||
return extruder;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onActivated: supportExtruderNr.setPropertyValue("value", String(index))
|
||||
onActivated: supportExtruderNr.setPropertyValue("value", String(index))
|
||||
|
||||
MouseArea
|
||||
{
|
||||
id: supportExtruderMouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
enabled: base.settingsEnabled
|
||||
acceptedButtons: Qt.NoButton
|
||||
onEntered:
|
||||
MouseArea
|
||||
{
|
||||
base.showTooltip(supportExtruderCombobox, Qt.point(-supportExtruderCombobox.x, 0),
|
||||
catalog.i18nc("@label", "Select which extruder to use for support. This will build up supporting structures below the model to prevent the model from sagging or printing in mid air."));
|
||||
id: supportExtruderMouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
enabled: base.settingsEnabled
|
||||
acceptedButtons: Qt.NoButton
|
||||
onEntered:
|
||||
{
|
||||
base.showTooltip(supportExtruderCombobox, Qt.point(-enableSupportContainer.x - supportExtruderCombobox.x - UM.Theme.getSize("thick_margin").width, 0),
|
||||
catalog.i18nc("@label", "Select which extruder to use for support. This will build up supporting structures below the model to prevent the model from sagging or printing in mid air."));
|
||||
}
|
||||
onExited: base.hideTooltip()
|
||||
|
||||
}
|
||||
onExited: base.hideTooltip()
|
||||
|
||||
}
|
||||
|
||||
function updateCurrentColor()
|
||||
{
|
||||
var current_extruder = extruderModel.get(currentIndex)
|
||||
if (current_extruder !== undefined)
|
||||
function updateCurrentColor()
|
||||
{
|
||||
supportExtruderCombobox.color_override = current_extruder.color
|
||||
var current_extruder = extruderModel.get(currentIndex)
|
||||
if (current_extruder !== undefined)
|
||||
{
|
||||
supportExtruderCombobox.color_override = current_extruder.color
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -160,6 +188,15 @@ Row
|
|||
storeIndex: 0
|
||||
}
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
{
|
||||
id: machineExtruderCount
|
||||
containerStack: Cura.MachineManager.activeMachine
|
||||
key: "machine_extruder_count"
|
||||
watchedProperties: ["value"]
|
||||
storeIndex: 0
|
||||
}
|
||||
|
||||
function populateExtruderModel()
|
||||
{
|
||||
extruderModel.clear()
|
||||
|
|
|
@ -413,11 +413,11 @@ QtObject
|
|||
|
||||
border.width: Theme.getSize("default_lining").width;
|
||||
border.color: control.hovered ? Theme.getColor("setting_control_border_highlight") : Theme.getColor("setting_control_border");
|
||||
radius: UM.Theme.getSize("setting_control_radius").width
|
||||
}
|
||||
|
||||
label: Item
|
||||
{
|
||||
|
||||
Label
|
||||
{
|
||||
anchors.left: parent.left
|
||||
|
@ -465,11 +465,11 @@ QtObject
|
|||
color: !enabled ? UM.Theme.getColor("setting_control_disabled") : control._hovered ? UM.Theme.getColor("setting_control_highlight") : UM.Theme.getColor("setting_control")
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: !enabled ? UM.Theme.getColor("setting_control_disabled_border") : control._hovered ? UM.Theme.getColor("setting_control_border_highlight") : UM.Theme.getColor("setting_control_border")
|
||||
radius: UM.Theme.getSize("setting_control_radius").width
|
||||
}
|
||||
|
||||
label: Item
|
||||
{
|
||||
|
||||
Label
|
||||
{
|
||||
anchors.left: parent.left
|
||||
|
@ -486,7 +486,7 @@ QtObject
|
|||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
|
||||
Rectangle
|
||||
UM.RecolorImage
|
||||
{
|
||||
id: swatch
|
||||
height: Math.round(UM.Theme.getSize("setting_control").height / 2)
|
||||
|
@ -494,9 +494,9 @@ QtObject
|
|||
anchors.right: downArrow.left
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.margins: Math.round(UM.Theme.getSize("default_margin").width / 4)
|
||||
radius: Math.round(width / 2)
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: UM.Theme.getColor("lining")
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
source: UM.Theme.getIcon("extruder_button")
|
||||
color: (control.color_override !== "") ? control.color_override : control.color
|
||||
}
|
||||
|
||||
|
@ -575,7 +575,7 @@ QtObject
|
|||
color: (control.hovered || control._hovered) ? Theme.getColor("checkbox_hover") : Theme.getColor("checkbox");
|
||||
Behavior on color { ColorAnimation { duration: 50; } }
|
||||
|
||||
radius: control.exclusiveGroup ? Math.round(Theme.getSize("checkbox").width / 2) : 0
|
||||
radius: control.exclusiveGroup ? Math.round(Theme.getSize("checkbox").width / 2) : UM.Theme.getSize("checkbox_radius").width
|
||||
|
||||
border.width: Theme.getSize("default_lining").width;
|
||||
border.color: (control.hovered || control._hovered) ? Theme.getColor("checkbox_border_hover") : Theme.getColor("checkbox_border");
|
||||
|
@ -628,6 +628,7 @@ QtObject
|
|||
|
||||
border.width: Theme.getSize("default_lining").width;
|
||||
border.color: control.hovered ? Theme.getColor("setting_control_border_highlight") : Theme.getColor("setting_control_border");
|
||||
radius: UM.Theme.getSize("setting_control_radius").width
|
||||
|
||||
color: Theme.getColor("setting_validation_ok");
|
||||
|
||||
|
|
|
@ -206,11 +206,11 @@
|
|||
"setting_control": [255, 255, 255, 255],
|
||||
"setting_control_selected": [31, 36, 39, 255],
|
||||
"setting_control_highlight": [255, 255, 255, 255],
|
||||
"setting_control_border": [127, 127, 127, 255],
|
||||
"setting_control_border": [199, 199, 199, 255],
|
||||
"setting_control_border_highlight": [50, 130, 255, 255],
|
||||
"setting_control_text": [27, 27, 27, 255],
|
||||
"setting_control_depth_line": [127, 127, 127, 255],
|
||||
"setting_control_button": [127, 127, 127, 255],
|
||||
"setting_control_text": [35, 35, 35, 255],
|
||||
"setting_control_depth_line": [199, 199, 199, 255],
|
||||
"setting_control_button": [199, 199, 199, 255],
|
||||
"setting_control_button_hover": [70, 84, 113, 255],
|
||||
"setting_control_disabled": [245, 245, 245, 255],
|
||||
"setting_control_disabled_text": [127, 127, 127, 255],
|
||||
|
@ -377,6 +377,7 @@
|
|||
"print_setup_slider_groove": [0.16, 0.16],
|
||||
"print_setup_slider_handle": [1.0, 1.0],
|
||||
"print_setup_slider_tickmarks": [0.32, 0.32],
|
||||
"print_setup_support_extruder_selector": [18.2, 2.5],
|
||||
|
||||
"configuration_selector_mode_tabs": [0.0, 3.0],
|
||||
|
||||
|
@ -415,6 +416,7 @@
|
|||
|
||||
"setting": [25.0, 1.8],
|
||||
"setting_control": [10.0, 2.0],
|
||||
"setting_control_radius": [0.15, 0.15],
|
||||
"setting_control_depth_margin": [1.4, 0.0],
|
||||
"setting_preferences_button_margin": [4, 0.0],
|
||||
"setting_control_margin": [0.0, 0.0],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue