diff options
author | zheng_wenlong <wenlong_zheng@nexty-ele.com> | 2018-11-22 14:16:08 +0900 |
---|---|---|
committer | zheng_wenlong <wenlong_zheng@nexty-ele.com> | 2018-11-22 14:16:08 +0900 |
commit | fabcb8148b8032f4f8d04523e2f24cf8debe477f (patch) | |
tree | a6c6348c5689df0517e17e6f292b955d6823e58e /homescreen/qml/main.qml | |
parent | 6525fcc7cbf779d881197e070d61c1e2400946f8 (diff) |
change fullscreen button size.
Diffstat (limited to 'homescreen/qml/main.qml')
-rw-r--r-- | homescreen/qml/main.qml | 48 |
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) + } } |