aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan-Simon Möller <jsmoeller@linuxfoundation.org>2019-11-12 15:29:38 +0100
committerJan-Simon Möller <jsmoeller@linuxfoundation.org>2019-11-12 15:33:15 +0100
commit86c947e1adde60ee372a5ee6031068d42bcfaa65 (patch)
treee9eb21d2dd5e3a1f5258a9e9e51a406faee25f2a
parent0349f05f5885987952a2d8de03983b36722b264e (diff)
Add second ptt button to homescreenicefish_8.99.1icefish/8.99.18.99.1
This will allow in the future to differ between driver and passenger. Bug-AGL: SPEC-2948 . Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org> Change-Id: Icd2d61f2a3984ee3e6b591998c5b05aa91949cee
-rw-r--r--homescreen/qml/SpeechChrome.qml58
1 files changed, 52 insertions, 6 deletions
diff --git a/homescreen/qml/SpeechChrome.qml b/homescreen/qml/SpeechChrome.qml
index 911d481..ab46cb6 100644
--- a/homescreen/qml/SpeechChrome.qml
+++ b/homescreen/qml/SpeechChrome.qml
@@ -25,7 +25,7 @@ Item {
}
Image {
- id: pushToTalk
+ id: pushToTalkLeft
height: parent.height * 0.80
width: height
@@ -45,6 +45,27 @@ Item {
}
}
+ Image {
+ id: pushToTalkRight
+
+ height: parent.height * 0.80
+ width: height
+
+ anchors.right: parent.right
+ anchors.rightMargin: parent.width / 128
+ anchors.verticalCenter: parent.verticalCenter
+ source: "./images/SpeechChrome/push_to_talk.svg"
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: speechChromeController.pushToTalk()
+ }
+
+ Behavior on opacity {
+ NumberAnimation { duration: 250 }
+ }
+ }
+
states: [
State {
name: "Idle"
@@ -55,7 +76,12 @@ Item {
x: 0
}
PropertyChanges {
- target: pushToTalk
+ target: pushToTalkLeft
+ opacity: 1.0
+ enabled: true
+ }
+ PropertyChanges {
+ target: pushToTalkRight
opacity: 1.0
enabled: true
}
@@ -69,7 +95,12 @@ Item {
x: 0
}
PropertyChanges {
- target: pushToTalk
+ target: pushToTalkLeft
+ opacity: 0.0
+ enabled: false
+ }
+ PropertyChanges {
+ target: pushToTalkRight
opacity: 0.0
enabled: false
}
@@ -83,7 +114,12 @@ Item {
x: root.width - chromeBarImage.width
}
PropertyChanges {
- target: pushToTalk
+ target: pushToTalkLeft
+ opacity: 0.0
+ enabled: false
+ }
+ PropertyChanges {
+ target: pushToTalkRight
opacity: 0.0
enabled: false
}
@@ -97,7 +133,12 @@ Item {
x: (root.width - chromeBarImage.width) * 0.5
}
PropertyChanges {
- target: pushToTalk
+ target: pushToTalkLeft
+ opacity: 0.0
+ enabled: false
+ }
+ PropertyChanges {
+ target: pushToTalkRight
opacity: 0.0
enabled: false
}
@@ -111,7 +152,12 @@ Item {
x: 0
}
PropertyChanges {
- target: pushToTalk
+ target: pushToTalkLeft
+ opacity: 1.0
+ enabled: true
+ }
+ PropertyChanges {
+ target: pushToTalkRight
opacity: 1.0
enabled: true
}