Now statuses have different colors. Various minor fixes
This commit is contained in:
@@ -62,14 +62,14 @@ Rectangle {
|
||||
}
|
||||
|
||||
CustomControls.TextField {
|
||||
text: battery ? convertDoubleToString(battery.controlCurrent) : "—"
|
||||
text: battery ? convertIntToString(battery.controlCurrent) : "—"
|
||||
indicatorText: "А"
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredWidth: 1
|
||||
}
|
||||
|
||||
CustomControls.TextField {
|
||||
text: battery ? convertDoubleToString(battery.measuredCurrent) : "—"
|
||||
text: battery ? convertIntToString(battery.measuredCurrent) : "—"
|
||||
indicatorText: "А"
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredWidth: 1
|
||||
@@ -90,14 +90,14 @@ Rectangle {
|
||||
}
|
||||
|
||||
CustomControls.TextField {
|
||||
text: battery ? convertDoubleToString(battery.controlTemperature) : "—"
|
||||
text: battery ? convertIntToString(battery.controlTemperature) : "—"
|
||||
indicatorText: "°C"
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredWidth: 1
|
||||
}
|
||||
|
||||
CustomControls.TextField {
|
||||
text: battery ? convertDoubleToString(battery.measuredTemperature) : "—"
|
||||
text: battery ? convertIntToString(battery.measuredTemperature) : "—"
|
||||
indicatorText: "°C"
|
||||
implicitWidth: 1
|
||||
Layout.fillWidth: true
|
||||
@@ -130,7 +130,7 @@ Rectangle {
|
||||
|
||||
delegate: CustomControls.ColoredLabel {
|
||||
text: modelData.description
|
||||
backgroundColor: Palette.neutralColor
|
||||
backgroundColor: statusSeverityToColor(modelData.severity)
|
||||
font.pixelSize: 12
|
||||
width: parent.width
|
||||
}
|
||||
@@ -183,4 +183,18 @@ Rectangle {
|
||||
return Palette.blueButtonColor
|
||||
}
|
||||
}
|
||||
|
||||
function statusSeverityToColor(severity) {
|
||||
switch (severity) {
|
||||
case BatteryController.Good:
|
||||
return Palette.goodColor
|
||||
case BatteryController.Warning:
|
||||
return Palette.warningColor
|
||||
case BatteryController.Error:
|
||||
return Palette.errorColor
|
||||
case BatteryController.Info:
|
||||
default:
|
||||
return Palette.infoColor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,10 @@ Controls.Button {
|
||||
topPadding: 8
|
||||
bottomPadding: 8
|
||||
|
||||
font.family: "Roboto"
|
||||
font.pixelSize: 14
|
||||
font.weight: Font.Normal
|
||||
|
||||
property color backgroundColor: Palette.blueButtonColor
|
||||
|
||||
contentItem: Text {
|
||||
|
||||
@@ -7,7 +7,6 @@ Controls.TextField {
|
||||
id: control
|
||||
|
||||
readOnly: true
|
||||
selectByMouse: true
|
||||
implicitHeight: 34
|
||||
|
||||
horizontalAlignment: Text.AlignRight
|
||||
|
||||
@@ -49,7 +49,7 @@ ApplicationWindow {
|
||||
|
||||
CustomControls.ColoredLabel {
|
||||
text: CanController.isConnected ? "Штатный режим" : "Отсутствует связь с БМФ2"
|
||||
backgroundColor: CanController.isConnected ? Palette.goodColor : Palette.invalidColor
|
||||
backgroundColor: CanController.isConnected ? Palette.goodColor : Palette.errorColor
|
||||
}
|
||||
|
||||
Item {
|
||||
|
||||
@@ -16,8 +16,8 @@ QtObject {
|
||||
property color redButtonColor: "#E74245"
|
||||
property color yellowButtonColor: "#F4BB44"
|
||||
|
||||
property color informationColor: "#E2EAFF"
|
||||
property color invalidColor: "#FFEDE3"
|
||||
property color infoColor: "#E2EAFF"
|
||||
property color goodColor: "#C4FFCA"
|
||||
property color neutralColor: "#FEFBC6"
|
||||
property color warningColor: "#FEFBC6"
|
||||
property color errorColor: "#FFEDE3"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user