diff options
author | Scott Murray <scott.murray@konsulko.com> | 2018-02-15 18:35:50 -0500 |
---|---|---|
committer | Scott Murray <scott.murray@konsulko.com> | 2018-02-15 18:35:50 -0500 |
commit | 3ebb0c952333caf715a9e2a6c23360db93e54f75 (patch) | |
tree | c44a88e0f6dbdbb98b1d4a00d320f8c4429fbe47 /app | |
parent | 4eb2ac75588b2ce1f47c2b52ec3ed9ce1b674d22 (diff) |
UI improvements for scanning behavioreel_5.1.0eel_5.0.3eel_5.0.2eel/5.1.0eel/5.0.3eel/5.0.25.1.05.0.35.0.2eel
Rework to only enable the scan buttons when the radio is playing,
and a tweak to make sure the scan label reverts to the original
non-scanning color when a scan is interrupted by the user selecting
a frequency with the slider or tune buttons.
Change-Id: I5c44234891aa82e13c28c75b703039575fa2428e
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Diffstat (limited to 'app')
-rw-r--r-- | app/Radio.qml | 43 | ||||
-rw-r--r-- | app/api/Binding.qml | 1 |
2 files changed, 25 insertions, 19 deletions
diff --git a/app/Radio.qml b/app/Radio.qml index 7b7797a..78bab94 100644 --- a/app/Radio.qml +++ b/app/Radio.qml @@ -181,33 +181,38 @@ ApplicationWindow { } ImageButton { + id: scanDownBtn offImage: './images/AGL_MediaPlayer_BackArrow.svg' - Timer { - running: parent.pressed - triggeredOnStart: true - interval: 100 - repeat: true - onTriggered: { - radio.scanDown() - scanLabel.color = '#59FF7F' + states: [ + State { + when: radio.state === radio.activeState + PropertyChanges { + target: scanDownBtn + onClicked: { + radio.scanDown() + scanLabel.color = '#59FF7F' + } + } } - } + ] } ImageButton { + id: scanUpBtn offImage: './images/AGL_MediaPlayer_ForwardArrow.svg' - Timer { - running: parent.pressed - triggeredOnStart: true - interval: 100 - repeat: true - onTriggered: { - radio.scanUp() - scanLabel.color = '#59FF7F' + states: [ + State { + when: radio.state === radio.activeState + PropertyChanges { + target: scanUpBtn + onClicked: { + radio.scanUp() + scanLabel.color = '#59FF7F' + } + } } - } + ] } - } } } diff --git a/app/api/Binding.qml b/app/api/Binding.qml index 7750452..ee83bb5 100644 --- a/app/api/Binding.qml +++ b/app/api/Binding.qml @@ -64,6 +64,7 @@ WebSocket { sendSocketMessage("scan_stop", 'None') scanningState = stoppedState sendSocketMessage("frequency", { value: frequency }) + root.stationFound() } else { // This update was from scanning, clear state scanningFreqUpdate = false |