Fix darkmode issues in the DiscoverUM3Actions dialog

CURA-8688
This commit is contained in:
casper 2022-02-28 12:20:46 +01:00
parent 7f859651dd
commit 6159ccbdc7

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
@ -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