From 01c4a0f72d59b2ad28922bfd09de875ee9d48648 Mon Sep 17 00:00:00 2001 From: Konstantinos Karmas Date: Wed, 28 Jul 2021 16:55:36 +0200 Subject: [PATCH 1/3] Change warning icon background to the CircleSolid.svg CURA-8439 --- .../ConfigurationListView.qml | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml index afedafa9c2..de74eb469a 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml @@ -28,20 +28,32 @@ Item { width: parent.width visible: configurationList.model.length == 0 - height: label.height + UM.Theme.getSize("wide_margin").height + height: icon.height anchors.top: parent.top anchors.topMargin: UM.Theme.getSize("default_margin").height - - Rectangle + Item { id: icon - color: UM.Theme.getColor("warning") - width: UM.Theme.getSize("section_icon").width + width: visible ? UM.Theme.getSize("section_icon").width : 0 height: width - radius: width / 2 + anchors.verticalCenter: parent.verticalCenter UM.RecolorImage { - anchors.fill:parent + id: warningIconBackground + height: parent.height + width: parent.width + sourceSize.width: width + sourceSize.height: height + source: UM.Theme.getIcon("CircleSolid", "low") + color: UM.Theme.getColor("warning") + } + UM.RecolorImage + { + id: warningIcon + height: parent.height + width: parent.width + sourceSize.width: width + sourceSize.height: height source: UM.Theme.getIcon("Warning", "low") color: UM.Theme.getColor("message_warning_icon") } @@ -51,8 +63,9 @@ Item id: label anchors.left: icon.right anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter anchors.leftMargin: UM.Theme.getSize("default_margin").width - // There are two cases that we want to diferenciate, one is when Cura is loading the configurations and the + // There are two cases that we want to differenciate, one is when Cura is loading the configurations and the // other when the connection was lost text: Cura.MachineManager.printerConnected ? catalog.i18nc("@label", "Loading available configurations from the printer...") : From d41d68e6fab8f5af12fd8cb77af497d2487dd558 Mon Sep 17 00:00:00 2001 From: Konstantinos Karmas Date: Wed, 28 Jul 2021 16:57:15 +0200 Subject: [PATCH 2/3] Replace warning icon in the unable to slice message With the new warning icon that has a solid background, similar to the warning icon used in the messages. CURA-8439 --- .../qml/ActionPanel/SliceProcessWidget.qml | 47 +++++++++++++++++-- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/resources/qml/ActionPanel/SliceProcessWidget.qml b/resources/qml/ActionPanel/SliceProcessWidget.qml index 42df08560a..92b81f43cf 100644 --- a/resources/qml/ActionPanel/SliceProcessWidget.qml +++ b/resources/qml/ActionPanel/SliceProcessWidget.qml @@ -57,16 +57,53 @@ Column font: UM.Theme.getFont("default") renderType: Text.NativeRendering } - - Cura.IconWithText + Item { id: unableToSliceMessage width: parent.width visible: widget.backendState == UM.Backend.Error - text: catalog.i18nc("@label:PrintjobStatus", "Unable to slice") - source: UM.Theme.getIcon("Warning") - iconColor: UM.Theme.getColor("warning") + height: icon.height + Item + { + id: icon + anchors.verticalCenter: parent.verticalCenter + width: visible ? UM.Theme.getSize("section_icon").width : 0 + height: width + UM.RecolorImage + { + id: warningIconBackground + height: parent.height + width: parent.width + sourceSize.width: width + sourceSize.height: height + source: UM.Theme.getIcon("CircleSolid", "low") + color: UM.Theme.getColor("warning") + } + UM.RecolorImage + { + id: warningIcon + height: parent.height + width: parent.width + sourceSize.width: width + sourceSize.height: height + source: UM.Theme.getIcon("Warning", "low") + color: UM.Theme.getColor("message_warning_icon") + } + } + Label + { + id: label + anchors.left: icon.right + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + anchors.leftMargin: UM.Theme.getSize("default_margin").width + text: catalog.i18nc("@label:PrintjobStatus", "Unable to slice") + color: UM.Theme.getColor("text") + font: UM.Theme.getFont("default") + renderType: Text.NativeRendering + wrapMode: Text.WordWrap + } } // Progress bar, only visible when the backend is in the process of slice the printjob From 83fe65b8ebb5924fcdeafac855efc3e7b820fca9 Mon Sep 17 00:00:00 2001 From: Konstantinos Karmas Date: Wed, 28 Jul 2021 18:17:54 +0200 Subject: [PATCH 3/3] Use the StatusIcon qml component for the warning icons CURA-8349 --- .../qml/ActionPanel/SliceProcessWidget.qml | 31 ++++--------------- .../ConfigurationListView.qml | 25 ++------------- 2 files changed, 9 insertions(+), 47 deletions(-) diff --git a/resources/qml/ActionPanel/SliceProcessWidget.qml b/resources/qml/ActionPanel/SliceProcessWidget.qml index 92b81f43cf..99d78537c3 100644 --- a/resources/qml/ActionPanel/SliceProcessWidget.qml +++ b/resources/qml/ActionPanel/SliceProcessWidget.qml @@ -6,7 +6,7 @@ import QtQuick.Controls 2.1 import QtQuick.Layouts 1.3 import QtQuick.Controls 1.4 as Controls1 -import UM 1.3 as UM +import UM 1.4 as UM import Cura 1.0 as Cura @@ -63,38 +63,19 @@ Column width: parent.width visible: widget.backendState == UM.Backend.Error - height: icon.height - Item + height: warningIcon.height + UM.StatusIcon { - id: icon + id: warningIcon anchors.verticalCenter: parent.verticalCenter width: visible ? UM.Theme.getSize("section_icon").width : 0 height: width - UM.RecolorImage - { - id: warningIconBackground - height: parent.height - width: parent.width - sourceSize.width: width - sourceSize.height: height - source: UM.Theme.getIcon("CircleSolid", "low") - color: UM.Theme.getColor("warning") - } - UM.RecolorImage - { - id: warningIcon - height: parent.height - width: parent.width - sourceSize.width: width - sourceSize.height: height - source: UM.Theme.getIcon("Warning", "low") - color: UM.Theme.getColor("message_warning_icon") - } + status: UM.StatusIcon.Status.WARNING } Label { id: label - anchors.left: icon.right + anchors.left: warningIcon.right anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter anchors.leftMargin: UM.Theme.getSize("default_margin").width diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml index de74eb469a..75ae18a593 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml @@ -4,7 +4,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.3 -import UM 1.2 as UM +import UM 1.4 as UM import Cura 1.0 as Cura Item @@ -31,32 +31,13 @@ Item height: icon.height anchors.top: parent.top anchors.topMargin: UM.Theme.getSize("default_margin").height - Item + UM.StatusIcon { id: icon width: visible ? UM.Theme.getSize("section_icon").width : 0 height: width anchors.verticalCenter: parent.verticalCenter - UM.RecolorImage - { - id: warningIconBackground - height: parent.height - width: parent.width - sourceSize.width: width - sourceSize.height: height - source: UM.Theme.getIcon("CircleSolid", "low") - color: UM.Theme.getColor("warning") - } - UM.RecolorImage - { - id: warningIcon - height: parent.height - width: parent.width - sourceSize.width: width - sourceSize.height: height - source: UM.Theme.getIcon("Warning", "low") - color: UM.Theme.getColor("message_warning_icon") - } + status: UM.StatusIcon.Status.WARNING } Label {