Merge pull request #11535 from Ultimaker/CURA-8688_qt6_cleanup

[CURA-8688] QT6 cleanup
This commit is contained in:
Remco Burema 2022-03-02 16:49:53 +01:00 committed by GitHub
commit 901dc55733
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
63 changed files with 1109 additions and 855 deletions

View file

@ -6,7 +6,7 @@ import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Window 2.2 import QtQuick.Window 2.2
import UM 1.1 as UM import UM 1.5 as UM
import Cura 1.1 as Cura import Cura 1.1 as Cura
UM.Dialog UM.Dialog
@ -19,9 +19,7 @@ UM.Dialog
width: minimumWidth width: minimumWidth
height: Math.max(dialogSummaryItem.height + 2 * buttonsItem.height, minimumHeight) // 2 * button height to also have some extra space around the button relative to the button size height: Math.max(dialogSummaryItem.height + 2 * buttonsItem.height, minimumHeight) // 2 * button height to also have some extra space around the button relative to the button size
property int comboboxHeight: 15 * screenScaleFactor property int comboboxHeight: UM.Theme.getSize("default_margin").height
property int spacerHeight: 10 * screenScaleFactor
property int doubleSpacerHeight: 20 * screenScaleFactor
onClosing: manager.notifyClosed() onClosing: manager.notifyClosed()
onVisibleChanged: onVisibleChanged:
@ -46,10 +44,6 @@ UM.Dialog
id: catalog id: catalog
name: "cura" name: "cura"
} }
SystemPalette
{
id: palette
}
ListModel ListModel
{ {
@ -68,45 +62,39 @@ UM.Dialog
{ {
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
spacing: 2 * screenScaleFactor spacing: UM.Theme.getSize("default_margin").height
Label
Column
{ {
id: titleLabel
text: catalog.i18nc("@action:title", "Summary - Cura Project")
font.pointSize: 18
}
Rectangle
{
id: separator
color: palette.text
width: parent.width width: parent.width
height: 1 height: cildrenRect.height
}
Item // Spacer UM.Label
{ {
height: doubleSpacerHeight id: titleLabel
width: height text: catalog.i18nc("@action:title", "Summary - Cura Project")
font: UM.Theme.getFont("large")
}
Rectangle
{
id: separator
color: UM.Theme.getColor("text")
width: parent.width
height: UM.Theme.getSize("default_lining").height
}
} }
Row Item
{ {
height: childrenRect.height
width: parent.width width: parent.width
Label height: childrenRect.height
{
text: catalog.i18nc("@action:label", "Printer settings")
font.bold: true
width: (parent.width / 3) | 0
}
Item
{
// spacer
height: spacerHeight
width: (parent.width / 3) | 0
}
UM.TooltipArea UM.TooltipArea
{ {
id: machineResolveStrategyTooltip id: machineResolveStrategyTooltip
anchors.top: parent.top
anchors.right: parent.right
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
height: visible ? comboboxHeight : 0 height: visible ? comboboxHeight : 0
visible: base.visible && machineResolveComboBox.model.count > 1 visible: base.visible && machineResolveComboBox.model.count > 1
@ -157,64 +145,65 @@ UM.Dialog
} }
} }
} }
}
Row Column
{
width: parent.width
height: childrenRect.height
Label
{ {
text: catalog.i18nc("@action:label", "Type") width: parent.width
width: (parent.width / 3) | 0 height: cildrenRect.height
}
Label UM.Label
{ {
text: manager.machineType id: printer_settings_label
width: (parent.width / 3) | 0 text: catalog.i18nc("@action:label", "Printer settings")
font: UM.Theme.getFont("default_bold")
}
Row
{
width: parent.width
height: childrenRect.height
UM.Label
{
text: catalog.i18nc("@action:label", "Type")
width: (parent.width / 3) | 0
}
UM.Label
{
text: manager.machineType
width: (parent.width / 3) | 0
}
}
Row
{
width: parent.width
height: childrenRect.height
UM.Label
{
text: catalog.i18nc("@action:label", manager.isPrinterGroup ? "Printer Group" : "Printer Name")
width: (parent.width / 3) | 0
}
UM.Label
{
text: manager.machineName
width: (parent.width / 3) | 0
wrapMode: Text.WordWrap
}
}
} }
} }
Row Item
{ {
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label
{
text: catalog.i18nc("@action:label", manager.isPrinterGroup ? "Printer Group" : "Printer Name")
width: (parent.width / 3) | 0
}
Label
{
text: manager.machineName
width: (parent.width / 3) | 0
wrapMode: Text.WordWrap
}
}
Item // Spacer
{
height: doubleSpacerHeight
width: height
}
Row
{
height: childrenRect.height
width: parent.width
Label
{
text: catalog.i18nc("@action:label", "Profile settings")
font.bold: true
width: (parent.width / 3) | 0
}
Item
{
// spacer
height: spacerHeight
width: (parent.width / 3) | 0
}
UM.TooltipArea UM.TooltipArea
{ {
id: qualityChangesResolveTooltip anchors.right: parent.right
anchors.top: parent.top
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
height: visible ? comboboxHeight : 0 height: visible ? comboboxHeight : 0
visible: manager.qualityChangesConflict visible: manager.qualityChangesConflict
@ -232,96 +221,105 @@ UM.Dialog
} }
} }
} }
Column
{
width: parent.width
height: cildrenRect.height
UM.Label
{
text: catalog.i18nc("@action:label", "Profile settings")
font: UM.Theme.getFont("default_bold")
}
Row
{
width: parent.width
height: childrenRect.height
UM.Label
{
text: catalog.i18nc("@action:label", "Name")
width: (parent.width / 3) | 0
}
UM.Label
{
text: manager.qualityName
width: (parent.width / 3) | 0
wrapMode: Text.WordWrap
}
}
Row
{
width: parent.width
height: childrenRect.height
UM.Label
{
text: catalog.i18nc("@action:label", "Intent")
width: (parent.width / 3) | 0
}
UM.Label
{
text: manager.intentName
width: (parent.width / 3) | 0
wrapMode: Text.WordWrap
}
}
Row
{
width: parent.width
height: childrenRect.height
UM.Label
{
text: catalog.i18nc("@action:label", "Not in profile")
visible: manager.numUserSettings != 0
width: (parent.width / 3) | 0
}
UM.Label
{
text: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", manager.numUserSettings).arg(manager.numUserSettings)
visible: manager.numUserSettings != 0
width: (parent.width / 3) | 0
}
}
Row
{
width: parent.width
height: childrenRect.height
UM.Label
{
text: catalog.i18nc("@action:label", "Derivative from")
visible: manager.numSettingsOverridenByQualityChanges != 0
width: (parent.width / 3) | 0
}
UM.Label
{
text: catalog.i18ncp("@action:label", "%1, %2 override", "%1, %2 overrides", manager.numSettingsOverridenByQualityChanges).arg(manager.qualityType).arg(manager.numSettingsOverridenByQualityChanges)
width: (parent.width / 3) | 0
visible: manager.numSettingsOverridenByQualityChanges != 0
wrapMode: Text.WordWrap
}
}
}
} }
Row
Item
{ {
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label
{
text: catalog.i18nc("@action:label", "Name")
width: (parent.width / 3) | 0
}
Label
{
text: manager.qualityName
width: (parent.width / 3) | 0
wrapMode: Text.WordWrap
}
}
Row
{
width: parent.width
height: childrenRect.height
Label
{
text: catalog.i18nc("@action:label", "Intent")
width: (parent.width / 3) | 0
}
Label
{
text: manager.intentName
width: (parent.width / 3) | 0
wrapMode: Text.WordWrap
}
}
Row
{
width: parent.width
height: manager.numUserSettings != 0 ? childrenRect.height : 0
Label
{
text: catalog.i18nc("@action:label", "Not in profile")
width: (parent.width / 3) | 0
}
Label
{
text: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", manager.numUserSettings).arg(manager.numUserSettings)
width: (parent.width / 3) | 0
}
visible: manager.numUserSettings != 0
}
Row
{
width: parent.width
height: manager.numSettingsOverridenByQualityChanges != 0 ? childrenRect.height : 0
Label
{
text: catalog.i18nc("@action:label", "Derivative from")
width: (parent.width / 3) | 0
}
Label
{
text: catalog.i18ncp("@action:label", "%1, %2 override", "%1, %2 overrides", manager.numSettingsOverridenByQualityChanges).arg(manager.qualityType).arg(manager.numSettingsOverridenByQualityChanges)
width: (parent.width / 3) | 0
wrapMode: Text.WordWrap
}
visible: manager.numSettingsOverridenByQualityChanges != 0
}
Item // Spacer
{
height: doubleSpacerHeight
width: height
}
Row
{
height: childrenRect.height
width: parent.width
Label
{
text: catalog.i18nc("@action:label", "Material settings")
font.bold: true
width: (parent.width / 3) | 0
}
Item
{
// spacer
height: spacerHeight
width: (parent.width / 3) | 0
}
UM.TooltipArea UM.TooltipArea
{ {
id: materialResolveTooltip id: materialResolveTooltip
anchors.right: parent.right
anchors.top: parent.top
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
height: visible ? comboboxHeight : 0 height: visible ? comboboxHeight : 0
visible: manager.materialConflict visible: manager.materialConflict
@ -339,76 +337,91 @@ UM.Dialog
} }
} }
} }
Column
{
width: parent.width
height: cildrenRect.height
Row
{
height: childrenRect.height
width: parent.width
spacing: UM.Theme.getSize("narrow_margin").width
UM.Label
{
text: catalog.i18nc("@action:label", "Material settings")
font: UM.Theme.getFont("default_bold")
width: (parent.width / 3) | 0
}
}
Repeater
{
model: manager.materialLabels
delegate: Row
{
width: parent.width
height: childrenRect.height
UM.Label
{
text: catalog.i18nc("@action:label", "Name")
width: (parent.width / 3) | 0
}
UM.Label
{
text: modelData
width: (parent.width / 3) | 0
wrapMode: Text.WordWrap
}
}
}
}
} }
Repeater Column
{ {
model: manager.materialLabels width: parent.width
delegate: Row height: cildrenRect.height
UM.Label
{
text: catalog.i18nc("@action:label", "Setting visibility")
font: UM.Theme.getFont("default_bold")
}
Row
{ {
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label UM.Label
{ {
text: catalog.i18nc("@action:label", "Name") text: catalog.i18nc("@action:label", "Mode")
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
} }
Label UM.Label
{ {
text: modelData text: manager.activeMode
width: (parent.width / 3) | 0
}
}
Row
{
width: parent.width
height: childrenRect.height
visible: manager.hasVisibleSettingsField
UM.Label
{
text: catalog.i18nc("@action:label", "Visible settings:")
width: (parent.width / 3) | 0
}
UM.Label
{
text: catalog.i18nc("@action:label", "%1 out of %2" ).arg(manager.numVisibleSettings).arg(manager.totalNumberOfSettings)
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
wrapMode: Text.WordWrap
} }
} }
} }
Item // Spacer
{
height: doubleSpacerHeight
width: height
}
Label
{
text: catalog.i18nc("@action:label", "Setting visibility")
font.bold: true
}
Row
{
width: parent.width
height: childrenRect.height
Label
{
text: catalog.i18nc("@action:label", "Mode")
width: (parent.width / 3) | 0
}
Label
{
text: manager.activeMode
width: (parent.width / 3) | 0
}
}
Row
{
width: parent.width
height: childrenRect.height
visible: manager.hasVisibleSettingsField
Label
{
text: catalog.i18nc("@action:label", "Visible settings:")
width: (parent.width / 3) | 0
}
Label
{
text: catalog.i18nc("@action:label", "%1 out of %2" ).arg(manager.numVisibleSettings).arg(manager.totalNumberOfSettings)
width: (parent.width / 3) | 0
}
}
Item // Spacer
{
height: spacerHeight
width: height
}
Row Row
{ {
width: parent.width width: parent.width
@ -418,12 +431,10 @@ UM.Dialog
{ {
width: warningLabel.height width: warningLabel.height
height: width height: width
source: UM.Theme.getIcon("Information") source: UM.Theme.getIcon("Information")
color: palette.text color: UM.Theme.getColor("text")
} }
Label UM.Label
{ {
id: warningLabel id: warningLabel
text: catalog.i18nc("@action:warning", "Loading a project will clear all models on the build plate.") text: catalog.i18nc("@action:warning", "Loading a project will clear all models on the build plate.")
@ -432,44 +443,22 @@ UM.Dialog
} }
} }
} }
Item
{ buttonSpacing: UM.Theme.getSize("default_margin").width
id: buttonsItem
width: parent.width rightButtons: [
height: childrenRect.height Cura.TertiaryButton
anchors.bottom: parent.bottom
anchors.right: parent.right
Button
{ {
id: cancel_button text: catalog.i18nc("@action:button", "Cancel")
text: catalog.i18nc("@action:button","Cancel"); onClicked: reject()
onClicked: { manager.onCancelButtonClicked() } },
enabled: true Cura.PrimaryButton
anchors.bottom: parent.bottom
anchors.right: ok_button.left
anchors.rightMargin: 2 * screenScaleFactor
}
Button
{ {
id: ok_button text: catalog.i18nc("@action:button", "Open")
anchors.right: parent.right onClicked: accept()
anchors.bottom: parent.bottom
text: catalog.i18nc("@action:button","Open");
onClicked: { manager.closeBackend(); manager.onOkButtonClicked() }
} }
} ]
onRejected: manager.onCancelButtonClicked()
function accept() { onAccepted: manager.onOkButtonClicked()
manager.closeBackend();
manager.onOkButtonClicked();
base.visible = false;
base.accept();
}
function reject() {
manager.onCancelButtonClicked();
base.visible = false;
base.rejected();
}
} }

View file

@ -87,7 +87,7 @@ Item
anchors.top: dataRow.bottom anchors.top: dataRow.bottom
} }
UM.MessageDialog Cura.MessageDialog
{ {
id: confirmDeleteDialog id: confirmDeleteDialog
title: catalog.i18nc("@dialog:title", "Delete Backup") title: catalog.i18nc("@dialog:title", "Delete Backup")
@ -96,7 +96,7 @@ Item
onAccepted: CuraDrive.deleteBackup(modelData.backup_id) onAccepted: CuraDrive.deleteBackup(modelData.backup_id)
} }
UM.MessageDialog Cura.MessageDialog
{ {
id: confirmRestoreDialog id: confirmRestoreDialog
title: catalog.i18nc("@dialog:title", "Restore Backup") title: catalog.i18nc("@dialog:title", "Restore Backup")

View file

@ -35,7 +35,8 @@ Item
model: columnHeaders model: columnHeaders
Rectangle Rectangle
{ {
width: Math.max(1, Math.round(tableBase.width / headerRepeater.count)) //minimumWidth: Math.max(1, Math.round(tableBase.width / headerRepeater.count))
width: 300
height: UM.Theme.getSize("section").height height: UM.Theme.getSize("section").height
color: UM.Theme.getColor("secondary") color: UM.Theme.getColor("secondary")

View file

@ -49,7 +49,7 @@ Cura.MachineAction
width: childrenRect.width width: childrenRect.width
spacing: UM.Theme.getSize("default_margin").width spacing: UM.Theme.getSize("default_margin").width
property string firmwareName: Cura.MachineManager.activeMachine.getDefaultFirmwareName() property string firmwareName: Cura.MachineManager.activeMachine.getDefaultFirmwareName()
Button Cura.SecondaryButton
{ {
id: autoUpgradeButton id: autoUpgradeButton
text: catalog.i18nc("@action:button", "Automatically upgrade Firmware") text: catalog.i18nc("@action:button", "Automatically upgrade Firmware")
@ -60,7 +60,7 @@ Cura.MachineAction
activeOutputDevice.updateFirmware(parent.firmwareName); activeOutputDevice.updateFirmware(parent.firmwareName);
} }
} }
Button Cura.SecondaryButton
{ {
id: manualUpgradeButton id: manualUpgradeButton
text: catalog.i18nc("@action:button", "Upload custom Firmware") text: catalog.i18nc("@action:button", "Upload custom Firmware")
@ -173,7 +173,7 @@ Cura.MachineAction
} }
rightButtons: [ rightButtons: [
Button Cura.SecondaryButton
{ {
text: catalog.i18nc("@action:button", "Close") text: catalog.i18nc("@action:button", "Close")
enabled: manager.firmwareUpdater != null ? manager.firmwareUpdater.firmwareUpdateState != 1 : true enabled: manager.firmwareUpdater != null ? manager.firmwareUpdater.firmwareUpdateState != 1 : true

View file

@ -11,26 +11,25 @@ import Cura 1.0 as Cura
UM.Dialog UM.Dialog
{ {
title: catalog.i18nc("@title:window", "Convert Image...") title: catalog.i18nc("@title:window", "Convert Image")
minimumWidth: grid.width + 2 * UM.Theme.getSize("default_margin").height minimumWidth: grid.width + 2 * UM.Theme.getSize("default_margin").height
minimumHeight: UM.Theme.getSize("modal_window_minimum").height minimumHeight: UM.Theme.getSize("modal_window_minimum").height
width: minimumWidth width: minimumWidth
height: minimumHeight height: minimumHeight
GridLayout GridLayout
{ {
UM.I18nCatalog { id: catalog; name: "cura" } UM.I18nCatalog { id: catalog; name: "cura" }
id: grid id: grid
columnSpacing: UM.Theme.getSize("default_margin").width columnSpacing: UM.Theme.getSize("narrow_margin").width
rowSpacing: UM.Theme.getSize("thin_margin").height rowSpacing: UM.Theme.getSize("narrow_margin").height
columns: 2 columns: 2
UM.Label UM.Label
{ {
Layout.fillWidth: true Layout.fillWidth: true
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
text: catalog.i18nc("@action:label", "Height (mm)") text: catalog.i18nc("@action:label", "Height (mm)")
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
@ -45,6 +44,7 @@ UM.Dialog
{ {
id: peak_height id: peak_height
Layout.fillWidth: true Layout.fillWidth: true
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
selectByMouse: true selectByMouse: true
objectName: "Peak_Height" objectName: "Peak_Height"
validator: RegExpValidator { regExp: /^\d{0,3}([\,|\.]\d*)?$/ } validator: RegExpValidator { regExp: /^\d{0,3}([\,|\.]\d*)?$/ }
@ -62,6 +62,7 @@ UM.Dialog
UM.Label UM.Label
{ {
Layout.fillWidth: true Layout.fillWidth: true
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
text: catalog.i18nc("@action:label", "Base (mm)") text: catalog.i18nc("@action:label", "Base (mm)")
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
@ -78,6 +79,7 @@ UM.Dialog
id: base_height id: base_height
selectByMouse: true selectByMouse: true
Layout.fillWidth: true Layout.fillWidth: true
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
objectName: "Base_Height" objectName: "Base_Height"
validator: RegExpValidator { regExp: /^\d{0,3}([\,|\.]\d*)?$/ } validator: RegExpValidator { regExp: /^\d{0,3}([\,|\.]\d*)?$/ }
onTextChanged: manager.onBaseHeightChanged(text) onTextChanged: manager.onBaseHeightChanged(text)
@ -94,6 +96,7 @@ UM.Dialog
UM.Label UM.Label
{ {
Layout.fillWidth: true Layout.fillWidth: true
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
text: catalog.i18nc("@action:label", "Width (mm)") text: catalog.i18nc("@action:label", "Width (mm)")
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
@ -110,6 +113,7 @@ UM.Dialog
selectByMouse: true selectByMouse: true
objectName: "Width" objectName: "Width"
Layout.fillWidth: true Layout.fillWidth: true
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
focus: true focus: true
validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ } validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ }
onTextChanged: manager.onWidthChanged(text) onTextChanged: manager.onWidthChanged(text)
@ -126,6 +130,7 @@ UM.Dialog
UM.Label UM.Label
{ {
Layout.fillWidth: true Layout.fillWidth: true
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
text: catalog.i18nc("@action:label", "Depth (mm)") text: catalog.i18nc("@action:label", "Depth (mm)")
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
@ -140,6 +145,7 @@ UM.Dialog
{ {
id: depth id: depth
Layout.fillWidth: true Layout.fillWidth: true
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
selectByMouse: true selectByMouse: true
objectName: "Depth" objectName: "Depth"
focus: true focus: true
@ -158,6 +164,7 @@ UM.Dialog
UM.Label UM.Label
{ {
Layout.fillWidth: true Layout.fillWidth: true
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
text: "" text: ""
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
@ -172,9 +179,14 @@ UM.Dialog
{ {
id: lighter_is_higher id: lighter_is_higher
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: UM.Theme.getSize("toolbox_action_button").height Layout.minimumWidth: UM.Theme.getSize("setting_control").width
Layout.preferredHeight: UM.Theme.getSize("setting_control").height
objectName: "Lighter_Is_Higher" objectName: "Lighter_Is_Higher"
model: [catalog.i18nc("@item:inlistbox", "Darker is higher"), catalog.i18nc("@item:inlistbox", "Lighter is higher")] textRole: "text"
model: [
{ text: catalog.i18nc("@item:inlistbox", "Darker is higher") },
{ text: catalog.i18nc("@item:inlistbox", "Lighter is higher") }
]
onCurrentIndexChanged: { manager.onImageColorInvertChanged(currentIndex) } onCurrentIndexChanged: { manager.onImageColorInvertChanged(currentIndex) }
} }
@ -189,6 +201,7 @@ UM.Dialog
UM.Label UM.Label
{ {
Layout.fillWidth: true Layout.fillWidth: true
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
text: catalog.i18nc("@action:label", "Color Model") text: catalog.i18nc("@action:label", "Color Model")
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
@ -203,10 +216,15 @@ UM.Dialog
{ {
id: color_model id: color_model
Layout.fillWidth: true Layout.fillWidth: true
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
Layout.preferredHeight: UM.Theme.getSize("setting_control").height
objectName: "ColorModel" objectName: "ColorModel"
model: [catalog.i18nc("@item:inlistbox", "Linear"), catalog.i18nc("@item:inlistbox", "Translucency")] textRole: "text"
model: [
{ text: catalog.i18nc("@item:inlistbox", "Linear") },
{ text: catalog.i18nc("@item:inlistbox", "Translucency") }
]
onCurrentIndexChanged: { manager.onColorModelChanged(currentIndex) } onCurrentIndexChanged: { manager.onColorModelChanged(currentIndex) }
Layout.preferredHeight: UM.Theme.getSize("toolbox_action_button").height
} }
Cura.ToolTip Cura.ToolTip
@ -220,6 +238,7 @@ UM.Dialog
UM.Label UM.Label
{ {
Layout.fillWidth: true Layout.fillWidth: true
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
text: catalog.i18nc("@action:label", "1mm Transmittance (%)") text: catalog.i18nc("@action:label", "1mm Transmittance (%)")
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
@ -232,25 +251,26 @@ UM.Dialog
Cura.TextField Cura.TextField
{ {
id: transmittance
Layout.fillWidth: true Layout.fillWidth: true
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
selectByMouse: true selectByMouse: true
objectName: "Transmittance" objectName: "Transmittance"
validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ } validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ }
onTextChanged: manager.onTransmittanceChanged(text) onTextChanged: manager.onTransmittanceChanged(text)
}
Cura.ToolTip Cura.ToolTip
{ {
text: catalog.i18nc("@info:tooltip", "The percentage of light penetrating a print with a thickness of 1 millimeter. Lowering this value increases the contrast in dark regions and decreases the contrast in light regions of the image.") text: catalog.i18nc("@info:tooltip", "The percentage of light penetrating a print with a thickness of 1 millimeter. Lowering this value increases the contrast in dark regions and decreases the contrast in light regions of the image.")
visible: transmittance.hovered || transmittance_label.containsMouse visible: parent.hovered || transmittance_label.containsMouse
targetPoint: Qt.point(transmittance.x + Math.round(transmittance.width / 2), 0) targetPoint: Qt.point(parent.x + Math.round(parent.width / 2), 0)
y: transmittance.y + transmittance.height + UM.Theme.getSize("default_margin").height y: parent.y + parent.height + UM.Theme.getSize("default_margin").height
}
} }
UM.Label UM.Label
{ {
Layout.fillWidth: true Layout.fillWidth: true
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
text: catalog.i18nc("@action:label", "Smoothing") text: catalog.i18nc("@action:label", "Smoothing")
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
@ -262,14 +282,15 @@ UM.Dialog
} }
} }
Slider Cura.SpinBox
{ {
id: smoothing id: smoothing
Layout.fillWidth: true Layout.fillWidth: true
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
objectName: "Smoothing" objectName: "Smoothing"
to: 100.0 to: 100.0
stepSize: 1.0 stepSize: 1.0
onValueChanged: { manager.onSmoothingChanged(value) } onValueChanged: manager.onSmoothingChanged(value)
} }
Cura.ToolTip Cura.ToolTip
@ -293,18 +314,20 @@ UM.Dialog
onAccepted: manager.onOkButtonClicked() onAccepted: manager.onOkButtonClicked()
onRejected: manager.onCancelButtonClicked() onRejected: manager.onCancelButtonClicked()
buttonSpacing: UM.Theme.getSize("default_margin").width
rightButtons: [ rightButtons: [
Button Cura.TertiaryButton
{
id: ok_button
text: catalog.i18nc("@action:button", "OK")
onClicked: manager.onOkButtonClicked()
},
Button
{ {
id: cancel_button id: cancel_button
text: catalog.i18nc("@action:button", "Cancel") text: catalog.i18nc("@action:button", "Cancel")
onClicked: manager.onCancelButtonClicked() onClicked: manager.onCancelButtonClicked()
},
Cura.PrimaryButton
{
id: ok_button
text: catalog.i18nc("@action:button", "OK")
onClicked: manager.onOkButtonClicked()
} }
] ]
} }

View file

@ -5,7 +5,7 @@ import QtQuick 2.10
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import UM 1.3 as UM import UM 1.5 as UM
import Cura 1.1 as Cura import Cura 1.1 as Cura
@ -88,7 +88,7 @@ Cura.MachineAction
} }
} }
Label UM.Label
{ {
id: machineNameLabel id: machineNameLabel
anchors.top: parent.top anchors.top: parent.top
@ -97,7 +97,6 @@ Cura.MachineAction
text: Cura.MachineManager.activeMachine.name text: Cura.MachineManager.activeMachine.name
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
font: UM.Theme.getFont("large_bold") font: UM.Theme.getFont("large_bold")
renderType: Text.NativeRendering
} }
UM.TabRow UM.TabRow

View file

@ -64,8 +64,8 @@ Window
// Page title. // Page title.
Item Item
{ {
implicitWidth: parent.width Layout.preferredWidth: parent.width
implicitHeight: childrenRect.height + UM.Theme.getSize("default_margin").height Layout.preferredHeight: childrenRect.height + UM.Theme.getSize("default_margin").height
Label Label
{ {

View file

@ -11,19 +11,28 @@ import ".."
Button { Button {
id: base; id: base;
background: Item { } background: Rectangle {
color: UM.Theme.getColor("category_background")
}
contentItem: Row contentItem: Row
{ {
spacing: UM.Theme.getSize("default_lining").width spacing: UM.Theme.getSize("default_lining").width
UM.RecolorImage Item //Wrapper to give space before icon with fixed width. This allows aligning checkbox with category icon.
{ {
anchors.verticalCenter: parent.verticalCenter height: label.height
height: (label.height / 2) | 0
width: height width: height
source: base.checked ? UM.Theme.getIcon("ChevronSingleDown") : UM.Theme.getIcon("ChevronSingleRight"); anchors.verticalCenter: parent.verticalCenter
color: base.hovered ? palette.highlight : palette.buttonText
UM.RecolorImage
{
anchors.verticalCenter: parent.verticalCenter
height: (label.height / 2) | 0
width: height
source: base.checked ? UM.Theme.getIcon("ChevronSingleDown") : UM.Theme.getIcon("ChevronSingleRight")
color: base.hovered ? UM.Theme.getColor("primary_button_hover"): UM.Theme.getColor("text")
}
} }
UM.RecolorImage UM.RecolorImage
{ {
@ -31,22 +40,20 @@ Button {
height: label.height height: label.height
width: height width: height
source: UM.Theme.getIcon(definition.icon) source: UM.Theme.getIcon(definition.icon)
color: base.hovered ? palette.highlight : palette.buttonText color: base.hovered ? UM.Theme.getColor("primary_button_hover") : UM.Theme.getColor("text")
} }
UM.Label UM.Label
{ {
id: label id: label
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: base.text text: base.text
color: base.hovered ? palette.highlight : palette.buttonText color: base.hovered ? UM.Theme.getColor("primary_button_hover") : UM.Theme.getColor("text")
font.bold: true font.bold: true
} }
SystemPalette { id: palette }
} }
signal showTooltip(string text); signal showTooltip(string text)
signal hideTooltip(); signal hideTooltip()
signal contextMenuRequested() signal contextMenuRequested()
text: definition.label text: definition.label

View file

@ -10,16 +10,25 @@ import Cura 1.0 as Cura
UM.TooltipArea UM.TooltipArea
{ {
x: model.depth * UM.Theme.getSize("default_margin").width; x: model.depth * UM.Theme.getSize("default_margin").width
text: model.description; text: model.description
width: childrenRect.width; width: childrenRect.width
height: childrenRect.height; height: childrenRect.height
Item
{
id: spacer
// Align checkbox with PerObjectCategory icon
width: UM.Theme.getSize("default_margin").width
}
UM.CheckBox UM.CheckBox
{ {
id: check id: check
anchors.left: spacer.right
text: definition.label text: definition.label
checked: addedSettingsModel.getVisible(model.key) checked: addedSettingsModel.getVisible(model.key)

View file

@ -425,8 +425,6 @@ Item
storeIndex: 0 storeIndex: 0
} }
SystemPalette { id: palette }
Component Component
{ {
id: settingTextField id: settingTextField

View file

@ -13,7 +13,8 @@ UM.Dialog
id: settingPickDialog id: settingPickDialog
title: catalog.i18nc("@title:window", "Select Settings to Customize for this model") title: catalog.i18nc("@title:window", "Select Settings to Customize for this model")
width: screenScaleFactor * 360 width: UM.Theme.getSize("small_popup_dialog").width
backgroundColor: UM.Theme.getColor("background_1")
property var additional_excluded_settings property var additional_excluded_settings
@ -78,12 +79,13 @@ UM.Dialog
anchors anchors
{ {
top: filterInput.bottom top: filterInput.bottom
topMargin: UM.Theme.getSize("default_margin").height
left: parent.left left: parent.left
right: parent.right right: parent.right
bottom: parent.bottom bottom: parent.bottom
} }
ScrollBar.vertical: UM.ScrollBar {} ScrollBar.vertical: UM.ScrollBar { id: scrollBar }
clip: true clip: true
model: UM.SettingDefinitionsModel model: UM.SettingDefinitionsModel
@ -104,7 +106,7 @@ UM.Dialog
{ {
id: loader id: loader
width: listview.width width: listview.width - scrollBar.width
height: model.type != undefined ? UM.Theme.getSize("section").height : 0 height: model.type != undefined ? UM.Theme.getSize("section").height : 0
property var definition: model property var definition: model
@ -126,10 +128,10 @@ UM.Dialog
} }
rightButtons: [ rightButtons: [
Button Cura.TertiaryButton
{ {
text: catalog.i18nc("@action:button", "Close") text: catalog.i18nc("@action:button", "Close")
onClicked: settingPickDialog.visible = false onClicked: reject()
} }
] ]
} }

View file

@ -15,14 +15,15 @@ UM.Dialog
id: dialog id: dialog
title: catalog.i18nc("@title:window", "Post Processing Plugin") title: catalog.i18nc("@title:window", "Post Processing Plugin")
width: 700 * screenScaleFactor; width: 700 * screenScaleFactor
height: 500 * screenScaleFactor; height: 500 * screenScaleFactor
minimumWidth: 400 * screenScaleFactor; minimumWidth: 400 * screenScaleFactor
minimumHeight: 250 * screenScaleFactor; minimumHeight: 250 * screenScaleFactor
onVisibleChanged: onVisibleChanged:
{ {
if(!visible) //Whenever the window is closed (either via the "Close" button or the X on the window frame), we want to update it in the stack. // Whenever the window is closed (either via the "Close" button or the X on the window frame), we want to update it in the stack.
if (!visible)
{ {
manager.writeScriptsToStack() manager.writeScriptsToStack()
} }
@ -35,8 +36,7 @@ UM.Dialog
property int columnWidth: Math.round((base.width / 2) - UM.Theme.getSize("default_margin").width) property int columnWidth: Math.round((base.width / 2) - UM.Theme.getSize("default_margin").width)
property int textMargin: UM.Theme.getSize("narrow_margin").width property int textMargin: UM.Theme.getSize("narrow_margin").width
property string activeScriptName property string activeScriptName
SystemPalette{ id: palette }
SystemPalette{ id: disabledPalette; colorGroup: SystemPalette.Disabled }
anchors.fill: parent anchors.fill: parent
ButtonGroup ButtonGroup
@ -51,14 +51,12 @@ UM.Dialog
spacing: base.textMargin spacing: base.textMargin
Label UM.Label
{ {
id: activeScriptsHeader id: activeScriptsHeader
text: catalog.i18nc("@label", "Post Processing Scripts") text: catalog.i18nc("@label", "Post Processing Scripts")
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: base.textMargin
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: base.textMargin
font: UM.Theme.getFont("large_bold") font: UM.Theme.getFont("large_bold")
elide: Text.ElideRight elide: Text.ElideRight
} }
@ -68,7 +66,6 @@ UM.Dialog
anchors anchors
{ {
left: parent.left left: parent.left
leftMargin: UM.Theme.getSize("default_margin").width
right: parent.right right: parent.right
rightMargin: base.textMargin rightMargin: base.textMargin
} }
@ -80,166 +77,168 @@ UM.Dialog
id: activeScriptsScrollBar id: activeScriptsScrollBar
} }
model: manager.scriptList model: manager.scriptList
delegate: Item
delegate: Button
{ {
id: activeScriptButton
width: parent.width - activeScriptsScrollBar.width width: parent.width - activeScriptsScrollBar.width
height: activeScriptButton.height height: UM.Theme.getSize("standard_list_lineheight").height
Button
{
id: activeScriptButton
text: manager.getScriptLabelByKey(modelData.toString())
ButtonGroup.group: selectedScriptGroup
width: parent.width
height: UM.Theme.getSize("setting").height
checkable: true
checked: ButtonGroup.group: selectedScriptGroup
checkable: true
checked:
{
if (manager.selectedScriptIndex == index)
{ {
if (manager.selectedScriptIndex == index)
{
base.activeScriptName = manager.getScriptLabelByKey(modelData.toString())
return true
}
else
{
return false
}
}
onClicked:
{
forceActiveFocus()
manager.setSelectedScriptIndex(index)
base.activeScriptName = manager.getScriptLabelByKey(modelData.toString()) base.activeScriptName = manager.getScriptLabelByKey(modelData.toString())
return true
} }
else
background: Rectangle
{ {
color: activeScriptButton.checked ? palette.highlight : "transparent" return false
} }
contentItem: Label
{
wrapMode: Text.Wrap
text: activeScriptButton.text
elide: Text.ElideRight
color: activeScriptButton.checked ? palette.highlightedText : palette.text
}
} }
Button background: Rectangle
{ {
id: removeButton color: activeScriptButton.checked ? UM.Theme.getColor("background_3") : "transparent"
text: "x" }
width: 20 * screenScaleFactor
height: 20 * screenScaleFactor onClicked:
anchors.right: parent.right {
anchors.verticalCenter: parent.verticalCenter forceActiveFocus()
onClicked: manager.removeScriptByIndex(index) manager.setSelectedScriptIndex(index)
contentItem: Item base.activeScriptName = manager.getScriptLabelByKey(modelData.toString())
}
RowLayout
{
anchors.fill: parent
UM.Label
{ {
Layout.fillWidth: true
text: manager.getScriptLabelByKey(modelData.toString())
}
Item
{
id: downButton
Layout.preferredWidth: height
Layout.fillHeight: true
enabled: index != manager.scriptList.length - 1
MouseArea
{
anchors.fill: parent
onClicked:
{
if (manager.selectedScriptIndex == index)
{
manager.setSelectedScriptIndex(index + 1)
}
return manager.moveScript(index, index + 1)
}
}
UM.RecolorImage UM.RecolorImage
{ {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
width: Math.round(removeButton.width / 2.7) width: UM.Theme.getSize("standard_arrow").width
height: Math.round(removeButton.height / 2.7) height: UM.Theme.getSize("standard_arrow").height
sourceSize.height: width sourceSize.width: width
color: palette.text sourceSize.height: height
source: UM.Theme.getIcon("Cancel") color: parent.enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("text_disabled")
}
}
}
Button
{
id: downButton
text: ""
anchors.right: removeButton.left
anchors.verticalCenter: parent.verticalCenter
enabled: index != manager.scriptList.length - 1
width: 20 * screenScaleFactor
height: 20 * screenScaleFactor
onClicked:
{
if (manager.selectedScriptIndex == index)
{
manager.setSelectedScriptIndex(index + 1)
}
return manager.moveScript(index, index + 1)
}
contentItem: Item
{
UM.RecolorImage
{
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
width: Math.round(downButton.width / 2.5)
height: Math.round(downButton.height / 2.5)
sourceSize.height: width
color: downButton.enabled ? palette.text : disabledPalette.text
source: UM.Theme.getIcon("ChevronSingleDown") source: UM.Theme.getIcon("ChevronSingleDown")
} }
} }
} Item
Button
{
id: upButton
text: ""
enabled: index != 0
width: 20 * screenScaleFactor
height: 20 * screenScaleFactor
anchors.right: downButton.left
anchors.verticalCenter: parent.verticalCenter
onClicked:
{ {
if (manager.selectedScriptIndex == index) id: upButton
Layout.preferredWidth: height
Layout.fillHeight: true
enabled: index != 0
MouseArea
{ {
manager.setSelectedScriptIndex(index - 1) anchors.fill: parent
onClicked:
{
if (manager.selectedScriptIndex == index)
{
manager.setSelectedScriptIndex(index - 1)
}
return manager.moveScript(index, index - 1)
}
} }
return manager.moveScript(index, index - 1)
}
contentItem: Item
{
UM.RecolorImage UM.RecolorImage
{ {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
width: Math.round(upButton.width / 2.5) width: UM.Theme.getSize("standard_arrow").width
height: Math.round(upButton.height / 2.5) height: UM.Theme.getSize("standard_arrow").height
sourceSize.height: width sourceSize.width: width
color: upButton.enabled ? palette.text : disabledPalette.text sourceSize.height: height
color: upButton.enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("text_disabled")
source: UM.Theme.getIcon("ChevronSingleUp") source: UM.Theme.getIcon("ChevronSingleUp")
} }
} }
Item
{
id: removeButton
Layout.preferredWidth: height
Layout.fillHeight: true
MouseArea
{
anchors.fill: parent
onClicked: manager.removeScriptByIndex(index)
}
UM.RecolorImage
{
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
width: UM.Theme.getSize("standard_arrow").width
height: UM.Theme.getSize("standard_arrow").height
sourceSize.width: width
sourceSize.height: height
color: UM.Theme.getColor("text")
source: UM.Theme.getIcon("Cancel")
}
}
} }
} }
} }
Button Cura.SecondaryButton
{ {
id: addButton id: addButton
text: catalog.i18nc("@action", "Add a script") text: catalog.i18nc("@action", "Add a script")
anchors.left: parent.left
anchors.leftMargin: base.textMargin
onClicked: scriptsMenu.open() onClicked: scriptsMenu.open()
} }
Menu }
Cura.Menu
{
id: scriptsMenu
Models.Instantiator
{ {
id: scriptsMenu model: manager.loadedScriptList
width: parent.width
Models.Instantiator Cura.MenuItem
{ {
model: manager.loadedScriptList text: manager.getScriptLabelByKey(modelData.toString())
onTriggered: manager.addScriptToList(modelData.toString())
MenuItem
{
text: manager.getScriptLabelByKey(modelData.toString())
onTriggered: manager.addScriptToList(modelData.toString())
}
onObjectAdded: scriptsMenu.insertItem(index, object)
onObjectRemoved: scriptsMenu.removeItem(object)
} }
onObjectAdded: scriptsMenu.insertItem(index, object)
onObjectRemoved: scriptsMenu.removeItem(object)
} }
} }
@ -304,16 +303,9 @@ UM.Dialog
width: listview.width width: listview.width
height: height:
{ {
if(provider.properties.enabled == "True") if (provider.properties.enabled == "True" && model.type != undefined)
{ {
if(model.type != undefined) return UM.Theme.getSize("section").height;
{
return UM.Theme.getSize("section").height
}
else
{
return 0
}
} }
else else
{ {
@ -393,10 +385,10 @@ UM.Dialog
function onShowTooltip(text) function onShowTooltip(text)
{ {
tooltip.text = text tooltip.text = text;
var position = settingLoader.mapToItem(settingsPanel, settingsPanel.x, 0) var position = settingLoader.mapToItem(settingsPanel, settingsPanel.x, 0);
tooltip.show(position) tooltip.show(position);
tooltip.target.x = position.x + 1 tooltip.target.x = position.x + 1;
} }
function onHideTooltip() { tooltip.hide() } function onHideTooltip() { tooltip.hide() }
@ -453,7 +445,7 @@ UM.Dialog
} }
} }
rightButtons: Button rightButtons: Cura.TertiaryButton
{ {
text: catalog.i18nc("@action:button", "Close") text: catalog.i18nc("@action:button", "Close")
onClicked: dialog.accept() onClicked: dialog.accept()

View file

@ -35,8 +35,8 @@ Cura.MachineAction
id: discoverUM3Action id: discoverUM3Action
spacing: UM.Theme.getSize("default_margin").height spacing: UM.Theme.getSize("default_margin").height
SystemPalette { id: palette }
UM.I18nCatalog { id: catalog; name:"cura" } UM.I18nCatalog { id: catalog; name:"cura" }
UM.Label UM.Label
{ {
id: pageTitle id: pageTitle
@ -53,9 +53,9 @@ Cura.MachineAction
Row Row
{ {
spacing: UM.Theme.getSize("default_lining").width spacing: UM.Theme.getSize("thin_margin").width
Button Cura.SecondaryButton
{ {
id: addButton id: addButton
text: catalog.i18nc("@action:button", "Add"); text: catalog.i18nc("@action:button", "Add");
@ -65,7 +65,7 @@ Cura.MachineAction
} }
} }
Button Cura.SecondaryButton
{ {
id: editButton id: editButton
text: catalog.i18nc("@action:button", "Edit") text: catalog.i18nc("@action:button", "Edit")
@ -76,7 +76,7 @@ Cura.MachineAction
} }
} }
Button Cura.SecondaryButton
{ {
id: removeButton id: removeButton
text: catalog.i18nc("@action:button", "Remove") text: catalog.i18nc("@action:button", "Remove")
@ -84,7 +84,7 @@ Cura.MachineAction
onClicked: manager.removeManualDevice(base.selectedDevice.key, base.selectedDevice.ipAddress) onClicked: manager.removeManualDevice(base.selectedDevice.key, base.selectedDevice.ipAddress)
} }
Button Cura.SecondaryButton
{ {
id: rediscoverButton id: rediscoverButton
text: catalog.i18nc("@action:button", "Refresh") text: catalog.i18nc("@action:button", "Refresh")
@ -122,23 +122,18 @@ Cura.MachineAction
base.completeProperties = base.selectedDevice != null && base.selectedDevice.getProperty("incomplete") != "true"; base.completeProperties = base.selectedDevice != null && base.selectedDevice.getProperty("incomplete") != "true";
} }
Component.onCompleted: manager.startDiscovery() Component.onCompleted: manager.startDiscovery()
delegate: Rectangle
delegate: UM.Label
{ {
height: printNameLabel.height id: printNameLabel
color: ListView.isCurrentItem ? palette.highlight : index % 2 ? palette.base : palette.alternateBase
width: listview.width width: listview.width
Label height: contentHeight
{ anchors.left: parent.left
id: printNameLabel anchors.leftMargin: UM.Theme.getSize("default_margin").width
height: contentHeight
anchors.left: parent.left anchors.right: parent.right
anchors.leftMargin: UM.Theme.getSize("default_margin").width text: listview.model[index].name
anchors.right: parent.right elide: Text.ElideRight
text: listview.model[index].name
color: parent.ListView.isCurrentItem ? palette.highlightedText : palette.text
elide: Text.ElideRight
renderType: Text.NativeRendering
}
MouseArea MouseArea
{ {
@ -151,6 +146,11 @@ Cura.MachineAction
} }
} }
} }
background: Rectangle
{
color: parent.ListView.isCurrentItem ? UM.Theme.getColor("background_3") : "transparent"
}
} }
} }
UM.Label UM.Label
@ -175,20 +175,19 @@ Cura.MachineAction
font: UM.Theme.getFont("large_bold") font: UM.Theme.getFont("large_bold")
elide: Text.ElideRight elide: Text.ElideRight
} }
Grid GridLayout
{ {
visible: base.completeProperties visible: base.completeProperties
width: parent.width width: parent.width
columns: 2 columns: 2
property real labelWidth: Math.round(width * 0.5)
UM.Label UM.Label
{ {
width: labelWidth Layout.fillWidth: true
text: catalog.i18nc("@label", "Type") text: catalog.i18nc("@label", "Type")
} }
UM.Label UM.Label
{ {
width: labelWidth Layout.fillWidth: true
text: text:
{ {
if (base.selectedDevice) { if (base.selectedDevice) {
@ -199,22 +198,22 @@ Cura.MachineAction
} }
UM.Label UM.Label
{ {
width: labelWidth Layout.fillWidth: true
text: catalog.i18nc("@label", "Firmware version") text: catalog.i18nc("@label", "Firmware version")
} }
UM.Label UM.Label
{ {
width: labelWidth Layout.fillWidth: true
text: base.selectedDevice ? base.selectedDevice.firmwareVersion : "" text: base.selectedDevice ? base.selectedDevice.firmwareVersion : ""
} }
UM.Label UM.Label
{ {
width: labelWidth Layout.fillWidth: true
text: catalog.i18nc("@label", "Address") text: catalog.i18nc("@label", "Address")
} }
UM.Label UM.Label
{ {
width: labelWidth Layout.fillWidth: true
text: base.selectedDevice ? base.selectedDevice.ipAddress : "" text: base.selectedDevice ? base.selectedDevice.ipAddress : ""
} }
} }
@ -246,7 +245,7 @@ Cura.MachineAction
text: catalog.i18nc("@label", "The printer at this address has not yet responded." ) text: catalog.i18nc("@label", "The printer at this address has not yet responded." )
} }
Button Cura.SecondaryButton
{ {
text: catalog.i18nc("@action:button", "Connect") text: catalog.i18nc("@action:button", "Connect")
enabled: (base.selectedDevice && base.completeProperties && base.selectedDevice.clusterSize > 0) ? true : false enabled: (base.selectedDevice && base.completeProperties && base.selectedDevice.clusterSize > 0) ? true : false
@ -256,7 +255,7 @@ Cura.MachineAction
} }
} }
UM.MessageDialog Cura.MessageDialog
{ {
id: invalidIPAddressMessageDialog id: invalidIPAddressMessageDialog
title: catalog.i18nc("@title:window", "Invalid IP address") title: catalog.i18nc("@title:window", "Invalid IP address")
@ -264,7 +263,7 @@ Cura.MachineAction
standardButtons: Dialog.Ok standardButtons: Dialog.Ok
} }
Dialog Cura.MessageDialog
{ {
id: manualPrinterDialog id: manualPrinterDialog
property string printerKey property string printerKey
@ -273,6 +272,7 @@ Cura.MachineAction
title: catalog.i18nc("@title:window", "Printer Address") title: catalog.i18nc("@title:window", "Printer Address")
width: UM.Theme.getSize("small_popup_dialog").width width: UM.Theme.getSize("small_popup_dialog").width
height: UM.Theme.getSize("small_popup_dialog").height
anchors.centerIn: Overlay.overlay anchors.centerIn: Overlay.overlay

View file

@ -4,6 +4,7 @@
import QtQuick 2.3 import QtQuick 2.3
import QtQuick.Controls 2.15 import QtQuick.Controls 2.15
import UM 1.5 as UM import UM 1.5 as UM
import Cura 1.6 as Cura
/** /**
* A MonitorInfoBlurb is an extension of the GenericPopUp used to show static information (vs. interactive context * A MonitorInfoBlurb is an extension of the GenericPopUp used to show static information (vs. interactive context
@ -133,7 +134,7 @@ Item
} }
} }
UM.MessageDialog Cura.MessageDialog
{ {
id: sendToTopConfirmationDialog id: sendToTopConfirmationDialog
onAccepted: OutputDevice.sendJobToTop(printJob.key) onAccepted: OutputDevice.sendJobToTop(printJob.key)
@ -142,7 +143,7 @@ Item
title: catalog.i18nc("@window:title", "Move print job to top") title: catalog.i18nc("@window:title", "Move print job to top")
} }
UM.MessageDialog Cura.MessageDialog
{ {
id: deleteConfirmationDialog id: deleteConfirmationDialog
onAccepted: OutputDevice.deleteJobFromQueue(printJob.key) onAccepted: OutputDevice.deleteJobFromQueue(printJob.key)
@ -151,7 +152,7 @@ Item
title: catalog.i18nc("@window:title", "Delete print job") title: catalog.i18nc("@window:title", "Delete print job")
} }
UM.MessageDialog Cura.MessageDialog
{ {
id: abortConfirmationDialog id: abortConfirmationDialog
onAccepted: printJob.setState("abort") onAccepted: printJob.setState("abort")

View file

@ -392,6 +392,7 @@ Item
id: printerJobNameLabel id: printerJobNameLabel
color: printer && printer.activePrintJob && printer.activePrintJob.isActive ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled") color: printer && printer.activePrintJob && printer.activePrintJob.isActive ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled")
elide: Text.ElideRight elide: Text.ElideRight
wrapMode: Text.NoWrap
font: UM.Theme.getFont("large") // 16pt, bold font: UM.Theme.getFont("large") // 16pt, bold
text: printer && printer.activePrintJob ? printer.activePrintJob.name : catalog.i18nc("@label", "Untitled") text: printer && printer.activePrintJob ? printer.activePrintJob.name : catalog.i18nc("@label", "Untitled")
width: parent.width width: parent.width

View file

@ -2,11 +2,9 @@
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 1.4 import QtQuick.Controls 2.15
import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.2 import QtQuick.Dialogs 1.2
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
import QtQuick.Controls 2.15 as NewControls
import UM 1.5 as UM import UM 1.5 as UM
import Cura 1.1 as Cura import Cura 1.1 as Cura
@ -585,7 +583,7 @@ UM.MainWindow
} }
} }
UM.MessageDialog Cura.MessageDialog
{ {
id: exitConfirmationDialog id: exitConfirmationDialog
title: catalog.i18nc("@title:window %1 is the application name", "Closing %1").arg(CuraApplication.applicationDisplayName) title: catalog.i18nc("@title:window %1 is the application name", "Closing %1").arg(CuraApplication.applicationDisplayName)
@ -743,14 +741,14 @@ UM.MainWindow
} }
} }
UM.MessageDialog Cura.MessageDialog
{ {
id: packageInstallDialog id: packageInstallDialog
title: catalog.i18nc("@window:title", "Install Package") title: catalog.i18nc("@window:title", "Install Package")
standardButtons: StandardButton.Ok standardButtons: StandardButton.Ok
} }
UM.MessageDialog Cura.MessageDialog
{ {
id: infoMultipleFilesWithGcodeDialog id: infoMultipleFilesWithGcodeDialog
title: catalog.i18nc("@title:window", "Open File(s)") title: catalog.i18nc("@title:window", "Open File(s)")

View file

@ -50,7 +50,7 @@ UM.Dialog
UM.I18nCatalog{id: catalog; name: "cura"} UM.I18nCatalog{id: catalog; name: "cura"}
} }
Label UM.Label
{ {
id: version id: version
@ -63,7 +63,7 @@ UM.Dialog
} }
} }
Label UM.Label
{ {
id: description id: description
width: parent.width width: parent.width
@ -76,7 +76,7 @@ UM.Dialog
anchors.topMargin: UM.Theme.getSize("default_margin").height anchors.topMargin: UM.Theme.getSize("default_margin").height
} }
Label UM.Label
{ {
id: creditsNotes id: creditsNotes
width: parent.width width: parent.width
@ -105,20 +105,20 @@ UM.Dialog
delegate: Row delegate: Row
{ {
spacing: UM.Theme.getSize("narrow_margin").width spacing: UM.Theme.getSize("narrow_margin").width
Label UM.Label
{ {
text: "<a href='%1' title='%2'>%2</a>".arg(model.url).arg(model.name) text: "<a href='%1' title='%2'>%2</a>".arg(model.url).arg(model.name)
width: (projectsList.width * 0.25) | 0 width: (projectsList.width * 0.25) | 0
elide: Text.ElideRight elide: Text.ElideRight
onLinkActivated: Qt.openUrlExternally(link) onLinkActivated: Qt.openUrlExternally(link)
} }
Label UM.Label
{ {
text: model.description text: model.description
elide: Text.ElideRight elide: Text.ElideRight
width: ((projectsList.width * 0.6) | 0) - parent.spacing * 2 - projectsListScrollBar.width width: ((projectsList.width * 0.6) | 0) - parent.spacing * 2 - projectsListScrollBar.width
} }
Label UM.Label
{ {
text: model.license text: model.license
elide: Text.ElideRight elide: Text.ElideRight
@ -165,12 +165,11 @@ UM.Dialog
} }
} }
rightButtons: Cura.SecondaryButton rightButtons: Cura.TertiaryButton
{ {
//: Close about dialog button //: Close about dialog button
id: closeButton id: closeButton
text: catalog.i18nc("@action:button", "Close") text: catalog.i18nc("@action:button", "Close")
onClicked: reject()
onClicked: base.visible = false;
} }
} }

View file

@ -76,7 +76,7 @@ UM.Dialog
anchors.fill: parent anchors.fill: parent
spacing: UM.Theme.getSize("default_margin").height spacing: UM.Theme.getSize("default_margin").height
Label UM.Label
{ {
id: questionText id: questionText
width: parent.width width: parent.width

View file

@ -21,6 +21,8 @@ UM.Dialog
width: minimumWidth width: minimumWidth
height: minimumHeight height: minimumHeight
margin: UM.Theme.getSize("thick_margin").width
property var changesModel: Cura.UserChangesModel { id: userChangesModel } property var changesModel: Cura.UserChangesModel { id: userChangesModel }
onVisibilityChanged: onVisibilityChanged:
@ -91,6 +93,9 @@ UM.Dialog
leftButtons: [ leftButtons: [
Cura.ComboBox Cura.ComboBox
{ {
implicitHeight: UM.Theme.getSize("combobox_wide").height
implicitWidth: UM.Theme.getSize("combobox_wide").width
id: discardOrKeepProfileChangesDropDownButton id: discardOrKeepProfileChangesDropDownButton
textRole: "text" textRole: "text"

View file

@ -0,0 +1,20 @@
// Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import UM 1.5 as UM
import Cura 1.5 as Cura
// Wrapper around the UM.MessageBox with the primary/secondarybuttons
// set to Cura.PrimaryButton and Cura.SecondaryButton respectively
UM.MessageDialog
{
primaryButton: Cura.PrimaryButton
{
text: model.text
}
secondaryButton: Cura.TertiaryButton
{
text: model.text
}
}

View file

@ -45,11 +45,7 @@ UM.Dialog
visibilityHandler: UM.SettingPreferenceVisibilityHandler { } visibilityHandler: UM.SettingPreferenceVisibilityHandler { }
} }
SystemPalette UM.Label
{
id: palette
}
Label
{ {
id: mainHeading id: mainHeading
width: parent.width width: parent.width
@ -86,7 +82,7 @@ UM.Dialog
spacing: UM.Theme.getSize("default_margin").height spacing: UM.Theme.getSize("default_margin").height
Column Column
{ {
Label UM.Label
{ {
id: settingsHeading id: settingsHeading
text: catalog.i18nc("@action:label", "Printer settings") text: catalog.i18nc("@action:label", "Printer settings")
@ -96,14 +92,14 @@ UM.Dialog
{ {
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label UM.Label
{ {
text: catalog.i18nc("@action:label", "Type") text: catalog.i18nc("@action:label", "Type")
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
Label UM.Label
{ {
text: (Cura.MachineManager.activeMachine == null) ? "" : Cura.MachineManager.activeMachine.definition.name text: Cura.MachineManager.activeMachine == null ? "" : Cura.MachineManager.activeMachine.definition.name
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
} }
@ -111,12 +107,12 @@ UM.Dialog
{ {
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label UM.Label
{ {
text: Cura.MachineManager.activeMachineNetworkGroupName != "" ? catalog.i18nc("@action:label", "Printer Group") : catalog.i18nc("@action:label", "Name") text: Cura.MachineManager.activeMachineNetworkGroupName != "" ? catalog.i18nc("@action:label", "Printer Group") : catalog.i18nc("@action:label", "Name")
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
Label UM.Label
{ {
text: text:
{ {
@ -155,7 +151,7 @@ UM.Dialog
var material_name = extruder.material.name var material_name = extruder.material.name
return (material_name !== undefined) ? material_name : "" return (material_name !== undefined) ? material_name : ""
} }
Label UM.Label
{ {
text: { text: {
var extruder = Number(modelData.position) var extruder = Number(modelData.position)
@ -179,7 +175,7 @@ UM.Dialog
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label UM.Label
{ {
text: text:
{ {
@ -192,7 +188,7 @@ UM.Dialog
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
enabled: modelData.isEnabled enabled: modelData.isEnabled
} }
Label UM.Label
{ {
text: text:
{ {
@ -212,7 +208,7 @@ UM.Dialog
{ {
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label UM.Label
{ {
text: catalog.i18nc("@action:label", "Profile settings") text: catalog.i18nc("@action:label", "Profile settings")
font.bold: true font.bold: true
@ -220,12 +216,12 @@ UM.Dialog
Row Row
{ {
width: parent.width width: parent.width
Label UM.Label
{ {
text: catalog.i18nc("@action:label", "Not in profile") text: catalog.i18nc("@action:label", "Not in profile")
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
Label UM.Label
{ {
text: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", Cura.MachineManager.numUserSettings).arg(Cura.MachineManager.numUserSettings) text: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", Cura.MachineManager.numUserSettings).arg(Cura.MachineManager.numUserSettings)
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
@ -236,12 +232,12 @@ UM.Dialog
{ {
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label UM.Label
{ {
text: catalog.i18nc("@action:label", "Name") text: catalog.i18nc("@action:label", "Name")
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
Label UM.Label
{ {
text: Cura.MachineManager.activeQualityOrQualityChangesName text: Cura.MachineManager.activeQualityOrQualityChangesName
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
@ -253,12 +249,12 @@ UM.Dialog
{ {
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label UM.Label
{ {
text: catalog.i18nc("@action:label", "Intent") text: catalog.i18nc("@action:label", "Intent")
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
Label UM.Label
{ {
text: Cura.MachineManager.activeIntentCategory text: Cura.MachineManager.activeIntentCategory
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
@ -273,10 +269,9 @@ UM.Dialog
leftButtons: leftButtons:
[ [
CheckBox UM.CheckBox
{ {
id: dontShowAgainCheckbox id: dontShowAgainCheckbox
anchors.left: parent.left
text: catalog.i18nc("@action:label", "Don't show project summary on save again") text: catalog.i18nc("@action:label", "Don't show project summary on save again")
checked: dontShowAgain checked: dontShowAgain
} }

View file

@ -30,8 +30,8 @@ Item
property color contentBackgroundColor: UM.Theme.getColor("action_button") property color contentBackgroundColor: UM.Theme.getColor("action_button")
property color headerBackgroundColor: UM.Theme.getColor("action_button") property color headerBackgroundColor: UM.Theme.getColor("action_button")
property color headerActiveColor: UM.Theme.getColor("secondary") property color headerActiveColor: UM.Theme.getColor("expandable_active")
property color headerHoverColor: UM.Theme.getColor("action_button_hovered") property color headerHoverColor: UM.Theme.getColor("expandable_hover")
property alias enabled: mouseArea.enabled property alias enabled: mouseArea.enabled

View file

@ -16,7 +16,7 @@ Cura.RoundedRectangle
property alias xPosCloseButton: closeButton.left property alias xPosCloseButton: closeButton.left
height: UM.Theme.getSize("expandable_component_content_header").height height: UM.Theme.getSize("expandable_component_content_header").height
color: UM.Theme.getColor("secondary") color: UM.Theme.getColor("background_1")
cornerSide: Cura.RoundedRectangle.Direction.Up cornerSide: Cura.RoundedRectangle.Direction.Up
border.width: UM.Theme.getSize("default_lining").width border.width: UM.Theme.getSize("default_lining").width
border.color: UM.Theme.getColor("lining") border.color: UM.Theme.getColor("lining")
@ -27,7 +27,6 @@ Cura.RoundedRectangle
id: headerLabel id: headerLabel
text: "" text: ""
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")
color: UM.Theme.getColor("small_button_text")
height: parent.height height: parent.height
anchors anchors

View file

@ -30,8 +30,8 @@ Item
property color contentBackgroundColor: UM.Theme.getColor("action_button") property color contentBackgroundColor: UM.Theme.getColor("action_button")
property color headerBackgroundColor: UM.Theme.getColor("action_button") property color headerBackgroundColor: UM.Theme.getColor("action_button")
property color headerActiveColor: UM.Theme.getColor("secondary") property color headerActiveColor: UM.Theme.getColor("expandable_active")
property color headerHoverColor: UM.Theme.getColor("action_button_hovered") property color headerHoverColor: UM.Theme.getColor("expandable_hover")
property alias mouseArea: headerMouseArea property alias mouseArea: headerMouseArea
property alias enabled: headerMouseArea.enabled property alias enabled: headerMouseArea.enabled

View file

@ -83,13 +83,12 @@ UM.TooltipArea
height: numericTextFieldWithUnit.controlHeight height: numericTextFieldWithUnit.controlHeight
// Background is a rounded-cornered box with filled color as state indication (normal, warning, error, etc.) // Background is a rounded-cornered box with filled color as state indication (normal, warning, error, etc.)
background: Rectangle background: UM.UnderlineBackground
{ {
anchors.fill: parent anchors.fill: parent
anchors.margins: Math.round(UM.Theme.getSize("default_lining").width) anchors.margins: Math.round(UM.Theme.getSize("default_lining").width)
radius: UM.Theme.getSize("setting_control_radius").width
border.color: liningColor:
{ {
if (!textFieldWithUnit.enabled) if (!textFieldWithUnit.enabled)
{ {
@ -108,9 +107,9 @@ UM.TooltipArea
// Validation is OK. // Validation is OK.
if (textFieldWithUnit.hovered || textFieldWithUnit.activeFocus) if (textFieldWithUnit.hovered || textFieldWithUnit.activeFocus)
{ {
return UM.Theme.getColor("setting_control_border_highlight") return UM.Theme.getColor("border_main_light")
} }
return UM.Theme.getColor("setting_control_border") return UM.Theme.getColor("border_field_light")
} }
color: color:

View file

@ -20,13 +20,35 @@ Item
{ {
id: applicationMenu id: applicationMenu
width: parent.width width: parent.width
FileMenu {} height: UM.Theme.getSize("context_menu").height
background: Rectangle {
color: UM.Theme.getColor("background_1")
}
delegate: MenuBarItem
{
id: menuBarItem
contentItem: UM.Label
{
text: menuBarItem.text.replace(new RegExp("&([A-Za-z])"), function (match, character)
{
return `<u>${character}</u>`;
})
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
}
background: Rectangle
{
color: menuBarItem.highlighted ? UM.Theme.getColor("background_2") : "transparent"
}
}
FileMenu {}
EditMenu {} EditMenu {}
ViewMenu {} ViewMenu {}
background: Rectangle {}
SettingsMenu SettingsMenu
{ {
//On MacOS, don't translate the "Settings" word. //On MacOS, don't translate the "Settings" word.
@ -38,13 +60,9 @@ Item
//- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar //- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar
title: (Qt.platform.os == "osx") ? "&Settings" : catalog.i18nc("@title:menu menubar:toplevel", "&Settings") title: (Qt.platform.os == "osx") ? "&Settings" : catalog.i18nc("@title:menu menubar:toplevel", "&Settings")
} }
ExtensionMenu { id: extensionMenu } ExtensionMenu { id: extensionMenu }
PreferencesMenu {} PreferencesMenu {}
HelpMenu {} HelpMenu {}
} }
@ -60,7 +78,7 @@ Item
onAccepted: UM.OutputDeviceManager.requestWriteToDevice("local_file", PrintInformation.jobName, args) onAccepted: UM.OutputDeviceManager.requestWriteToDevice("local_file", PrintInformation.jobName, args)
} }
UM.MessageDialog Cura.MessageDialog
{ {
id: newProjectDialog id: newProjectDialog
@ -97,7 +115,6 @@ Item
target: Cura.Actions.browsePackages target: Cura.Actions.browsePackages
function onTriggered() function onTriggered()
{ {
print("beepboop")
extensionMenu.extensionModel.callExtensionMethod("Marketplace", "show") extensionMenu.extensionModel.callExtensionMethod("Marketplace", "show")
} }
} }

View file

@ -78,7 +78,6 @@ Item
background: Rectangle background: Rectangle
{ {
radius: UM.Theme.getSize("action_button_radius").width radius: UM.Theme.getSize("action_button_radius").width
width: contents.width
color: color:
{ {
if (stageSelectorButton.checked) if (stageSelectorButton.checked)

View file

@ -278,6 +278,7 @@ Item
width: selectors.controlWidth width: selectors.controlWidth
height: parent.height height: parent.height
anchors.verticalCenter: parent.verticalCenter
focusPolicy: Qt.ClickFocus focusPolicy: Qt.ClickFocus
@ -289,6 +290,7 @@ Item
} }
onClicked: materialsMenu.popup() onClicked: materialsMenu.popup()
} }
Item Item
{ {
width: instructionButton.width + 2 * UM.Theme.getSize("narrow_margin").width width: instructionButton.width + 2 * UM.Theme.getSize("narrow_margin").width
@ -331,6 +333,7 @@ Item
tooltip: text tooltip: text
height: parent.height height: parent.height
width: selectors.controlWidth width: selectors.controlWidth
anchors.verticalCenter: parent.verticalCenter
focusPolicy: Qt.ClickFocus focusPolicy: Qt.ClickFocus
enabled: enabledCheckbox.checked enabled: enabledCheckbox.checked

View file

@ -133,6 +133,7 @@ Cura.Menu
focus: true focus: true
from: 1 from: 1
to: 99 to: 99
width: 2 * UM.Theme.getSize("button").width
} }
} }
} }

View file

@ -108,7 +108,7 @@ Cura.Menu
Instantiator Instantiator
{ {
model: brandMaterials model: brandMaterials
delegate: Menu delegate: Cura.Menu
{ {
id: brandMaterialsMenu id: brandMaterialsMenu
title: materialName title: materialName

View file

@ -7,7 +7,7 @@ import QtQuick.Controls 2.4
import UM 1.5 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
Menu Cura.Menu
{ {
id: menu id: menu
title: "Printer type" title: "Printer type"

View file

@ -319,7 +319,7 @@ Item
onClicked: confirmationDialog.visible = true onClicked: confirmationDialog.visible = true
} }
UM.MessageDialog Cura.MessageDialog
{ {
id: confirmationDialog id: confirmationDialog

View file

@ -14,7 +14,7 @@ UM.PreferencesPage
title: catalog.i18nc("@title:tab", "General") title: catalog.i18nc("@title:tab", "General")
id: generalPreferencesPage id: generalPreferencesPage
width: parent.width width: parent ? parent.width: 0
function setDefaultLanguage(languageCode) function setDefaultLanguage(languageCode)
{ {
@ -554,8 +554,8 @@ UM.PreferencesPage
model: comboBoxList model: comboBoxList
textRole: "text" textRole: "text"
width: UM.Theme.getSize("setting_control").width width: UM.Theme.getSize("combobox_wide").width
height: UM.Theme.getSize("setting_control").height height: UM.Theme.getSize("combobox_wide").height
currentIndex: currentIndex:
{ {
@ -711,8 +711,8 @@ UM.PreferencesPage
Cura.ComboBox Cura.ComboBox
{ {
id: choiceOnOpenProjectDropDownButton id: choiceOnOpenProjectDropDownButton
width: UM.Theme.getSize("setting_control").width width: UM.Theme.getSize("combobox_wide").width
height: UM.Theme.getSize("setting_control").height height: UM.Theme.getSize("combobox_wide").height
model: ListModel model: ListModel
{ {
@ -779,8 +779,8 @@ UM.PreferencesPage
Cura.ComboBox Cura.ComboBox
{ {
id: choiceOnProfileOverrideDropDownButton id: choiceOnProfileOverrideDropDownButton
width: UM.Theme.getSize("setting_control").width width: UM.Theme.getSize("combobox_wide").width
height: UM.Theme.getSize("setting_control").height height: UM.Theme.getSize("combobox_wide").height
model: ListModel model: ListModel
{ {
id: discardOrKeepProfileListModel id: discardOrKeepProfileListModel
@ -849,6 +849,7 @@ UM.PreferencesPage
hoverBackgroundColor: UM.Theme.getColor("secondary_button_hover") hoverBackgroundColor: UM.Theme.getColor("secondary_button_hover")
backgroundRadius: width / 2 backgroundRadius: width / 2
height: UM.Theme.getSize("small_button_icon").height height: UM.Theme.getSize("small_button_icon").height
color: UM.Theme.getColor("small_button_text")
width: height width: height
} }
} }
@ -894,7 +895,7 @@ UM.PreferencesPage
text: catalog.i18nc("@info:tooltip", "When checking for updates, only check for stable releases.") text: catalog.i18nc("@info:tooltip", "When checking for updates, only check for stable releases.")
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width anchors.leftMargin: UM.Theme.getSize("default_margin").width
RadioButton Cura.RadioButton
{ {
id: checkUpdatesOptionStable id: checkUpdatesOptionStable
text: catalog.i18nc("@option:radio", "Stable releases only") text: catalog.i18nc("@option:radio", "Stable releases only")
@ -910,7 +911,7 @@ UM.PreferencesPage
text: catalog.i18nc("@info:tooltip", "When checking for updates, check for both stable and for beta releases.") text: catalog.i18nc("@info:tooltip", "When checking for updates, check for both stable and for beta releases.")
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width anchors.leftMargin: UM.Theme.getSize("default_margin").width
RadioButton Cura.RadioButton
{ {
id: checkUpdatesOptionBeta id: checkUpdatesOptionBeta
text: catalog.i18nc("@option:radio", "Stable and Beta releases") text: catalog.i18nc("@option:radio", "Stable and Beta releases")

View file

@ -125,7 +125,7 @@ UM.ManagementPage
} }
} }
UM.RenameDialog Cura.RenameDialog
{ {
id: renameDialog id: renameDialog
object: base.currentItem && base.currentItem.name ? base.currentItem.name : "" object: base.currentItem && base.currentItem.name ? base.currentItem.name : ""

View file

@ -310,7 +310,7 @@ Item
} }
// Dialogs // Dialogs
UM.MessageDialog Cura.MessageDialog
{ {
id: confirmRemoveMaterialDialog id: confirmRemoveMaterialDialog
title: catalog.i18nc("@title:window", "Confirm Remove") title: catalog.i18nc("@title:window", "Confirm Remove")
@ -337,7 +337,7 @@ Item
{ {
const result = Cura.ContainerManager.importMaterialContainer(fileUrl); const result = Cura.ContainerManager.importMaterialContainer(fileUrl);
const messageDialog = Qt.createQmlObject("import UM 1.5 as UM; UM.MessageDialog { onClosed: destroy() }", base); const messageDialog = Qt.createQmlObject("import Cura 1.5 as Cura; Cura.MessageDialog { onClosed: destroy() }", base);
messageDialog.standardButtons = Dialog.Ok; messageDialog.standardButtons = Dialog.Ok;
messageDialog.title = catalog.i18nc("@title:window", "Import Material"); messageDialog.title = catalog.i18nc("@title:window", "Import Material");
switch (result.status) switch (result.status)
@ -365,7 +365,7 @@ Item
{ {
const result = Cura.ContainerManager.exportContainer(base.currentItem.root_material_id, selectedNameFilter, fileUrl); const result = Cura.ContainerManager.exportContainer(base.currentItem.root_material_id, selectedNameFilter, fileUrl);
const messageDialog = Qt.createQmlObject("import UM 1.5 as UM; UM.MessageDialog { onClosed: destroy() }", base); const messageDialog = Qt.createQmlObject("import Cura 1.5 as Cura; Cura.MessageDialog { onClosed: destroy() }", base);
messageDialog.title = catalog.i18nc("@title:window", "Export Material"); messageDialog.title = catalog.i18nc("@title:window", "Export Material");
messageDialog.standardButtons = Dialog.Ok; messageDialog.standardButtons = Dialog.Ok;
switch (result.status) switch (result.status)

View file

@ -266,7 +266,7 @@ Window
border.color: UM.Theme.getColor("lining") border.color: UM.Theme.getColor("lining")
border.width: UM.Theme.getSize("default_lining").width border.width: UM.Theme.getSize("default_lining").width
width: printerList.width - printerListScrollBar.width width: printerList.width - printerListScrollBar.width
height: UM.Theme.getSize("card").height height: UM.Theme.getSize("machine_selector_icon").height + 2 * UM.Theme.getSize("default_margin").height
property string syncStatus: property string syncStatus:
{ {

View file

@ -119,7 +119,7 @@ Item
width: base.width width: base.width
property real rowHeight: brandTextField.height + UM.Theme.getSize("default_lining").height property real rowHeight: brandTextField.height + UM.Theme.getSize("default_lining").height
UM.MessageDialog Cura.MessageDialog
{ {
id: confirmDiameterChangeDialog id: confirmDiameterChangeDialog

View file

@ -137,14 +137,14 @@ UM.ManagementPage
base.toActivateNewQuality = false; base.toActivateNewQuality = false;
} }
} }
UM.MessageDialog Cura.MessageDialog
{ {
id: messageDialog id: messageDialog
standardButtons: Dialog.Ok standardButtons: Dialog.Ok
} }
// Dialog to request a name when creating a new profile // Dialog to request a name when creating a new profile
UM.RenameDialog Cura.RenameDialog
{ {
id: createQualityDialog id: createQualityDialog
title: catalog.i18nc("@title:window", "Create Profile") title: catalog.i18nc("@title:window", "Create Profile")
@ -233,7 +233,7 @@ UM.ManagementPage
} }
// Dialog to request a name when duplicating a new profile // Dialog to request a name when duplicating a new profile
UM.RenameDialog Cura.RenameDialog
{ {
id: duplicateQualityDialog id: duplicateQualityDialog
title: catalog.i18nc("@title:window", "Duplicate Profile") title: catalog.i18nc("@title:window", "Duplicate Profile")
@ -245,7 +245,7 @@ UM.ManagementPage
} }
// Confirmation dialog for removing a profile // Confirmation dialog for removing a profile
UM.MessageDialog Cura.MessageDialog
{ {
id: confirmRemoveQualityDialog id: confirmRemoveQualityDialog
@ -263,7 +263,7 @@ UM.ManagementPage
} }
// Dialog to rename a quality profile // Dialog to rename a quality profile
UM.RenameDialog Cura.RenameDialog
{ {
id: renameQualityDialog id: renameQualityDialog
title: catalog.i18nc("@title:window", "Rename Profile") title: catalog.i18nc("@title:window", "Rename Profile")
@ -293,11 +293,6 @@ UM.ManagementPage
} }
} }
SystemPalette
{
id: palette
}
Column Column
{ {
id: detailsPanelHeaderColumn id: detailsPanelHeaderColumn

View file

@ -0,0 +1,86 @@
// Copyright (c) 2022 Ultimaker B.V.
// Uranium is released under the terms of the LGPLv3 or higher.
import QtQuick 2.1
import QtQuick.Controls 2.0
import QtQuick.Window 2.1
import UM 1.5 as UM
import Cura 1.0 as Cura
UM.Dialog
{
id: base
buttonSpacing: UM.Theme.getSize("default_margin").width
property string object: ""
property alias newName: nameField.text
property bool validName: true
property string validationError
property string dialogTitle: catalog.i18nc("@title:window", "Rename")
property string explanation: catalog.i18nc("@info", "Please provide a new name.")
title: dialogTitle
minimumWidth: UM.Theme.getSize("small_popup_dialog").width
minimumHeight: UM.Theme.getSize("small_popup_dialog").height
width: minimumWidth
height: minimumHeight
property variant catalog: UM.I18nCatalog { name: "cura" }
signal textChanged(string text)
signal selectText()
onSelectText:
{
nameField.selectAll();
nameField.focus = true;
}
Column
{
anchors.fill: parent
UM.Label
{
text: base.explanation + "\n" //Newline to make some space using system theming.
width: parent.width
wrapMode: Text.WordWrap
}
Cura.TextField
{
id: nameField
width: parent.width
text: base.object
maximumLength: 40
selectByMouse: true
onTextChanged: base.textChanged(text)
}
UM.Label
{
visible: !base.validName
text: base.validationError
}
}
rightButtons: [
Cura.SecondaryButton
{
id: cancelButton
text: catalog.i18nc("@action:button","Cancel")
onClicked: base.reject()
},
Cura.PrimaryButton
{
id: okButton
text: catalog.i18nc("@action:button", "OK")
onClicked: base.accept()
enabled: base.validName
}
]
}

View file

@ -84,7 +84,7 @@ UM.PreferencesPage
} }
} }
TextField Cura.TextField
{ {
id: filter id: filter
@ -105,7 +105,7 @@ UM.PreferencesPage
Cura.ComboBox Cura.ComboBox
{ {
id: visibilityPreset id: visibilityPreset
width: 150 * screenScaleFactor width: UM.Theme.getSize("action_button").width
anchors anchors
{ {
top: parent.top top: parent.top
@ -189,7 +189,6 @@ UM.PreferencesPage
} }
UM.I18nCatalog { name: "cura" } UM.I18nCatalog { name: "cura" }
SystemPalette { id: palette }
Component Component
{ {

View file

@ -36,7 +36,7 @@ ToolButton
{ {
target: background target: background
color: UM.Theme.getColor("setting_control_disabled") color: UM.Theme.getColor("setting_control_disabled")
border.color: UM.Theme.getColor("setting_control_disabled_border") liningColor: UM.Theme.getColor("setting_control_disabled_border")
} }
}, },
State State
@ -47,7 +47,7 @@ ToolButton
{ {
target: background target: background
color: UM.Theme.getColor("setting_validation_error_background") color: UM.Theme.getColor("setting_validation_error_background")
border.color: UM.Theme.getColor("setting_validation_error") liningColor: UM.Theme.getColor("setting_validation_error")
} }
}, },
State State
@ -58,7 +58,7 @@ ToolButton
{ {
target: background target: background
color: UM.Theme.getColor("setting_validation_warning_background") color: UM.Theme.getColor("setting_validation_warning_background")
border.color: UM.Theme.getColor("setting_validation_warning") liningColor: UM.Theme.getColor("setting_validation_warning")
} }
}, },
State State
@ -69,7 +69,7 @@ ToolButton
{ {
target: background target: background
color: UM.Theme.getColor("setting_control") color: UM.Theme.getColor("setting_control")
border.color: UM.Theme.getColor("setting_control_border_highlight") liningColor: UM.Theme.getColor("border_main_light")
} }
}, },
State State
@ -80,20 +80,15 @@ ToolButton
{ {
target: background target: background
color: UM.Theme.getColor("setting_control") color: UM.Theme.getColor("setting_control")
border.color: UM.Theme.getColor("setting_control_border") liningColor: UM.Theme.getColor("border_field_light")
} }
} }
] ]
background: Rectangle background: UM.UnderlineBackground
{ {
id: background id: background
radius: UM.Theme.getSize("setting_control_radius").width
border.width: UM.Theme.getSize("default_lining").width
color: UM.Theme.getColor("setting_control")
border.color: UM.Theme.getColor("setting_control_border")
UM.RecolorImage UM.RecolorImage
{ {
id: downArrow id: downArrow

View file

@ -126,13 +126,10 @@ Item
} }
} }
background: Rectangle background: UM.UnderlineBackground
{ {
id: backgroundItem id: backgroundItem
border.color: intentSelection.hovered ? UM.Theme.getColor("setting_control_border_highlight") : UM.Theme.getColor("setting_control_border") liningColor: intentSelection.hovered ? UM.Theme.getColor("border_main_light") : UM.Theme.getColor("border_field_light")
border.width: UM.Theme.getSize("default_lining").width
radius: UM.Theme.getSize("default_radius").width
color: UM.Theme.getColor("main_background")
} }
UM.SimpleButton UM.SimpleButton

View file

@ -1,9 +1,8 @@
// Copyright (c) 2018 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 1.4 import QtQuick.Controls 2.15
import QtQuick.Controls.Styles 1.4
import UM 1.5 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
@ -87,10 +86,9 @@ Item
width: parent.width width: parent.width
height: UM.Theme.getSize("print_setup_slider_handle").height // The handle is the widest element of the slider height: UM.Theme.getSize("print_setup_slider_handle").height // The handle is the widest element of the slider
minimumValue: 0 from: 0
maximumValue: 100 to: 100
stepSize: 1 stepSize: 1
tickmarksEnabled: true
// disable slider when gradual support is enabled // disable slider when gradual support is enabled
enabled: parseInt(infillSteps.properties.value) == 0 enabled: parseInt(infillSteps.properties.value) == 0
@ -98,53 +96,37 @@ Item
// set initial value from stack // set initial value from stack
value: parseInt(infillDensity.properties.value) value: parseInt(infillDensity.properties.value)
style: SliderStyle //Draw line
background: Rectangle
{ {
//Draw line id: backgroundLine
groove: Item height: UM.Theme.getSize("print_setup_slider_groove").height
{ width: infillSlider.width - UM.Theme.getSize("print_setup_slider_handle").width
Rectangle anchors.horizontalCenter: parent.horizontalCenter
{ anchors.verticalCenter: parent.verticalCenter
height: UM.Theme.getSize("print_setup_slider_groove").height color: infillSlider.enabled ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable")
width: control.width - UM.Theme.getSize("print_setup_slider_handle").width
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
color: control.enabled ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable")
}
}
handle: Rectangle Repeater
{
id: handleButton
color: control.enabled ? UM.Theme.getColor("primary") : UM.Theme.getColor("quality_slider_unavailable")
implicitWidth: UM.Theme.getSize("print_setup_slider_handle").width
implicitHeight: implicitWidth
radius: Math.round(implicitWidth / 2)
border.color: UM.Theme.getColor("slider_groove_fill")
border.width: UM.Theme.getSize("default_lining").height
}
tickmarks: Repeater
{ {
id: repeater id: repeater
model: control.maximumValue / control.stepSize + 1 anchors.fill: parent
model: infillSlider.to / infillSlider.stepSize + 1
Rectangle Rectangle
{ {
color: control.enabled ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable") color: infillSlider.enabled ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable")
implicitWidth: UM.Theme.getSize("print_setup_slider_tickmarks").width implicitWidth: UM.Theme.getSize("print_setup_slider_tickmarks").width
implicitHeight: UM.Theme.getSize("print_setup_slider_tickmarks").height implicitHeight: UM.Theme.getSize("print_setup_slider_tickmarks").height
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
// Do not use Math.round otherwise the tickmarks won't be aligned // Do not use Math.round otherwise the tickmarks won't be aligned
x: ((styleData.handleWidth / 2) - (implicitWidth / 2) + (index * ((repeater.width - styleData.handleWidth) / (repeater.count-1)))) x: ((handleButton.width / 2) - (backgroundLine.implicitWidth / 2) + (index * ((repeater.width - handleButton.width) / (repeater.count-1))))
radius: Math.round(implicitWidth / 2) radius: Math.round(backgroundLine.implicitWidth / 2)
visible: (index % 10) == 0 // Only show steps of 10% visible: (index % 10) == 0 // Only show steps of 10%
Label UM.Label
{ {
text: index text: index
font: UM.Theme.getFont("default")
visible: (index % 20) == 0 // Only show steps of 20% visible: (index % 20) == 0 // Only show steps of 20%
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
y: UM.Theme.getSize("thin_margin").height y: UM.Theme.getSize("thin_margin").height
@ -155,29 +137,46 @@ Item
} }
} }
onValueChanged: handle: Rectangle
{ {
// Don't round the value if it's already the same id: handleButton
if (parseInt(infillDensity.properties.value) == infillSlider.value) x: infillSlider.leftPadding + infillSlider.visualPosition * (infillSlider.availableWidth - width)
y: infillSlider.topPadding + infillSlider.availableHeight / 2 - height / 2
color: infillSlider.enabled ? UM.Theme.getColor("primary") : UM.Theme.getColor("quality_slider_unavailable")
implicitWidth: UM.Theme.getSize("print_setup_slider_handle").width
implicitHeight: implicitWidth
radius: Math.round(implicitWidth / 2)
border.color: UM.Theme.getColor("slider_groove_fill")
border.width: UM.Theme.getSize("default_lining").height
}
Connections
{
target: infillSlider
function onValueChanged()
{ {
return // Don't round the value if it's already the same
} if (parseInt(infillDensity.properties.value) == infillSlider.value)
{
return
}
// Round the slider value to the nearest multiple of 10 (simulate step size of 10) // Round the slider value to the nearest multiple of 10 (simulate step size of 10)
var roundedSliderValue = Math.round(infillSlider.value / 10) * 10 var roundedSliderValue = Math.round(infillSlider.value / 10) * 10
// Update the slider value to represent the rounded value // Update the slider value to represent the rounded value
infillSlider.value = roundedSliderValue infillSlider.value = roundedSliderValue
// Update value only if the Recommended mode is Active, // Update value only if the Recommended mode is Active,
// Otherwise if I change the value in the Custom mode the Recommended view will try to repeat // Otherwise if I change the value in the Custom mode the Recommended view will try to repeat
// same operation // same operation
var active_mode = UM.Preferences.getValue("cura/active_mode") const active_mode = UM.Preferences.getValue("cura/active_mode")
if (active_mode == 0 || active_mode == "simple") if (active_mode == 0 || active_mode == "simple")
{ {
Cura.MachineManager.setSettingForAllExtruders("infill_sparse_density", "value", roundedSliderValue) Cura.MachineManager.setSettingForAllExtruders("infill_sparse_density", "value", roundedSliderValue)
Cura.MachineManager.resetSettingForAllExtruders("infill_line_distance") Cura.MachineManager.resetSettingForAllExtruders("infill_line_distance")
}
} }
} }
} }

View file

@ -1,9 +1,8 @@
// Copyright (c) 2019 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Controls 1.4 import QtQuick.Controls 2.3
import QtQuick.Controls 2.3 as Controls2
import UM 1.2 as UM import UM 1.2 as UM
import Cura 1.6 as Cura import Cura 1.6 as Cura
@ -29,7 +28,7 @@ Item
spacing: UM.Theme.getSize("default_margin").height spacing: UM.Theme.getSize("default_margin").height
Controls2.ButtonGroup ButtonGroup
{ {
id: activeProfileButtonGroup id: activeProfileButtonGroup
exclusive: true exclusive: true

View file

@ -1,9 +1,8 @@
//Copyright (c) 2019 Ultimaker B.V. //Copyright (c) 2022 Ultimaker B.V.
//Cura is released under the terms of the LGPLv3 or higher. //Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.1 import QtQuick.Controls 2.1
import QtQuick.Layouts 1.1
import UM 1.2 as UM import UM 1.2 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
@ -35,17 +34,17 @@ Item
id: background id: background
anchors.fill: parent anchors.fill: parent
Label //Extruder name. // Extruder name.
UM.Label
{ {
text: Cura.MachineManager.activeMachine.extruderList[position].name !== "" ? Cura.MachineManager.activeMachine.extruderList[position].name : catalog.i18nc("@label", "Extruder") text: Cura.MachineManager.activeMachine.extruderList[position].name !== "" ? Cura.MachineManager.activeMachine.extruderList[position].name : catalog.i18nc("@label", "Extruder")
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("default")
anchors.left: parent.left anchors.left: parent.left
anchors.top: parent.top anchors.top: parent.top
anchors.margins: UM.Theme.getSize("default_margin").width anchors.margins: UM.Theme.getSize("default_margin").width
} }
Label //Target temperature. // Target temperature.
UM.Label
{ {
id: extruderTargetTemperature id: extruderTargetTemperature
text: Math.round(extruderModel.targetHotendTemperature) + "°C" text: Math.round(extruderModel.targetHotendTemperature) + "°C"
@ -55,7 +54,8 @@ Item
anchors.rightMargin: UM.Theme.getSize("default_margin").width anchors.rightMargin: UM.Theme.getSize("default_margin").width
anchors.bottom: extruderCurrentTemperature.bottom anchors.bottom: extruderCurrentTemperature.bottom
MouseArea //For tooltip. //For tooltip.
MouseArea
{ {
id: extruderTargetTemperatureTooltipArea id: extruderTargetTemperatureTooltipArea
hoverEnabled: true hoverEnabled: true
@ -77,17 +77,20 @@ Item
} }
} }
} }
Label //Temperature indication.
//Temperature indication.
UM.Label
{ {
id: extruderCurrentTemperature id: extruderCurrentTemperature
text: Math.round(extruderModel.hotendTemperature) + "°C" text: Math.round(extruderModel.hotendTemperature) + "°C"
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("large_bold") font: UM.Theme.getFont("large_bold")
anchors.right: extruderTargetTemperature.left anchors.right: extruderTargetTemperature.left
anchors.top: parent.top anchors.top: parent.top
anchors.margins: UM.Theme.getSize("default_margin").width anchors.margins: UM.Theme.getSize("default_margin").width
MouseArea //For tooltip.
//For tooltip.
MouseArea
{ {
id: extruderCurrentTemperatureTooltipArea id: extruderCurrentTemperatureTooltipArea
hoverEnabled: true hoverEnabled: true
@ -110,7 +113,8 @@ Item
} }
} }
Rectangle //Input field for pre-heat temperature. //Input field for pre-heat temperature.
Rectangle
{ {
id: preheatTemperatureControl id: preheatTemperatureControl
color: !enabled ? UM.Theme.getColor("setting_control_disabled") : showError ? UM.Theme.getColor("setting_validation_error_background") : UM.Theme.getColor("setting_validation_ok") color: !enabled ? UM.Theme.getColor("setting_control_disabled") : showError ? UM.Theme.getColor("setting_validation_error_background") : UM.Theme.getColor("setting_validation_ok")
@ -152,14 +156,16 @@ Item
width: UM.Theme.getSize("monitor_preheat_temperature_control").width width: UM.Theme.getSize("monitor_preheat_temperature_control").width
height: UM.Theme.getSize("monitor_preheat_temperature_control").height height: UM.Theme.getSize("monitor_preheat_temperature_control").height
visible: extruderModel != null ? enabled && extruderModel.canPreHeatHotends && !extruderModel.isPreheating : true visible: extruderModel != null ? enabled && extruderModel.canPreHeatHotends && !extruderModel.isPreheating : true
Rectangle //Highlight of input field. //Highlight of input field.
Rectangle
{ {
anchors.fill: parent anchors.fill: parent
anchors.margins: UM.Theme.getSize("default_lining").width anchors.margins: UM.Theme.getSize("default_lining").width
color: UM.Theme.getColor("setting_control_highlight") color: UM.Theme.getColor("setting_control_highlight")
opacity: preheatTemperatureControl.hovered ? 1.0 : 0 opacity: preheatTemperatureControl.hovered ? 1.0 : 0
} }
MouseArea //Change cursor on hovering. //Change cursor on hovering.
MouseArea
{ {
id: preheatTemperatureInputMouseArea id: preheatTemperatureInputMouseArea
hoverEnabled: true hoverEnabled: true
@ -182,7 +188,7 @@ Item
} }
} }
} }
Label UM.Label
{ {
id: unit id: unit
anchors.right: parent.right anchors.right: parent.right
@ -191,7 +197,6 @@ Item
text: "°C"; text: "°C";
color: UM.Theme.getColor("setting_unit") color: UM.Theme.getColor("setting_unit")
font: UM.Theme.getFont("default")
} }
TextInput TextInput
{ {
@ -299,7 +304,8 @@ Item
} }
} }
Rectangle //Material colour indication. //Material colour indication.
Rectangle
{ {
id: materialColor id: materialColor
width: Math.floor(materialName.height * 0.75) width: Math.floor(materialName.height * 0.75)
@ -313,7 +319,8 @@ Item
anchors.leftMargin: UM.Theme.getSize("default_margin").width anchors.leftMargin: UM.Theme.getSize("default_margin").width
anchors.verticalCenter: materialName.verticalCenter anchors.verticalCenter: materialName.verticalCenter
MouseArea //For tooltip. //For tooltip.
MouseArea
{ {
id: materialColorTooltipArea id: materialColorTooltipArea
hoverEnabled: true hoverEnabled: true
@ -335,17 +342,17 @@ Item
} }
} }
} }
Label //Material name. //Material name.
UM.Label
{ {
id: materialName id: materialName
text: extruderModel.activeMaterial != null ? extruderModel.activeMaterial.type : "" text: extruderModel.activeMaterial != null ? extruderModel.activeMaterial.type : ""
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
anchors.left: materialColor.right anchors.left: materialColor.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.margins: UM.Theme.getSize("default_margin").width anchors.margins: UM.Theme.getSize("default_margin").width
MouseArea //For tooltip. //For tooltip.
MouseArea
{ {
id: materialNameTooltipArea id: materialNameTooltipArea
hoverEnabled: true hoverEnabled: true
@ -367,17 +374,18 @@ Item
} }
} }
} }
Label //Variant name.
//Variant name.
UM.Label
{ {
id: variantName id: variantName
text: extruderModel.hotendID text: extruderModel.hotendID
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
anchors.right: parent.right anchors.right: parent.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.margins: UM.Theme.getSize("default_margin").width anchors.margins: UM.Theme.getSize("default_margin").width
MouseArea //For tooltip. //For tooltip.
MouseArea
{ {
id: variantNameTooltipArea id: variantNameTooltipArea
hoverEnabled: true hoverEnabled: true
@ -388,7 +396,7 @@ Item
{ {
base.showTooltip( base.showTooltip(
base, base,
{x: 0, y: parent.mapToItem(base, 0, -parent.height / 4).y}, { x: 0, y: parent.mapToItem(base, 0, -parent.height / 4).y },
catalog.i18nc("@tooltip", "The nozzle inserted in this extruder.") catalog.i18nc("@tooltip", "The nozzle inserted in this extruder.")
); );
} }

View file

@ -1,9 +1,8 @@
// Copyright (c) 2017 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Controls 1.4 import QtQuick.Controls 2.4
import QtQuick.Layouts 1.3
import UM 1.2 as UM import UM 1.2 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
@ -20,17 +19,17 @@ Item
color: UM.Theme.getColor("main_background") color: UM.Theme.getColor("main_background")
anchors.fill: parent anchors.fill: parent
Label //Build plate label. // Build plate label.
UM.Label
{ {
text: catalog.i18nc("@label", "Build plate") text: catalog.i18nc("@label", "Build plate")
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
anchors.left: parent.left anchors.left: parent.left
anchors.top: parent.top anchors.top: parent.top
anchors.margins: UM.Theme.getSize("default_margin").width anchors.margins: UM.Theme.getSize("default_margin").width
} }
Label //Target temperature. // Target temperature.
UM.Label
{ {
id: bedTargetTemperature id: bedTargetTemperature
text: printerModel != null ? printerModel.targetBedTemperature + "°C" : "" text: printerModel != null ? printerModel.targetBedTemperature + "°C" : ""
@ -40,7 +39,8 @@ Item
anchors.rightMargin: UM.Theme.getSize("default_margin").width anchors.rightMargin: UM.Theme.getSize("default_margin").width
anchors.bottom: bedCurrentTemperature.bottom anchors.bottom: bedCurrentTemperature.bottom
MouseArea //For tooltip. // For tooltip.
MouseArea
{ {
id: bedTargetTemperatureTooltipArea id: bedTargetTemperatureTooltipArea
hoverEnabled: true hoverEnabled: true
@ -62,17 +62,18 @@ Item
} }
} }
} }
Label //Current temperature. // Current temperature.
UM.Label
{ {
id: bedCurrentTemperature id: bedCurrentTemperature
text: printerModel != null ? printerModel.bedTemperature + "°C" : "" text: printerModel != null ? printerModel.bedTemperature + "°C" : ""
font: UM.Theme.getFont("large_bold") font: UM.Theme.getFont("large_bold")
color: UM.Theme.getColor("text")
anchors.right: bedTargetTemperature.left anchors.right: bedTargetTemperature.left
anchors.top: parent.top anchors.top: parent.top
anchors.margins: UM.Theme.getSize("default_margin").width anchors.margins: UM.Theme.getSize("default_margin").width
MouseArea //For tooltip. //For tooltip.
MouseArea
{ {
id: bedTemperatureTooltipArea id: bedTemperatureTooltipArea
hoverEnabled: true hoverEnabled: true
@ -94,7 +95,8 @@ Item
} }
} }
} }
Rectangle //Input field for pre-heat temperature. //Input field for pre-heat temperature.
Rectangle
{ {
id: preheatTemperatureControl id: preheatTemperatureControl
color: !enabled ? UM.Theme.getColor("setting_control_disabled") : showError ? UM.Theme.getColor("setting_validation_error_background") : UM.Theme.getColor("setting_validation_ok") color: !enabled ? UM.Theme.getColor("setting_control_disabled") : showError ? UM.Theme.getColor("setting_validation_error_background") : UM.Theme.getColor("setting_validation_ok")
@ -166,7 +168,7 @@ Item
} }
} }
} }
Label UM.Label
{ {
id: unit id: unit
anchors.right: parent.right anchors.right: parent.right
@ -175,7 +177,6 @@ Item
text: "°C"; text: "°C";
color: UM.Theme.getColor("setting_unit") color: UM.Theme.getColor("setting_unit")
font: UM.Theme.getFont("default")
} }
TextInput TextInput
{ {
@ -213,7 +214,8 @@ Item
} }
} }
Cura.SecondaryButton // The pre-heat button. // The pre-heat button.
Cura.SecondaryButton
{ {
id: preheatButton id: preheatButton
height: UM.Theme.getSize("setting_control").height height: UM.Theme.getSize("setting_control").height
@ -248,14 +250,15 @@ Item
text: text:
{ {
if(printerModel == null) if (printerModel == null)
{ {
return "" return ""
} }
if(printerModel.isPreheating ) if (printerModel.isPreheating )
{ {
return catalog.i18nc("@button Cancel pre-heating", "Cancel") return catalog.i18nc("@button Cancel pre-heating", "Cancel")
} else }
else
{ {
return catalog.i18nc("@button", "Pre-heat") return catalog.i18nc("@button", "Pre-heat")
} }
@ -279,7 +282,7 @@ Item
{ {
base.showTooltip( base.showTooltip(
base, base,
{x: 0, y: preheatButton.mapToItem(base, 0, 0).y}, { x: 0, y: preheatButton.mapToItem(base, 0, 0).y },
catalog.i18nc("@tooltip of pre-heat", "Heat the bed in advance before printing. You can continue adjusting your print while it is heating, and you won't have to wait for the bed to heat up when you're ready to print.") catalog.i18nc("@tooltip of pre-heat", "Heat the bed in advance before printing. You can continue adjusting your print while it is heating, and you won't have to wait for the bed to heat up when you're ready to print.")
); );
} }

View file

@ -3,7 +3,6 @@
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Controls 2.1 import QtQuick.Controls 2.1
import QtQuick.Layouts 1.3
import UM 1.5 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura

View file

@ -1,8 +1,7 @@
// Copyright (c) 2017 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Layouts 1.1
import UM 1.5 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura

View file

@ -1,7 +1,9 @@
// Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.1 import QtQuick.Controls 2.1
import QtQuick.Layouts 1.1
import UM 1.2 as UM import UM 1.2 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
@ -27,7 +29,7 @@ Item
height: childrenRect.height height: childrenRect.height
color: UM.Theme.getColor("setting_category") color: UM.Theme.getColor("setting_category")
Label UM.Label
{ {
id: outputDeviceNameLabel id: outputDeviceNameLabel
font: UM.Theme.getFont("large_bold") font: UM.Theme.getFont("large_bold")
@ -38,7 +40,7 @@ Item
text: outputDevice != null ? outputDevice.activePrinter.name : "" text: outputDevice != null ? outputDevice.activePrinter.name : ""
} }
Label UM.Label
{ {
id: outputDeviceAddressLabel id: outputDeviceAddressLabel
text: (outputDevice != null && outputDevice.address != null) ? outputDevice.address : "" text: (outputDevice != null && outputDevice.address != null) ? outputDevice.address : ""
@ -49,11 +51,10 @@ Item
anchors.margins: UM.Theme.getSize("default_margin").width anchors.margins: UM.Theme.getSize("default_margin").width
} }
Label UM.Label
{ {
text: outputDevice != null ? "" : catalog.i18nc("@info:status", "The printer is not connected.") text: outputDevice != null ? "" : catalog.i18nc("@info:status", "The printer is not connected.")
color: outputDevice != null && outputDevice.acceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text") color: outputDevice != null && outputDevice.acceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
font: UM.Theme.getFont("default")
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width anchors.leftMargin: UM.Theme.getSize("default_margin").width

View file

@ -11,7 +11,7 @@ Cura.ActionButton
{ {
color: UM.Theme.getColor("secondary_button") color: UM.Theme.getColor("secondary_button")
textColor: UM.Theme.getColor("secondary_button_text") textColor: UM.Theme.getColor("secondary_button_text")
outlineColor: UM.Theme.getColor("secondary_button_text") outlineColor: UM.Theme.getColor("border_accent_1")
disabledColor: UM.Theme.getColor("action_button_disabled") disabledColor: UM.Theme.getColor("action_button_disabled")
textDisabledColor: UM.Theme.getColor("action_button_disabled_text") textDisabledColor: UM.Theme.getColor("action_button_disabled_text")
hoverColor: UM.Theme.getColor("secondary_button_hover") hoverColor: UM.Theme.getColor("secondary_button_hover")

View file

@ -5,14 +5,14 @@ import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import UM 1.5 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.5 as Cura
SettingItem SettingItem
{ {
id: base id: base
property var focusItem: control property var focusItem: control
contents: ComboBox contents: Cura.ComboBox
{ {
id: control id: control
anchors.fill: parent anchors.fill: parent
@ -113,7 +113,7 @@ SettingItem
color: UM.Theme.getColor("setting_control_button"); color: UM.Theme.getColor("setting_control_button");
} }
background: Rectangle background: UM.UnderlineBackground
{ {
color: color:
{ {
@ -127,9 +127,7 @@ SettingItem
} }
return UM.Theme.getColor("setting_control") return UM.Theme.getColor("setting_control")
} }
radius: UM.Theme.getSize("setting_control_radius").width liningColor:
border.width: UM.Theme.getSize("default_lining").width
border.color:
{ {
if (!enabled) if (!enabled)
{ {
@ -137,9 +135,9 @@ SettingItem
} }
if (control.hovered || control.activeFocus) if (control.hovered || control.activeFocus)
{ {
return UM.Theme.getColor("setting_control_border_highlight") return UM.Theme.getColor("border_main_light")
} }
return UM.Theme.getColor("setting_control_border") return UM.Theme.getColor("border_field_light")
} }
} }
@ -227,7 +225,6 @@ SettingItem
background: Rectangle background: Rectangle
{ {
color: parent.highlighted ? UM.Theme.getColor("setting_control_highlight") : "transparent" color: parent.highlighted ? UM.Theme.getColor("setting_control_highlight") : "transparent"
border.color: parent.highlighted ? UM.Theme.getColor("setting_control_border_highlight") : "transparent"
} }
} }
} }

View file

@ -5,7 +5,7 @@ import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import UM 1.5 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.5 as Cura
SettingItem SettingItem
{ {
@ -19,7 +19,7 @@ SettingItem
// this extra property to keep the ExtrudersModel and use this in the rest of the code. // this extra property to keep the ExtrudersModel and use this in the rest of the code.
property var extrudersWithOptionalModel: CuraApplication.getExtrudersModelWithOptional() property var extrudersWithOptionalModel: CuraApplication.getExtrudersModelWithOptional()
contents: ComboBox contents: Cura.ComboBox
{ {
id: control id: control
anchors.fill: parent anchors.fill: parent
@ -111,26 +111,24 @@ SettingItem
sourceSize.width: width + 5 * screenScaleFactor sourceSize.width: width + 5 * screenScaleFactor
sourceSize.height: width + 5 * screenScaleFactor sourceSize.height: width + 5 * screenScaleFactor
color: UM.Theme.getColor("setting_control_button"); color: UM.Theme.getColor("setting_control_button")
} }
background: Rectangle background: UM.UnderlineBackground
{ {
color: color:
{ {
if (!enabled) if (!enabled)
{ {
return UM.Theme.getColor("setting_control_disabled"); return UM.Theme.getColor("setting_control_disabled")
} }
if (control.hovered || control.activeFocus) if (control.hovered || base.activeFocus)
{ {
return UM.Theme.getColor("setting_control_highlight"); return UM.Theme.getColor("setting_control_highlight")
} }
return UM.Theme.getColor("setting_control"); return UM.Theme.getColor("setting_control")
} }
radius: UM.Theme.getSize("setting_control_radius").width liningColor:
border.width: UM.Theme.getSize("default_lining").width
border.color:
{ {
if (!enabled) if (!enabled)
{ {
@ -138,9 +136,9 @@ SettingItem
} }
if (control.hovered || control.activeFocus) if (control.hovered || control.activeFocus)
{ {
return UM.Theme.getColor("setting_control_border_highlight") return UM.Theme.getColor("border_main_light")
} }
return UM.Theme.getColor("setting_control_border") return UM.Theme.getColor("border_field_light")
} }
} }
@ -214,7 +212,7 @@ SettingItem
if (model.enabled) { if (model.enabled) {
UM.Theme.getColor("setting_control_text") UM.Theme.getColor("setting_control_text")
} else { } else {
UM.Theme.getColor("action_button_disabled_text"); UM.Theme.getColor("action_button_disabled_text")
} }
} }
elide: Text.ElideRight elide: Text.ElideRight
@ -237,7 +235,6 @@ SettingItem
background: Rectangle background: Rectangle
{ {
color: parent.highlighted ? UM.Theme.getColor("setting_control_highlight") : "transparent" color: parent.highlighted ? UM.Theme.getColor("setting_control_highlight") : "transparent"
border.color: parent.highlighted ? UM.Theme.getColor("setting_control_border_highlight") : "transparent"
} }
} }
} }

View file

@ -26,15 +26,13 @@ SettingItem
} }
} }
contents: Rectangle contents: UM.UnderlineBackground
{ {
id: control id: control
anchors.fill: parent anchors.fill: parent
radius: UM.Theme.getSize("setting_control_radius").width liningColor:
border.width: UM.Theme.getSize("default_lining").width
border.color:
{ {
if(!enabled) if(!enabled)
{ {
@ -54,9 +52,9 @@ SettingItem
//Validation is OK. //Validation is OK.
if(hovered || input.activeFocus) if(hovered || input.activeFocus)
{ {
return UM.Theme.getColor("setting_control_border_highlight") return UM.Theme.getColor("border_main_light")
} }
return UM.Theme.getColor("setting_control_border") return UM.Theme.getColor("border_field_light")
} }
color: { color: {

View file

@ -409,7 +409,7 @@ Item
} }
} }
Menu Cura.Menu
{ {
id: contextMenu id: contextMenu

View file

@ -4,6 +4,9 @@
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 2.15 import QtQuick.Controls 2.15
import UM 1.5 as UM
import Cura 1.5 as Cura
// This component extends the funtionality of QtControls 2.x Spinboxes to // This component extends the funtionality of QtControls 2.x Spinboxes to
// - be able to contain fractional values // - be able to contain fractional values
// - hava a "prefix" and a "suffix". A validator is added that recognizes this pre-, suf-fix combo. When adding a custom // - hava a "prefix" and a "suffix". A validator is added that recognizes this pre-, suf-fix combo. When adding a custom
@ -33,11 +36,15 @@ Item
signal editingFinished() signal editingFinished()
implicitWidth: spinBox.implicitWidth implicitWidth: spinBox.implicitWidth
implicitHeight: spinBox.implicitHeight implicitHeight: spinBox.implicitHeight
SpinBox SpinBox
{ {
id: spinBox id: spinBox
anchors.fill: base anchors.fill: base
editable: base.editable editable: base.editable
topPadding: 0
bottomPadding: 0
padding: UM.Theme.getSize("narrow_margin").width
// The stepSize of the SpinBox is intentionally set to be always `1` // The stepSize of the SpinBox is intentionally set to be always `1`
// As SpinBoxes can only contain integer values the `base.stepSize` is concidered the precision/resolution // As SpinBoxes can only contain integer values the `base.stepSize` is concidered the precision/resolution
@ -65,20 +72,60 @@ Item
base.value = value * base.stepSize; base.value = value * base.stepSize;
} }
contentItem: TextField background: Item {}
contentItem: Cura.TextField
{ {
text: spinBox.textFromValue(spinBox.value, spinBox.locale) text: spinBox.textFromValue(spinBox.value, spinBox.locale)
selectByMouse: base.editable
background: Item {}
validator: base.validator validator: base.validator
onActiveFocusChanged: onActiveFocusChanged:
{ {
if(!activeFocus) if (!activeFocus)
{ {
base.editingFinished(); base.editingFinished();
} }
} }
} }
down.indicator: Rectangle
{
x: spinBox.mirrored ? parent.width - width : 0
height: parent.height
width: height
UM.UnderlineBackground {
color: spinBox.down.pressed ? spinBox.palette.mid : UM.Theme.getColor("detail_background")
}
UM.RecolorImage
{
anchors.centerIn: parent
height: parent.height / 2.5
width: height
color: enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("text_disabled")
source: UM.Theme.getIcon("Minus")
}
}
up.indicator: Rectangle
{
x: spinBox.mirrored ? 0 : parent.width - width
height: parent.height
width: height
UM.UnderlineBackground {
color: spinBox.up.pressed ? spinBox.palette.mid : UM.Theme.getColor("detail_background")
}
UM.RecolorImage
{
anchors.centerIn: parent
height: parent.height / 2.5
width: height
color: enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("text_disabled")
source: UM.Theme.getIcon("Plus")
}
}
} }
} }

View file

@ -26,29 +26,18 @@ ComboBox
{ {
name: "disabled" name: "disabled"
when: !control.enabled when: !control.enabled
PropertyChanges { target: backgroundRectangle.border; color: UM.Theme.getColor("setting_control_disabled_border")} PropertyChanges { target: background; color: UM.Theme.getColor("setting_control_disabled")}
PropertyChanges { target: backgroundRectangle; color: UM.Theme.getColor("setting_control_disabled")}
PropertyChanges { target: contentLabel; color: UM.Theme.getColor("setting_control_disabled_text")} PropertyChanges { target: contentLabel; color: UM.Theme.getColor("setting_control_disabled_text")}
}, },
State State
{ {
name: "highlighted" name: "highlighted"
when: control.hovered || control.activeFocus when: control.hovered || control.activeFocus
PropertyChanges { target: backgroundRectangle.border; color: UM.Theme.getColor("setting_control_border_highlight") } PropertyChanges { target: background; liningColor: UM.Theme.getColor("border_main_light")}
PropertyChanges { target: backgroundRectangle; color: UM.Theme.getColor("setting_control_highlight")}
} }
] ]
background: Rectangle background: UM.UnderlineBackground{}
{
id: backgroundRectangle
color: UM.Theme.getColor("setting_control")
radius: UM.Theme.getSize("setting_control_radius").width
border.width: UM.Theme.getSize("default_lining").width
border.color: UM.Theme.getColor("setting_control_border")
}
indicator: UM.RecolorImage indicator: UM.RecolorImage
{ {
@ -157,7 +146,6 @@ ComboBox
Rectangle Rectangle
{ {
color: delegateItem.highlighted ? UM.Theme.getColor("setting_control_highlight") : "transparent" color: delegateItem.highlighted ? UM.Theme.getColor("setting_control_highlight") : "transparent"
border.color: delegateItem.highlighted ? UM.Theme.getColor("setting_control_border_highlight") : "transparent"
anchors.fill: parent anchors.fill: parent
} }
text: delegateLabel.truncated ? delegateItem.text : "" text: delegateLabel.truncated ? delegateItem.text : ""

View file

@ -21,7 +21,7 @@ UM.Menu
delegate: Cura.MenuItem {} delegate: Cura.MenuItem {}
background: Rectangle background: Rectangle
{ {
color: UM.Theme.getColor("setting_control") color: UM.Theme.getColor("main_background")
border.color: UM.Theme.getColor("setting_control_border") border.color: UM.Theme.getColor("lining")
} }
} }

View file

@ -48,7 +48,6 @@ UM.MenuItem
y: UM.Theme.getSize("default_lining").width y: UM.Theme.getSize("default_lining").width
width: menuItem.width - 2 * UM.Theme.getSize("default_lining").width width: menuItem.width - 2 * UM.Theme.getSize("default_lining").width
height: menuItem.height - 2 * UM.Theme.getSize("default_lining").height height: menuItem.height - 2 * UM.Theme.getSize("default_lining").height
color: menuItem.highlighted ? UM.Theme.getColor("background_2"): UM.Theme.getColor("background_1")
color: menuItem.highlighted ? UM.Theme.getColor("secondary"): UM.Theme.getColor("setting_control_highlight")
} }
} }

View file

@ -17,6 +17,31 @@ RadioButton
font: UM.Theme.getFont("default") font: UM.Theme.getFont("default")
states: [
State {
name: "checked"
when: radioButton.checked
PropertyChanges
{
target: indicator
color: UM.Theme.getColor("accent_1")
border.width: 0
}
},
State
{
name: "disabled"
when: !radioButton.enabled
PropertyChanges { target: indicator; color: UM.Theme.getColor("background_1")}
},
State
{
name: "highlighted"
when: radioButton.hovered || radioButton.activeFocus
PropertyChanges { target: indicator; border.color: UM.Theme.getColor("border_main_light")}
}
]
background: Item background: Item
{ {
anchors.fill: parent anchors.fill: parent
@ -29,8 +54,9 @@ RadioButton
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.alignWhenCentered: false anchors.alignWhenCentered: false
radius: width / 2 radius: width / 2
color: UM.Theme.getColor("background_2")
border.width: UM.Theme.getSize("default_lining").width border.width: UM.Theme.getSize("default_lining").width
border.color: radioButton.hovered ? UM.Theme.getColor("small_button_text") : UM.Theme.getColor("small_button_text_hover") border.color: UM.Theme.getColor("text_disabled")
Rectangle Rectangle
{ {
@ -38,7 +64,7 @@ RadioButton
height: width height: width
anchors.centerIn: parent anchors.centerIn: parent
radius: width / 2 radius: width / 2
color: radioButton.hovered ? UM.Theme.getColor("primary_button_hover") : UM.Theme.getColor("primary_button") color: radioButton.enabled ? UM.Theme.getColor("background_2") : UM.Theme.getColor("background_1")
visible: radioButton.checked visible: radioButton.checked
} }
} }

View file

@ -4,7 +4,7 @@
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import UM 1.3 as UM import UM 1.5 as UM
import Cura 1.1 as Cura import Cura 1.1 as Cura
@ -17,11 +17,14 @@ TextField
property alias leftIcon: iconLeft.source property alias leftIcon: iconLeft.source
height: UM.Theme.getSize("setting_control").height
hoverEnabled: true hoverEnabled: true
selectByMouse: true selectByMouse: true
font: UM.Theme.getFont("default") font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
renderType: Text.NativeRendering renderType: Text.NativeRendering
selectionColor: UM.Theme.getColor("text_selection")
leftPadding: iconLeft.visible ? iconLeft.width + UM.Theme.getSize("default_margin").width * 2 : UM.Theme.getSize("thin_margin").width leftPadding: iconLeft.visible ? iconLeft.width + UM.Theme.getSize("default_margin").width * 2 : UM.Theme.getSize("thin_margin").width
states: [ states: [
@ -29,45 +32,25 @@ TextField
{ {
name: "disabled" name: "disabled"
when: !textField.enabled when: !textField.enabled
PropertyChanges { target: backgroundRectangle.border; color: UM.Theme.getColor("setting_control_disabled_border")}
PropertyChanges { target: backgroundRectangle; color: UM.Theme.getColor("setting_control_disabled")} PropertyChanges { target: backgroundRectangle; color: UM.Theme.getColor("setting_control_disabled")}
}, },
State State
{ {
name: "invalid" name: "invalid"
when: !textField.acceptableInput when: !textField.acceptableInput
PropertyChanges { target: backgroundRectangle.border; color: UM.Theme.getColor("setting_validation_error")}
PropertyChanges { target: backgroundRectangle; color: UM.Theme.getColor("setting_validation_error_background")} PropertyChanges { target: backgroundRectangle; color: UM.Theme.getColor("setting_validation_error_background")}
}, },
State State
{ {
name: "hovered" name: "hovered"
when: textField.hovered || textField.activeFocus when: textField.hovered || textField.activeFocus
PropertyChanges { target: backgroundRectangle.border; color: UM.Theme.getColor("setting_control_border_highlight") } PropertyChanges { target: backgroundRectangle; liningColor: UM.Theme.getColor("border_main_light")}
} }
] ]
background: Rectangle background: UM.UnderlineBackground
{ {
id: backgroundRectangle id: backgroundRectangle
color: UM.Theme.getColor("main_background")
radius: UM.Theme.getSize("setting_control_radius").width
border.color:
{
if (!textField.enabled)
{
return UM.Theme.getColor("setting_control_disabled_border")
}
if (textField.hovered || textField.activeFocus)
{
return UM.Theme.getColor("setting_control_border_highlight")
}
return UM.Theme.getColor("setting_control_border")
}
//Optional icon added on the left hand side. //Optional icon added on the left hand side.
UM.RecolorImage UM.RecolorImage
{ {

View file

@ -47,3 +47,4 @@ GcodeTextArea 1.0 GcodeTextArea.qml
NumericTextFieldWithUnit 1.0 NumericTextFieldWithUnit.qml NumericTextFieldWithUnit 1.0 NumericTextFieldWithUnit.qml
PrintHeadMinMaxTextField 1.0 PrintHeadMinMaxTextField.qml PrintHeadMinMaxTextField 1.0 PrintHeadMinMaxTextField.qml
SimpleCheckBox 1.0 SimpleCheckBox.qml SimpleCheckBox 1.0 SimpleCheckBox.qml
RenameDialog 1.0 RenameDialog.qml

View file

@ -4,41 +4,70 @@
"inherits": "cura-light" "inherits": "cura-light"
}, },
"base_colors":
{
"background_1": [31, 31, 32, 255],
"background_2": [57, 57, 58, 255],
"background_3": [85, 85, 87, 255],
"background_4": [23, 23, 23, 255],
"accent_1": [25, 110, 240, 255],
"accent_2": [16, 70, 156, 255],
"border_main": [212, 212, 212, 255],
"border_accent_1": [255, 255, 255, 255],
"border_accent_2": [16, 70, 156, 255],
"border_field": [57, 57, 58, 255],
"text_default": [255, 255, 255, 255],
"text_disabled": [118, 118, 118, 255],
"text_primary_button": [255, 255, 255, 255],
"text_secondary_button": [255, 255, 255, 255],
"text_link_hover": [156, 195, 255, 255],
"text_lighter": [243, 243, 243, 255]
},
"colors": { "colors": {
"main_background": [39, 44, 48, 255], "main_background": "background_1",
"detail_background": [63, 63, 63, 255], "detail_background": "background_2",
"message_background": [39, 44, 48, 255], "message_background": "background_1",
"wide_lining": [31, 36, 39, 255], "wide_lining": [31, 36, 39, 255],
"thick_lining": [255, 255, 255, 60], "thick_lining": [255, 255, 255, 60],
"lining": [64, 69, 72, 255], "lining": "border_main",
"viewport_overlay": [30, 36, 39, 255], "viewport_overlay": "background_1",
"primary": [12, 169, 227, 255], "primary": [12, 169, 227, 255],
"primary_text": [255, 255, 255, 204], "primary_text": "text_default",
"secondary": [95, 95, 95, 255], "secondary": [95, 95, 95, 255],
"secondary_button": [39, 44, 48, 255], "expandable_active": "background_2",
"secondary_button_hover": [85, 85, 87, 255], "expandable_hover": "background_2",
"secondary_button": "background_1",
"secondary_button_hover": "background_3",
"secondary_button_text": [255, 255, 255, 255], "secondary_button_text": [255, 255, 255, 255],
"icon": [255, 255, 255, 255], "icon": "text_default",
"toolbar_background": [39, 44, 48, 255], "toolbar_background": "background_1",
"toolbar_button_active": [57, 57, 58, 255], "toolbar_button_active": "background_3",
"toolbar_button_hover": [57, 57, 58, 255], "toolbar_button_hover": "background_3",
"toolbar_button_active_hover": [57, 57, 58, 255], "toolbar_button_active_hover": "background_3",
"main_window_header_button_text_inactive": [128, 128, 128, 255], "main_window_header_button_background_inactive": "background_4",
"main_window_header_background": [14, 14, 14, 255], "main_window_header_button_text_inactive": "text_primary_button",
"main_window_header_background_gradient": [32, 32, 32, 255], "main_window_header_button_text_active": "background_4",
"main_window_header_background": "background_4",
"main_window_header_background_gradient": "background_4",
"main_window_header_button_background_hovered": [46, 46, 46, 255], "main_window_header_button_background_hovered": [46, 46, 46, 255],
"secondary_button_text": "text_secondary_button",
"account_sync_state_icon": [255, 255, 255, 204], "account_sync_state_icon": [255, 255, 255, 204],
"machine_selector_printer_icon": [204, 204, 204, 255], "machine_selector_printer_icon": [204, 204, 204, 255],
"text": [255, 255, 255, 204], "text": "text_default",
"text_detail": [255, 255, 255, 172], "text_detail": [255, 255, 255, 172],
"text_link": [25, 110, 240, 255], "text_link": "accent_1",
"text_inactive": [255, 255, 255, 88], "text_inactive": [255, 255, 255, 88],
"text_hover": [255, 255, 255, 204], "text_hover": [255, 255, 255, 204],
"text_scene": [255, 255, 255, 162], "text_scene": [255, 255, 255, 162],
@ -51,7 +80,7 @@
"button": [39, 44, 48, 255], "button": [39, 44, 48, 255],
"button_hover": [39, 44, 48, 255], "button_hover": [39, 44, 48, 255],
"button_text": [255, 255, 255, 197], "button_text": "text_default",
"button_disabled": [39, 44, 48, 255], "button_disabled": [39, 44, 48, 255],
"button_disabled_text": [255, 255, 255, 101], "button_disabled_text": [255, 255, 255, 101],
@ -74,28 +103,37 @@
"tab_active_text": [255, 255, 255, 255], "tab_active_text": [255, 255, 255, 255],
"tab_background": [39, 44, 48, 255], "tab_background": [39, 44, 48, 255],
"action_button": [39, 44, 48, 255], "action_button": "background_1",
"action_button_text": [255, 255, 255, 200],
"action_button_border": "border_main",
"action_button_hovered": [79, 85, 89, 255], "action_button_hovered": [79, 85, 89, 255],
"action_button_disabled": [85, 85, 87, 255], "action_button_hovered_text": "text_default",
"action_button_disabled_text": [103, 103, 104, 255], "action_button_hovered_border": "border_main",
"action_button_active": [39, 44, 48, 30],
"action_button_active_text": "text_default",
"action_button_active_border": [255, 255, 255, 100],
"action_button_disabled": "background_3",
"action_button_disabled_text": "text_disabled",
"action_button_disabled_border": [255, 255, 255, 30],
"scrollbar_background": [39, 44, 48, 0], "scrollbar_background": [39, 44, 48, 0],
"scrollbar_handle": [255, 255, 255, 105], "scrollbar_handle": [255, 255, 255, 105],
"scrollbar_handle_hover": [255, 255, 255, 255], "scrollbar_handle_hover": [255, 255, 255, 255],
"scrollbar_handle_down": [255, 255, 255, 255], "scrollbar_handle_down": [255, 255, 255, 255],
"setting_category": [75, 80, 83, 255], "setting_category": "background_3",
"setting_category_disabled": [75, 80, 83, 255], "setting_category_disabled": [75, 80, 83, 255],
"setting_category_hover": [75, 80, 83, 255], "setting_category_hover": "background_3",
"setting_category_text": [255, 255, 255, 152], "setting_category_text": [255, 255, 255, 152],
"setting_category_disabled_text": [255, 255, 255, 101], "setting_category_disabled_text": [255, 255, 255, 101],
"setting_category_active_text": [255, 255, 255, 204], "setting_category_active_text": [255, 255, 255, 204],
"setting_control": [43, 48, 52, 255], "setting_control": "background_2",
"setting_control_highlight": [43, 48, 52, 255], "setting_control_selected": [34, 39, 42, 38],
"setting_control_highlight": "background_3",
"setting_control_border": [255, 255, 255, 38], "setting_control_border": [255, 255, 255, 38],
"setting_control_border_highlight": [12, 169, 227, 255], "setting_control_border_highlight": [12, 169, 227, 255],
"setting_control_text": [255, 255, 255, 181], "setting_control_text": "text_default",
"setting_control_button": [255, 255, 255, 127], "setting_control_button": [255, 255, 255, 127],
"setting_control_button_hover": [255, 255, 255, 204], "setting_control_button_hover": [255, 255, 255, 204],
"setting_control_disabled": [34, 39, 42, 255], "setting_control_disabled": [34, 39, 42, 255],
@ -106,7 +144,7 @@
"setting_validation_error": [212, 31, 53, 255], "setting_validation_error": [212, 31, 53, 255],
"setting_validation_warning_background": [62, 54, 46, 255], "setting_validation_warning_background": [62, 54, 46, 255],
"setting_validation_warning": [245, 166, 35, 255], "setting_validation_warning": [245, 166, 35, 255],
"setting_validation_ok": [43, 48, 52, 255], "setting_validation_ok": "background_2",
"progressbar_background": [255, 255, 255, 48], "progressbar_background": [255, 255, 255, 48],
"progressbar_control": [255, 255, 255, 197], "progressbar_control": [255, 255, 255, 197],
@ -117,19 +155,23 @@
"slider_handle": [255, 255, 255, 255], "slider_handle": [255, 255, 255, 255],
"slider_handle_active": [68, 192, 255, 255], "slider_handle_active": [68, 192, 255, 255],
"checkbox": [43, 48, 52, 255], "checkbox": "background_1",
"checkbox_hover": [43, 48, 52, 255], "checkbox_hover": [43, 48, 52, 255],
"checkbox_border": [255, 255, 255, 38], "checkbox_border": "text_disabled",
"checkbox_border_hover": [255, 255, 255, 38], "checkbox_border_hover": "border_main",
"checkbox_mark": [255, 255, 255, 181], "checkbox_mark": "text_default",
"checkbox_text": [255, 255, 255, 181], "checkbox_square": "text_disabled",
"checkbox_text": "text_default",
"checkbox_disabled": "background_2",
"tooltip": [39, 44, 48, 255], "category_background": "background_3",
"tooltip_text": [255, 255, 255, 204],
"tool_panel_background": [39, 44, 48, 255], "tooltip": "background_2",
"tooltip_text": "text_default",
"viewport_background": [31, 36, 39, 255], "tool_panel_background": "background_1",
"viewport_background": "background_1",
"volume_outline": [12, 169, 227, 128], "volume_outline": [12, 169, 227, 128],
"buildplate": [169, 169, 169, 255], "buildplate": [169, 169, 169, 255],
"buildplate_grid_minor": [154, 154, 155, 255], "buildplate_grid_minor": [154, 154, 155, 255],
@ -153,8 +195,8 @@
"monitor_card_background": [51, 53, 54, 255], "monitor_card_background": [51, 53, 54, 255],
"monitor_card_hover": [84, 89, 95, 255], "monitor_card_hover": [84, 89, 95, 255],
"monitor_stage_background": [30, 36, 39, 255], "monitor_stage_background": "background_1",
"monitor_stage_background_fade": [30, 36, 39, 102], "monitor_stage_background_fade": "background_1",
"monitor_progress_bar_deactive": [102, 102, 102, 255], "monitor_progress_bar_deactive": [102, 102, 102, 255],
"monitor_progress_bar_empty": [67, 67, 67, 255], "monitor_progress_bar_empty": [67, 67, 67, 255],

View file

@ -170,9 +170,31 @@
} }
}, },
"base_colors": {
"background_1": [255, 255, 255, 255],
"background_2": [243, 243, 243, 255],
"background_3": [232, 240, 253, 255],
"background_4": [3, 12, 66, 255],
"accent_1": [25, 110, 240, 255],
"accent_2": [16, 70, 156, 255],
"border_main": [212, 212, 212, 255],
"border_accent_1": [25, 110, 240, 255],
"border_accent_2": [16, 70, 156, 255],
"border_field": [180, 180, 180, 255],
"text_default": [0, 14, 26, 255],
"text_disabled": [180, 180, 180, 255],
"text_primary_button": [255, 255, 255, 255],
"text_secondary_button": [25, 110, 240, 255],
"text_link_hover": [16, 70, 156, 255],
"text_lighter": [108, 108, 108, 255]
},
"colors": { "colors": {
"main_background": [255, 255, 255, 255],
"detail_background": [243, 243, 243, 255], "main_background": "background_1",
"detail_background": "background_2",
"wide_lining": [245, 245, 245, 255], "wide_lining": [245, 245, 245, 255],
"thick_lining": [180, 180, 180, 255], "thick_lining": [180, 180, 180, 255],
"lining": [192, 193, 194, 255], "lining": [192, 193, 194, 255],
@ -182,18 +204,23 @@
"primary_hover": [48, 182, 231, 255], "primary_hover": [48, 182, 231, 255],
"primary_text": [255, 255, 255, 255], "primary_text": [255, 255, 255, 255],
"text_selection": [156, 195, 255, 127], "text_selection": [156, 195, 255, 127],
"border": [127, 127, 127, 255],
"border_field": [180, 180, 180, 255],
"secondary": [240, 240, 240, 255], "secondary": [240, 240, 240, 255],
"expandable_active": [240, 240, 240, 255],
"expandable_hover": [232, 242, 252, 255],
"icon": [8, 7, 63, 255], "icon": [8, 7, 63, 255],
"primary_button": [25, 110, 240, 255], "primary_button": "accent_1",
"primary_button_hover": [16, 70, 156, 255], "primary_button_hover": [16, 70, 156, 255],
"primary_button_text": [255, 255, 255, 255], "primary_button_text": [255, 255, 255, 255],
"secondary_button": [255, 255, 255, 255], "secondary_button": "background_1",
"secondary_button_shadow": [216, 216, 216, 255], "secondary_button_shadow": [216, 216, 216, 255],
"secondary_button_hover": [232, 240, 253, 255], "secondary_button_hover": [232, 240, 253, 255],
"secondary_button_text": [25, 110, 240, 255], "secondary_button_text": "accent_1",
"main_window_header_background": [8, 7, 63, 255], "main_window_header_background": [8, 7, 63, 255],
"main_window_header_background_gradient": [25, 23, 91, 255], "main_window_header_background_gradient": [25, 23, 91, 255],
@ -209,7 +236,7 @@
"machine_selector_printer_icon": [8, 7, 63, 255], "machine_selector_printer_icon": [8, 7, 63, 255],
"action_panel_secondary": [25, 110, 240, 255], "action_panel_secondary": "accent_1",
"first_run_shadow": [50, 50, 50, 255], "first_run_shadow": [50, 50, 50, 255],
@ -222,6 +249,7 @@
"window_disabled_background": [0, 0, 0, 255], "window_disabled_background": [0, 0, 0, 255],
"text": [25, 25, 25, 255], "text": [25, 25, 25, 255],
"text_disabled": [180, 180, 180, 255],
"text_detail": [174, 174, 174, 128], "text_detail": [174, 174, 174, 128],
"text_link": [25, 110, 240, 255], "text_link": [25, 110, 240, 255],
"text_inactive": [174, 174, 174, 255], "text_inactive": [174, 174, 174, 255],
@ -265,8 +293,8 @@
"setting_category_disabled_text": [24, 41, 77, 101], "setting_category_disabled_text": [24, 41, 77, 101],
"setting_category_active_text": [35, 35, 35, 255], "setting_category_active_text": [35, 35, 35, 255],
"setting_control": [255, 255, 255, 255], "setting_control": "background_2",
"setting_control_highlight": [255, 255, 255, 255], "setting_control_highlight": "background_3",
"setting_control_border": [199, 199, 199, 255], "setting_control_border": [199, 199, 199, 255],
"setting_control_border_highlight": [50, 130, 255, 255], "setting_control_border_highlight": [50, 130, 255, 255],
"setting_control_text": [35, 35, 35, 255], "setting_control_text": [35, 35, 35, 255],
@ -280,7 +308,7 @@
"setting_validation_error": [127, 127, 127, 255], "setting_validation_error": [127, 127, 127, 255],
"setting_validation_warning_background": [255, 145, 62, 255], "setting_validation_warning_background": [255, 145, 62, 255],
"setting_validation_warning": [127, 127, 127, 255], "setting_validation_warning": [127, 127, 127, 255],
"setting_validation_ok": [255, 255, 255, 255], "setting_validation_ok": "background_2",
"material_compatibility_warning": [243, 166, 59, 255], "material_compatibility_warning": [243, 166, 59, 255],
@ -297,13 +325,15 @@
"quality_slider_available": [0, 0, 0, 255], "quality_slider_available": [0, 0, 0, 255],
"checkbox": [255, 255, 255, 255], "checkbox": [255, 255, 255, 255],
"checkbox_hover": [255, 255, 255, 255], "checkbox_hover": "border_main",
"checkbox_border": [180, 180, 180, 255], "checkbox_border": [180, 180, 180, 255],
"checkbox_border_hover": [25, 110, 240, 255], "checkbox_border_hover": [25, 110, 240, 255],
"checkbox_mark": [35, 35, 35, 255], "checkbox_mark": [35, 35, 35, 255],
"checkbox_disabled": [223, 223, 223, 255], "checkbox_disabled": "background_2",
"checkbox_text": [0, 12, 26, 255], "checkbox_text": [0, 12, 26, 255],
"category_background": "background_2",
"tooltip": [25, 25, 25, 255], "tooltip": [25, 25, 25, 255],
"tooltip_text": [255, 255, 255, 255], "tooltip_text": [255, 255, 255, 255],
@ -397,7 +427,10 @@
"cloud_unavailable": [153, 153, 153, 255], "cloud_unavailable": [153, 153, 153, 255],
"connection_badge_background": [255, 255, 255, 255], "connection_badge_background": [255, 255, 255, 255],
"warning_badge_background": [0, 0, 0, 255], "warning_badge_background": [0, 0, 0, 255],
"error_badge_background": [255, 255, 255, 255] "error_badge_background": [255, 255, 255, 255],
"border_field_light": [180, 180, 180, 255],
"border_main_light": [212, 212, 212, 255]
}, },
"sizes": { "sizes": {
@ -489,6 +522,8 @@
"medium_button": [2.5, 2.5], "medium_button": [2.5, 2.5],
"medium_button_icon": [2, 2], "medium_button_icon": [2, 2],
"context_menu": [20, 2],
"favorites_row": [2, 2], "favorites_row": [2, 2],
"favorites_button": [2, 2], "favorites_button": [2, 2],
"favorites_button_icon": [1.2, 1.2], "favorites_button_icon": [1.2, 1.2],
@ -519,6 +554,9 @@
"checkbox_mark": [1, 1], "checkbox_mark": [1, 1],
"checkbox_radius": [0.25, 0.25], "checkbox_radius": [0.25, 0.25],
"spinbox": [6.0, 3.0],
"combobox_wide": [14, 2],
"tooltip": [20.0, 10.0], "tooltip": [20.0, 10.0],
"tooltip_margins": [1.0, 1.0], "tooltip_margins": [1.0, 1.0],
"tooltip_arrow_margins": [2.0, 2.0], "tooltip_arrow_margins": [2.0, 2.0],