Fix darkmode issues in the Workspace dialog

CURA-8688
This commit is contained in:
casper 2022-02-28 15:59:56 +01:00
parent 6159ccbdc7
commit f31b8051df

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
{
width: parent.width
height: cildrenRect.height
UM.Label
{ {
id: titleLabel id: titleLabel
text: catalog.i18nc("@action:title", "Summary - Cura Project") text: catalog.i18nc("@action:title", "Summary - Cura Project")
font.pointSize: 18 font: UM.Theme.getFont("large")
} }
Rectangle Rectangle
{ {
id: separator id: separator
color: palette.text color: UM.Theme.getColor("text")
width: parent.width width: parent.width
height: 1 height: UM.Theme.getSize("default_lining").height
} }
Item // Spacer
{
height: doubleSpacerHeight
width: height
} }
Row
{
height: childrenRect.height
width: parent.width
Label
{
text: catalog.i18nc("@action:label", "Printer settings")
font.bold: true
width: (parent.width / 3) | 0
}
Item Item
{ {
// spacer width: parent.width
height: spacerHeight height: childrenRect.height
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,17 +145,30 @@ UM.Dialog
} }
} }
} }
Column
{
width: parent.width
height: cildrenRect.height
UM.Label
{
id: printer_settings_label
text: catalog.i18nc("@action:label", "Printer settings")
font: UM.Theme.getFont("default_bold")
} }
Row Row
{ {
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: (parent.width / 3) | 0 width: (parent.width / 3) | 0
} }
Label UM.Label
{ {
text: manager.machineType text: manager.machineType
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
@ -178,43 +179,31 @@ UM.Dialog
{ {
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label
UM.Label
{ {
text: catalog.i18nc("@action:label", manager.isPrinterGroup ? "Printer Group" : "Printer Name") text: catalog.i18nc("@action:label", manager.isPrinterGroup ? "Printer Group" : "Printer Name")
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
} }
Label UM.Label
{ {
text: manager.machineName text: manager.machineName
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
wrapMode: Text.WordWrap 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 Item
{ {
// spacer width: parent.width
height: spacerHeight height: childrenRect.height
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 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", "Name")
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
} }
Label UM.Label
{ {
text: manager.qualityName text: manager.qualityName
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }
} }
Row Row
{ {
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: (parent.width / 3) | 0 width: (parent.width / 3) | 0
} }
Label UM.Label
{ {
text: manager.intentName text: manager.intentName
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }
} }
Row Row
{ {
width: parent.width width: parent.width
height: manager.numUserSettings != 0 ? childrenRect.height : 0 height: childrenRect.height
Label
UM.Label
{ {
text: catalog.i18nc("@action:label", "Not in profile") text: catalog.i18nc("@action:label", "Not in profile")
visible: manager.numUserSettings != 0
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
} }
Label UM.Label
{ {
text: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", manager.numUserSettings).arg(manager.numUserSettings) text: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", manager.numUserSettings).arg(manager.numUserSettings)
visible: manager.numUserSettings != 0
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
} }
visible: manager.numUserSettings != 0
} }
Row Row
{ {
width: parent.width width: parent.width
height: manager.numSettingsOverridenByQualityChanges != 0 ? childrenRect.height : 0 height: childrenRect.height
Label
UM.Label
{ {
text: catalog.i18nc("@action:label", "Derivative from") text: catalog.i18nc("@action:label", "Derivative from")
visible: manager.numSettingsOverridenByQualityChanges != 0
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
} }
Label UM.Label
{ {
text: catalog.i18ncp("@action:label", "%1, %2 override", "%1, %2 overrides", manager.numSettingsOverridenByQualityChanges).arg(manager.qualityType).arg(manager.numSettingsOverridenByQualityChanges) text: catalog.i18ncp("@action:label", "%1, %2 override", "%1, %2 overrides", manager.numSettingsOverridenByQualityChanges).arg(manager.qualityType).arg(manager.numSettingsOverridenByQualityChanges)
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
visible: manager.numSettingsOverridenByQualityChanges != 0
wrapMode: Text.WordWrap 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 Item
{ {
// spacer width: parent.width
height: spacerHeight height: childrenRect.height
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,6 +337,23 @@ 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 Repeater
@ -348,12 +363,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: (parent.width / 3) | 0 width: (parent.width / 3) | 0
} }
Label UM.Label
{ {
text: modelData text: modelData
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
@ -361,28 +376,29 @@ UM.Dialog
} }
} }
} }
}
Item // Spacer
{
height: doubleSpacerHeight
width: height
} }
Label Column
{
width: parent.width
height: cildrenRect.height
UM.Label
{ {
text: catalog.i18nc("@action:label", "Setting visibility") text: catalog.i18nc("@action:label", "Setting visibility")
font.bold: true font: UM.Theme.getFont("default_bold")
} }
Row Row
{ {
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label UM.Label
{ {
text: catalog.i18nc("@action:label", "Mode") text: catalog.i18nc("@action:label", "Mode")
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
} }
Label UM.Label
{ {
text: manager.activeMode text: manager.activeMode
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
@ -393,22 +409,19 @@ UM.Dialog
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
visible: manager.hasVisibleSettingsField visible: manager.hasVisibleSettingsField
Label UM.Label
{ {
text: catalog.i18nc("@action:label", "Visible settings:") text: catalog.i18nc("@action:label", "Visible settings:")
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
} }
Label UM.Label
{ {
text: catalog.i18nc("@action:label", "%1 out of %2" ).arg(manager.numVisibleSettings).arg(manager.totalNumberOfSettings) 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
} }
} }
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.")
@ -438,13 +449,11 @@ UM.Dialog
rightButtons: [ rightButtons: [
Cura.TertiaryButton Cura.TertiaryButton
{ {
id: cancel_button
text: catalog.i18nc("@action:button", "Cancel") text: catalog.i18nc("@action:button", "Cancel")
onClicked: reject() onClicked: reject()
}, },
Cura.PrimaryButton Cura.PrimaryButton
{ {
id: ok_button
text: catalog.i18nc("@action:button", "Open") text: catalog.i18nc("@action:button", "Open")
onClicked: accept() onClicked: accept()
} }