Merge branch 'CURA-8439_Replace_coloured_warning_icons'

This commit is contained in:
Remco Burema 2021-08-04 11:22:27 +02:00
commit 7131bab90a
No known key found for this signature in database
GPG Key ID: 215C49431D43F98C
2 changed files with 32 additions and 20 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
@ -57,16 +57,34 @@ Column
font: UM.Theme.getFont("default") font: UM.Theme.getFont("default")
renderType: Text.NativeRendering renderType: Text.NativeRendering
} }
Item
Cura.IconWithText
{ {
id: unableToSliceMessage id: unableToSliceMessage
width: parent.width width: parent.width
visible: widget.backendState == UM.Backend.Error visible: widget.backendState == UM.Backend.Error
text: catalog.i18nc("@label:PrintjobStatus", "Unable to slice") height: warningIcon.height
source: UM.Theme.getIcon("Warning") UM.StatusIcon
iconColor: UM.Theme.getColor("warning") {
id: warningIcon
anchors.verticalCenter: parent.verticalCenter
width: visible ? UM.Theme.getSize("section_icon").width : 0
height: width
status: UM.StatusIcon.Status.WARNING
}
Label
{
id: label
anchors.left: warningIcon.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 // Progress bar, only visible when the backend is in the process of slice the printjob

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
@ -28,31 +28,25 @@ Item
{ {
width: parent.width width: parent.width
visible: configurationList.model.length == 0 visible: configurationList.model.length == 0
height: label.height + UM.Theme.getSize("wide_margin").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
UM.StatusIcon
Rectangle
{ {
id: icon id: icon
color: UM.Theme.getColor("warning") width: visible ? UM.Theme.getSize("section_icon").width : 0
width: UM.Theme.getSize("section_icon").width
height: width height: width
radius: width / 2 anchors.verticalCenter: parent.verticalCenter
UM.RecolorImage status: UM.StatusIcon.Status.WARNING
{
anchors.fill:parent
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: icon.right
anchors.right: parent.right anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: UM.Theme.getSize("default_margin").width 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 // other when the connection was lost
text: Cura.MachineManager.printerConnected ? text: Cura.MachineManager.printerConnected ?
catalog.i18nc("@label", "Loading available configurations from the printer...") : catalog.i18nc("@label", "Loading available configurations from the printer...") :