aboutsummaryrefslogtreecommitdiffstats
path: root/homescreen/qml/main.qml
diff options
context:
space:
mode:
Diffstat (limited to 'homescreen/qml/main.qml')
-rw-r--r--homescreen/qml/main.qml48
1 files changed, 27 insertions, 21 deletions
diff --git a/homescreen/qml/main.qml b/homescreen/qml/main.qml
index 13500bd..10509fd 100644
--- a/homescreen/qml/main.qml
+++ b/homescreen/qml/main.qml
@@ -134,38 +134,44 @@ Window {
Item {
id: switchBtn
+ width: 110
+ height: 110
anchors.right: parent.right
- anchors.rightMargin: 20
anchors.top: parent.top
- anchors.topMargin: 5
- width: 55
- height: 55
z: 1
+ Image {
+ id: image
+ width: 55
+ height: 55
+ anchors.right: parent.right
+ anchors.rightMargin: 20
+ anchors.top: parent.top
+ anchors.topMargin: 5
+ source: './images/normal.png'
+ }
MouseArea {
anchors.fill: parent
property string btnState: 'normal'
- Image {
- id: image
- anchors.fill: parent
- source: './images/normal.png'
- }
onClicked: {
- if (btnState === 'normal') {
- image.source = './images/fullscreen.png'
- btnState = 'fullscreen'
- container.state = 'fullscreen'
- container.opacity = 0.0
- touchArea.switchArea(1)
-
+ if (container.state === 'normal') {
+ turnToFullscreen()
} else {
- image.source = './images/normal.png'
- btnState = 'normal'
- container.state = 'normal'
- container.opacity = 1.0
- touchArea.switchArea(0)
+ turnToNormal()
}
}
}
}
+ function turnToFullscreen() {
+ image.source = './images/fullscreen.png'
+ container.state = 'fullscreen'
+ container.opacity = 0.0
+ touchArea.switchArea(1)
+ }
+ function turnToNormal() {
+ image.source = './images/normal.png'
+ container.state = 'normal'
+ container.opacity = 1.0
+ touchArea.switchArea(0)
+ }
}