mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-06 05:23:58 -06:00
Merge branch 'master'
CURA-4213
This commit is contained in:
commit
63e75ec6b7
11 changed files with 288 additions and 278 deletions
|
@ -16,7 +16,7 @@ Button
|
|||
text: catalog.i18ncp("@label %1 is filled in with the name of an extruder", "Print Selected Model with %1", "Print Selected Models with %1", UM.Selection.selectionCount).arg(extruder.name)
|
||||
|
||||
style: UM.Theme.styles.tool_button;
|
||||
iconSource: checked ? UM.Theme.getIcon("material_selected") : UM.Theme.getIcon("material_not_selected");
|
||||
iconSource: UM.Theme.getIcon("extruder_button")
|
||||
|
||||
checked: ExtruderManager.selectedObjectExtruders.indexOf(extruder.id) != -1
|
||||
enabled: UM.Selection.hasSelection
|
||||
|
@ -36,12 +36,7 @@ Button
|
|||
|
||||
Item
|
||||
{
|
||||
anchors
|
||||
{
|
||||
right: parent.right;
|
||||
top: parent.top;
|
||||
margins: UM.Theme.getSize("default_lining").width * 3
|
||||
}
|
||||
anchors.centerIn: parent
|
||||
width: UM.Theme.getSize("default_margin").width
|
||||
height: UM.Theme.getSize("default_margin").height
|
||||
|
||||
|
@ -54,22 +49,27 @@ Button
|
|||
}
|
||||
}
|
||||
|
||||
// Material colour circle
|
||||
// Only draw the filling colour of the material inside the SVG border.
|
||||
Rectangle
|
||||
{
|
||||
anchors
|
||||
{
|
||||
left: parent.left;
|
||||
top: parent.top;
|
||||
margins: UM.Theme.getSize("default_lining").width * 3
|
||||
right: parent.right
|
||||
top: parent.top
|
||||
margins: UM.Theme.getSize("extruder_button_material_margin").width
|
||||
}
|
||||
|
||||
color: model.color
|
||||
|
||||
width: UM.Theme.getSize("default_margin").width
|
||||
height: UM.Theme.getSize("default_margin").height
|
||||
width: UM.Theme.getSize("extruder_button_material_size").width
|
||||
height: UM.Theme.getSize("extruder_button_material_size").height
|
||||
radius: width / 2
|
||||
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: UM.Theme.getColor("lining");
|
||||
border.width: 0
|
||||
border.color: "transparent"
|
||||
|
||||
opacity: !base.enabled ? 0.2 : 1.0
|
||||
}
|
||||
|
||||
onClicked:
|
||||
|
|
|
@ -97,36 +97,36 @@ SettingItem
|
|||
}
|
||||
label: Item
|
||||
{
|
||||
Label
|
||||
{
|
||||
id: extruderText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
text: control.currentText
|
||||
font: UM.Theme.getFont("default")
|
||||
color: enabled ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
|
||||
|
||||
elide: Text.ElideLeft
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
Rectangle
|
||||
{
|
||||
id: swatch
|
||||
height: UM.Theme.getSize("setting_control").height / 2
|
||||
width: height
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: enabled ? UM.Theme.getColor("setting_control_border") : UM.Theme.getColor("setting_control_disabled_border")
|
||||
|
||||
color: control.color
|
||||
}
|
||||
Label
|
||||
{
|
||||
anchors
|
||||
{
|
||||
left: swatch.right;
|
||||
right: arrow.left;
|
||||
right: arrow.left
|
||||
verticalCenter: parent.verticalCenter
|
||||
margins: UM.Theme.getSize("default_lining").width
|
||||
margins: UM.Theme.getSize("default_margin").width / 4
|
||||
}
|
||||
width: parent.width - swatch.width;
|
||||
|
||||
text: control.currentText
|
||||
font: UM.Theme.getFont("default")
|
||||
color: enabled ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
|
||||
border.width: UM.Theme.getSize("default_lining").width * 2
|
||||
border.color: enabled ? UM.Theme.getColor("setting_control_border") : UM.Theme.getColor("setting_control_disabled_border")
|
||||
radius: width / 2
|
||||
|
||||
elide: Text.ElideRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
color: control.color
|
||||
}
|
||||
UM.RecolorImage
|
||||
{
|
||||
|
|
|
@ -116,29 +116,10 @@ SettingItem
|
|||
}
|
||||
label: Item
|
||||
{
|
||||
Rectangle
|
||||
{
|
||||
id: swatch
|
||||
height: UM.Theme.getSize("setting_control").height / 2
|
||||
width: height
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: enabled ? UM.Theme.getColor("setting_control_border") : UM.Theme.getColor("setting_control_disabled_border")
|
||||
|
||||
color: control.color
|
||||
}
|
||||
Label
|
||||
{
|
||||
anchors
|
||||
{
|
||||
left: swatch.right;
|
||||
right: arrow.left;
|
||||
verticalCenter: parent.verticalCenter
|
||||
margins: UM.Theme.getSize("default_lining").width
|
||||
}
|
||||
width: parent.width - swatch.width;
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: parent.width - swatch.width - arrow.width;
|
||||
|
||||
text: control.currentText
|
||||
font: UM.Theme.getFont("default")
|
||||
|
@ -147,6 +128,25 @@ SettingItem
|
|||
elide: Text.ElideRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
Rectangle
|
||||
{
|
||||
id: swatch
|
||||
height: UM.Theme.getSize("setting_control").height / 2
|
||||
width: height
|
||||
|
||||
anchors
|
||||
{
|
||||
right: arrow.left;
|
||||
verticalCenter: parent.verticalCenter
|
||||
margins: UM.Theme.getSize("default_margin").width / 4
|
||||
}
|
||||
|
||||
border.width: UM.Theme.getSize("default_lining").width * 2
|
||||
border.color: enabled ? UM.Theme.getColor("setting_control_border") : UM.Theme.getColor("setting_control_disabled_border")
|
||||
radius: width / 2
|
||||
|
||||
color: control.color
|
||||
}
|
||||
UM.RecolorImage
|
||||
{
|
||||
id: arrow
|
||||
|
|
|
@ -22,6 +22,30 @@ Column
|
|||
signal showTooltip(Item item, point location, string text)
|
||||
signal hideTooltip()
|
||||
|
||||
Item
|
||||
{
|
||||
height: UM.Theme.getSize("default_margin").height / 4
|
||||
width: height
|
||||
visible: extruderSelectionRow.visible
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
id: extruderSelectionLabel
|
||||
anchors
|
||||
{
|
||||
left: parent.left
|
||||
leftMargin: UM.Theme.getSize("default_margin").width
|
||||
right: parent.right
|
||||
rightMargin: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
height: UM.Theme.getSize("sidebar_tabs").height / 3
|
||||
text: catalog.i18nc("@label", "Extruder configuration")
|
||||
font: UM.Theme.getFont("default_bold")
|
||||
color: UM.Theme.getColor("text")
|
||||
visible: extruderSelectionRow.visible
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
id: extruderSelectionRow
|
||||
|
@ -29,16 +53,12 @@ Column
|
|||
height: UM.Theme.getSize("sidebar_tabs").height
|
||||
visible: machineExtruderCount.properties.value > 1 && !sidebar.monitoringPrint
|
||||
|
||||
Rectangle
|
||||
anchors
|
||||
{
|
||||
id: extruderSeparator
|
||||
visible: machineExtruderCount.properties.value > 1 && !sidebar.monitoringPrint
|
||||
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
color: UM.Theme.getColor("sidebar_lining")
|
||||
|
||||
anchors.top: extruderSelectionRow.top
|
||||
left: parent.left
|
||||
leftMargin: UM.Theme.getSize("default_margin").width
|
||||
right: parent.right
|
||||
rightMargin: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
|
||||
ListView
|
||||
|
@ -53,8 +73,10 @@ Column
|
|||
anchors
|
||||
{
|
||||
left: parent.left
|
||||
leftMargin: UM.Theme.getSize("default_margin").width / 2
|
||||
right: parent.right
|
||||
bottom: extruderSelectionRow.bottom
|
||||
rightMargin: UM.Theme.getSize("default_margin").width / 2
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
ExclusiveGroup { id: extruderMenuGroup; }
|
||||
|
@ -92,61 +114,116 @@ Column
|
|||
|
||||
style: ButtonStyle
|
||||
{
|
||||
background: Rectangle
|
||||
background: Item
|
||||
{
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: control.checked ? UM.Theme.getColor("tab_checked_border") :
|
||||
control.pressed ? UM.Theme.getColor("tab_active_border") :
|
||||
control.hovered ? UM.Theme.getColor("tab_hovered_border") : UM.Theme.getColor("tab_unchecked_border")
|
||||
color: control.checked ? UM.Theme.getColor("tab_checked") :
|
||||
control.pressed ? UM.Theme.getColor("tab_active") :
|
||||
control.hovered ? UM.Theme.getColor("tab_hovered") : UM.Theme.getColor("tab_unchecked")
|
||||
Behavior on color { ColorAnimation { duration: 50; } }
|
||||
|
||||
Rectangle
|
||||
{
|
||||
id: highlight
|
||||
visible: control.checked
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
height: UM.Theme.getSize("sidebar_header_highlight").height
|
||||
color: UM.Theme.getColor("sidebar_header_bar")
|
||||
}
|
||||
|
||||
Rectangle
|
||||
{
|
||||
id: swatch
|
||||
visible: index > -1
|
||||
height: UM.Theme.getSize("setting_control").height / 2
|
||||
width: height
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: (parent.height - height) / 2
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
color: model.color
|
||||
anchors.fill: parent
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: UM.Theme.getColor("setting_control_border")
|
||||
border.color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active_border") :
|
||||
control.hovered ? UM.Theme.getColor("action_button_hovered_border") :
|
||||
UM.Theme.getColor("action_button_border")
|
||||
color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active") :
|
||||
control.hovered ? UM.Theme.getColor("action_button_hovered") :
|
||||
UM.Theme.getColor("action_button")
|
||||
Behavior on color { ColorAnimation { duration: 50; } }
|
||||
}
|
||||
|
||||
Text
|
||||
Item
|
||||
{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: swatch.visible ? swatch.right : parent.left
|
||||
anchors.leftMargin: swatch.visible ? UM.Theme.getSize("sidebar_margin").width / 2 : UM.Theme.getSize("sidebar_margin").width
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: UM.Theme.getSize("sidebar_margin").width / 2
|
||||
id: extruderButtonFace
|
||||
anchors.centerIn: parent
|
||||
width: {
|
||||
var extruderTextWidth = extruderStaticText.visible ? extruderStaticText.width : 0;
|
||||
var iconWidth = extruderIconItem.width;
|
||||
return extruderTextWidth + iconWidth + UM.Theme.getSize("default_margin").width / 4;
|
||||
}
|
||||
|
||||
color: control.checked ? UM.Theme.getColor("tab_checked_text") :
|
||||
control.pressed ? UM.Theme.getColor("tab_active_text") :
|
||||
control.hovered ? UM.Theme.getColor("tab_hovered_text") : UM.Theme.getColor("tab_unchecked_text")
|
||||
// Static text "Extruder"
|
||||
Text
|
||||
{
|
||||
id: extruderStaticText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
|
||||
font: UM.Theme.getFont("default")
|
||||
text: control.text
|
||||
elide: Text.ElideRight
|
||||
color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active_text") :
|
||||
control.hovered ? UM.Theme.getColor("action_button_hovered_text") :
|
||||
UM.Theme.getColor("action_button_text")
|
||||
|
||||
font: UM.Theme.getFont("default")
|
||||
text: catalog.i18nc("@label", "Extruder")
|
||||
visible: width < (control.width - extruderIconItem.width - UM.Theme.getSize("default_margin").width)
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
// Everthing for the extruder icon
|
||||
Item
|
||||
{
|
||||
id: extruderIconItem
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.right: parent.right
|
||||
|
||||
property var sizeToUse:
|
||||
{
|
||||
var minimumWidth = control.width < UM.Theme.getSize("button").width ? control.width : UM.Theme.getSize("button").width;
|
||||
var minimumHeight = control.height < UM.Theme.getSize("button").height ? control.height : UM.Theme.getSize("button").height;
|
||||
var minimumSize = minimumWidth < minimumHeight ? minimumWidth : minimumHeight;
|
||||
minimumSize -= UM.Theme.getSize("default_margin").width;
|
||||
return minimumSize;
|
||||
}
|
||||
|
||||
width: sizeToUse
|
||||
height: sizeToUse
|
||||
|
||||
UM.RecolorImage {
|
||||
id: mainCircle
|
||||
anchors.fill: parent
|
||||
|
||||
sourceSize.width: parent.width
|
||||
sourceSize.height: parent.width
|
||||
source: UM.Theme.getIcon("extruder_button")
|
||||
|
||||
color: extruderNumberText.color
|
||||
}
|
||||
|
||||
Text
|
||||
{
|
||||
id: extruderNumberText
|
||||
anchors.centerIn: parent
|
||||
text: index + 1;
|
||||
color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active_text") :
|
||||
control.hovered ? UM.Theme.getColor("action_button_hovered_text") :
|
||||
UM.Theme.getColor("action_button_text")
|
||||
font: UM.Theme.getFont("default_bold")
|
||||
}
|
||||
|
||||
// Material colour circle
|
||||
// Only draw the filling colour of the material inside the SVG border.
|
||||
Rectangle
|
||||
{
|
||||
anchors
|
||||
{
|
||||
right: parent.right
|
||||
top: parent.top
|
||||
rightMargin: parent.sizeToUse * 0.04
|
||||
topMargin: parent.sizeToUse * 0.04
|
||||
}
|
||||
|
||||
color: model.color
|
||||
|
||||
width: parent.width * 0.27
|
||||
height: parent.height * 0.27
|
||||
radius: width / 2
|
||||
|
||||
border.width: 0
|
||||
border.color: "transparent"
|
||||
|
||||
opacity: !control.checked ? 0.6 : 1.0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
label: Item { }
|
||||
label: Item {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue