From 41e04f2e9df59bb1f7b7faf9c8977c9750f44b92 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Thu, 24 Feb 2022 11:34:48 +0100 Subject: [PATCH 1/2] Progress bar causing crash due to incorrect min max value variable names. Give buttons fixed leftMargin in monitor page so icons are center aligned. CURA-8980 --- resources/qml/MonitorButton.qml | 4 ++-- resources/qml/PrinterOutput/ManualPrinterControl.qml | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/resources/qml/MonitorButton.qml b/resources/qml/MonitorButton.qml index 6a64003185..4876b01fb3 100644 --- a/resources/qml/MonitorButton.qml +++ b/resources/qml/MonitorButton.qml @@ -183,8 +183,8 @@ Item UM.ProgressBar { id: progressBar - minimumValue: 0 - maximumValue: 100 + from: 0 + to: 100 value: 0 //Doing this in an explicit binding since the implicit binding breaks on occasion. diff --git a/resources/qml/PrinterOutput/ManualPrinterControl.qml b/resources/qml/PrinterOutput/ManualPrinterControl.qml index 9024d177a0..d179ba6be4 100644 --- a/resources/qml/PrinterOutput/ManualPrinterControl.qml +++ b/resources/qml/PrinterOutput/ManualPrinterControl.qml @@ -98,6 +98,7 @@ Item Layout.preferredWidth: _buttonSize Layout.preferredHeight: _buttonSize iconSource: UM.Theme.getIcon("ChevronSingleUp") + leftPadding: (Layout.preferredWidth - iconSize) / 2 onClicked: printerModel.moveHead(0, distancesRow.currentDistance, 0) } @@ -109,6 +110,7 @@ Item Layout.preferredWidth: _buttonSize Layout.preferredHeight: _buttonSize iconSource: UM.Theme.getIcon("ChevronSingleLeft") + leftPadding: (Layout.preferredWidth - iconSize) / 2 onClicked: printerModel.moveHead(-distancesRow.currentDistance, 0, 0) } @@ -120,6 +122,7 @@ Item Layout.preferredWidth: _buttonSize Layout.preferredHeight: _buttonSize iconSource: UM.Theme.getIcon("ChevronSingleRight") + leftPadding: (Layout.preferredWidth - iconSize) / 2 onClicked: printerModel.moveHead(distancesRow.currentDistance, 0, 0) } @@ -131,6 +134,7 @@ Item Layout.preferredWidth: _buttonSize Layout.preferredHeight: _buttonSize iconSource: UM.Theme.getIcon("ChevronSingleDown") + leftPadding: (Layout.preferredWidth - iconSize) / 2 onClicked: printerModel.moveHead(0, -distancesRow.currentDistance, 0) } @@ -142,6 +146,7 @@ Item Layout.preferredWidth: _buttonSize Layout.preferredHeight: _buttonSize iconSource: UM.Theme.getIcon("House") + leftPadding: (Layout.preferredWidth - iconSize) / 2 onClicked: printerModel.homeHead() } @@ -166,6 +171,7 @@ Item iconSource: UM.Theme.getIcon("ChevronSingleUp") width: height height: _buttonSize + leftPadding: (width - iconSize) / 2 onClicked: printerModel.moveHead(0, 0, distancesRow.currentDistance) @@ -176,6 +182,7 @@ Item iconSource: UM.Theme.getIcon("House") width: height height: _buttonSize + leftPadding: (width - iconSize) / 2 onClicked: printerModel.homeBed() } @@ -185,6 +192,7 @@ Item iconSource: UM.Theme.getIcon("ChevronSingleDown") width: height height: _buttonSize + leftPadding: (width - iconSize) / 2 onClicked: printerModel.moveHead(0, 0, -distancesRow.currentDistance) } From 61beb963c2fb23becaa4057eb508b5174cf207ad Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Thu, 24 Feb 2022 14:58:07 +0100 Subject: [PATCH 2/2] Swap flat buttons for Cura Styled buttons. These "buttons" function like radiobuttons so a bit of extra styling needed to be added to swap appearance. Removed fixed width as it breaks centering with Cura buttons CURA-8980 --- resources/qml/PrinterOutput/ManualPrinterControl.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/qml/PrinterOutput/ManualPrinterControl.qml b/resources/qml/PrinterOutput/ManualPrinterControl.qml index d179ba6be4..bf987b282f 100644 --- a/resources/qml/PrinterOutput/ManualPrinterControl.qml +++ b/resources/qml/PrinterOutput/ManualPrinterControl.qml @@ -226,15 +226,15 @@ Item Repeater { model: distancesModel - delegate: Button + delegate: Cura.SecondaryButton { height: UM.Theme.getSize("setting_control").height - width: height + UM.Theme.getSize("default_margin").width text: model.label ButtonGroup.group: distanceGroup - checkable: true - checked: distancesRow.currentDistance == model.value + color: distancesRow.currentDistance == model.value ? UM.Theme.getColor("primary_button") : UM.Theme.getColor("secondary_button") + textColor: distancesRow.currentDistance == model.value ? UM.Theme.getColor("primary_button_text"): UM.Theme.getColor("secondary_button_text") + hoverColor: distancesRow.currentDistance == model.value ? UM.Theme.getColor("primary_button_hover"): UM.Theme.getColor("secondary_button_hover") onClicked: distancesRow.currentDistance = model.value } }