Added some UI fixes

This commit is contained in:
Yury Shuvakin
2022-08-29 02:57:42 +03:00
parent 86b73ca662
commit 1fc06361f8
8 changed files with 164 additions and 153 deletions

View File

@@ -4,9 +4,11 @@ import Utils 1.0
Rectangle {
property bool enabled: false
property bool neutral: true
implicitWidth: 18
implicitHeight: 18
radius: implicitWidth / 2
color: enabled ? Palette.alternativeBackgroundColor : Palette.borderColor
color: enabled ? Palette.goodColor :
(neutral ? Palette.borderColor : Palette.invalidColor)
}

View File

@@ -15,6 +15,8 @@ TabButton {
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
maximumLineCount: 2
wrapMode: Text.Wrap
}
background: Item {

View File

@@ -169,6 +169,7 @@ ApplicationWindow {
Controls.AvailabilityIndicator {
id: connectionStatusIndicator
enabled: false
neutral: false
Layout.alignment: Qt.AlignCenter
}

View File

@@ -692,32 +692,36 @@ RowLayout {
Controls.OutlineButton {
text: qsTr("Read default settings")
Layout.fillWidth: true
onClicked: BmsInterface.commands().getBMSconfDefault()
onClicked: if (BmsInterface.isPortConnected()) {
BmsInterface.commands().getBMSconfDefault()
}
}
Controls.OutlineButton {
text: qsTr("Read current settings from BMS")
Layout.fillWidth: true
onClicked: BmsInterface.commands().getBMSconf()
onClicked: if (BmsInterface.isPortConnected()) {
BmsInterface.commands().getBMSconf()
}
}
Controls.OutlineButton {
text: qsTr("Write current values to BMS")
Layout.fillWidth: true
onClicked: {
writeValuesToConfig()
BmsInterface.commands().setBMSconf()
}
onClicked: if (BmsInterface.isPortConnected()) {
writeValuesToConfig()
BmsInterface.commands().setBMSconf()
}
}
Controls.Button {
text: qsTr("Write to non-volatile memory of BMS")
Layout.fillWidth: true
onClicked: {
needWait(true, qsTr("The settings are written to non-volatile memory.\nWait, please."))
writeValuesToConfig()
BmsInterface.commands().storeBMSConfig()
}
onClicked: if (BmsInterface.isPortConnected()) {
needWait(true, qsTr("The settings are written to non-volatile memory.\nWait, please."))
writeValuesToConfig()
BmsInterface.commands().storeBMSConfig()
}
}
Layout.fillWidth: true

View File

@@ -25,4 +25,6 @@ QtObject {
property color informationColor: "#4C68ED"
property color invalidColor: "#A31C00"
property color goodColor: "#009352"
property color neutralColor: "#DFE0EB"
}