diff options
Diffstat (limited to 'homescreen/qml')
-rw-r--r-- | homescreen/qml/images/menubar_full_background.png | bin | 5692 -> 6608 bytes | |||
-rw-r--r-- | homescreen/qml/images/menubar_normal_background.png | bin | 68924 -> 68858 bytes | |||
-rw-r--r-- | homescreen/qml/main.qml | 48 |
3 files changed, 27 insertions, 21 deletions
diff --git a/homescreen/qml/images/menubar_full_background.png b/homescreen/qml/images/menubar_full_background.png Binary files differindex 39e12b9..16a7e77 100644 --- a/homescreen/qml/images/menubar_full_background.png +++ b/homescreen/qml/images/menubar_full_background.png diff --git a/homescreen/qml/images/menubar_normal_background.png b/homescreen/qml/images/menubar_normal_background.png Binary files differindex ceb3684..bfffc55 100644 --- a/homescreen/qml/images/menubar_normal_background.png +++ b/homescreen/qml/images/menubar_normal_background.png 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) + } } |