Skip to content

Commit

Permalink
Update components/listitems upgrade enabled to interactive property
Browse files Browse the repository at this point in the history
Part of #1818
  • Loading branch information
MikeTrahearn-Qinetic committed Feb 17, 2025
1 parent 92647a0 commit 5d0182a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 18 deletions.
2 changes: 1 addition & 1 deletion components/listitems/ListChargeSchedule.qml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ ListNavigation {
ListTimeSelector {
//% "Duration"
text: qsTrId("cgwacs_battery_schedule_duration")
button.text: dataItem.value > 0 ? Utils.secondsToString(dataItem.value) : "--"
secondaryText: dataItem.value > 0 ? Utils.secondsToString(dataItem.value) : "--"
dataItem.uid: root._scheduleSource + "/Duration"
preferredVisible: itemEnabled.checked
maximumHour: 9999
Expand Down
2 changes: 1 addition & 1 deletion components/listitems/ListClearHistoryButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ListButton {
id: timer
interval: 2000
}
enabled: userHasWriteAccess && !timer.running
interactive: !timer.running

onClicked: {
/*
Expand Down
4 changes: 2 additions & 2 deletions components/listitems/ListFirmwareCheckButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ ListButton {

property int updateType

button.text: Global.firmwareUpdate.state === FirmwareUpdater.Checking
secondaryText: Global.firmwareUpdate.state === FirmwareUpdater.Checking
//% "Checking..."
? qsTrId("settings_firmware_checking")
//% "Press to check"
: qsTrId("settings_firmware_press_to_check")
enabled: userHasWriteAccess && !Global.firmwareUpdate.busy
interactive: !Global.firmwareUpdate.busy
writeAccessLevel: VenusOS.User_AccessType_User

onClicked: {
Expand Down
15 changes: 3 additions & 12 deletions components/listitems/ListLink.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ListItem {

readonly property int mode: Qt.platform.os == "wasm" ? VenusOS.ListLink_Mode_LinkButton : VenusOS.ListLink_Mode_QRCode

down: pressArea.containsPress
interactive: mode === VenusOS.ListLink_Mode_LinkButton

content.children: [
SecondaryListLabel {
Expand All @@ -33,7 +33,7 @@ ListItem {
anchors.verticalCenter: parent.verticalCenter
source: "qrc:/images/icon_open_link_32.svg"
rotation: 180
color: pressArea.containsPress ? Theme.color_listItem_down_forwardIcon : Theme.color_listItem_forwardIcon
color: root.down ? Theme.color_listItem_down_forwardIcon : Theme.color_listItem_forwardIcon
},

Item {
Expand All @@ -57,14 +57,5 @@ ListItem {
//% "Scan the QR code with your portable device.<br />Or insert the link: %1"
: qsTrId("listlink_scan_qr_code").arg(formattedUrl)

ListPressArea {
id: pressArea

enabled: root.mode === VenusOS.ListLink_Mode_LinkButton
radius: backgroundRect.radius
anchors.fill: root.backgroundRect
onClicked: {
BackendConnection.openUrl(root.url)
}
}
onClicked: BackendConnection.openUrl(root.url)
}
4 changes: 2 additions & 2 deletions components/listitems/ListMountStateButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ ListButton {

//% "microSD / USB"
text: qsTrId("components_mount_state_microsd_usb")
button.text: _mountStateToText(mountState.value)
button.enabled: mounted
secondaryText: _mountStateToText(mountState.value)
interactive: mounted
writeAccessLevel: VenusOS.User_AccessType_User

onClicked: mountState.setValue(VenusOS.Storage_UnmountRequested)
Expand Down

0 comments on commit 5d0182a

Please sign in to comment.