Use the StatusIcon qml component for the warning icons

CURA-8349
This commit is contained in:
Konstantinos Karmas 2021-07-28 18:17:54 +02:00
parent d41d68e6fa
commit 83fe65b8eb
2 changed files with 9 additions and 47 deletions

View file

@ -6,7 +6,7 @@ import QtQuick.Controls 2.1
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Controls 1.4 as Controls1 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 import Cura 1.0 as Cura
@ -63,38 +63,19 @@ Column
width: parent.width width: parent.width
visible: widget.backendState == UM.Backend.Error visible: widget.backendState == UM.Backend.Error
height: icon.height height: warningIcon.height
Item UM.StatusIcon
{ {
id: icon id: warningIcon
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
width: visible ? UM.Theme.getSize("section_icon").width : 0 width: visible ? UM.Theme.getSize("section_icon").width : 0
height: width height: width
UM.RecolorImage status: UM.StatusIcon.Status.WARNING
{
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 Label
{ {
id: label id: label
anchors.left: icon.right anchors.left: warningIcon.right
anchors.right: parent.right anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: UM.Theme.getSize("default_margin").width anchors.leftMargin: UM.Theme.getSize("default_margin").width

View file

@ -4,7 +4,7 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import UM 1.2 as UM import UM 1.4 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
Item Item
@ -31,32 +31,13 @@ Item
height: icon.height height: icon.height
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: UM.Theme.getSize("default_margin").height anchors.topMargin: UM.Theme.getSize("default_margin").height
Item UM.StatusIcon
{ {
id: icon id: icon
width: visible ? UM.Theme.getSize("section_icon").width : 0 width: visible ? UM.Theme.getSize("section_icon").width : 0
height: width height: width
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
UM.RecolorImage status: UM.StatusIcon.Status.WARNING
{
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 Label
{ {