aboutsummaryrefslogtreecommitdiff
path: root/components/TitleBar.qml
diff options
context:
space:
mode:
authormarcin <z.krzysztoff7@gmail.com>2014-07-19 16:07:40 +0200
committermarcin <z.krzysztoff7@gmail.com>2014-07-19 16:07:40 +0200
commit1eb08fe26aa99efbb92487f210bbcde6f7b2ce12 (patch)
tree41e0300f780e82fc48a88cd5c172ff0eeb3a6a1c /components/TitleBar.qml
parentce7e7fd38ac96b80f560e1a820e09b1c69d791c6 (diff)
downloadmonzero-gui-1eb08fe26aa99efbb92487f210bbcde6f7b2ce12.tar.gz
monzero-gui-1eb08fe26aa99efbb92487f210bbcde6f7b2ce12.tar.xz
monzero-gui-1eb08fe26aa99efbb92487f210bbcde6f7b2ce12.zip
simplified window v1
Diffstat (limited to 'components/TitleBar.qml')
-rw-r--r--components/TitleBar.qml39
1 files changed, 33 insertions, 6 deletions
diff --git a/components/TitleBar.qml b/components/TitleBar.qml
index 82d9610e..e18d1a86 100644
--- a/components/TitleBar.qml
+++ b/components/TitleBar.qml
@@ -8,6 +8,8 @@ Rectangle {
y: -height
property int mouseX: 0
property int mouseY: 0
+ property alias maximizeButtonVisible: maximizeButton.visible
+ signal goToBasicVersion(bool yes)
Text {
anchors.centerIn: parent
@@ -21,6 +23,32 @@ Rectangle {
Behavior on y {
NumberAnimation { duration: 100; easing.type: Easing.InQuad }
}
+
+ Rectangle {
+ id: goToBasicVersionButton
+ property bool containsMouse: titleBar.mouseX >= x && titleBar.mouseX <= x + width
+ property bool checked: false
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ width: height
+ color: containsMouse || checked ? "#FFE00A" : "#000000"
+
+ Image {
+ anchors.centerIn: parent
+ rotation: parent.checked ? 180 : 0
+ source: parent.containsMouse || parent.checked ? "../images/goToBasicVersionHovered.png" :
+ "../images/gotoBasicVersion.png"
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ parent.checked = !parent.checked
+ titleBar.goToBasicVersion(parent.checked)
+ }
+ }
+ }
Row {
id: row
@@ -69,17 +97,17 @@ Rectangle {
}
Rectangle {
+ id: maximizeButton
property bool containsMouse: titleBar.mouseX >= x + row.x && titleBar.mouseX <= x + row.x + width
anchors.top: parent.top
anchors.bottom: parent.bottom
width: height
color: containsMouse ? "#FF6C3C" : "#000000"
- property bool checked: false
Image {
anchors.centerIn: parent
- source: parent.checked ? "../images/backToWindowIcon.png" :
- "../images/maximizeIcon.png"
+ source: appWindow.visibility === Window.FullScreen ? "../images/backToWindowIcon.png" :
+ "../images/maximizeIcon.png"
}
@@ -87,9 +115,8 @@ Rectangle {
id: maximizeArea
anchors.fill: parent
onClicked: {
- parent.checked = !parent.checked
- appWindow.visibility = parent.checked ? Window.FullScreen :
- Window.Windowed
+ appWindow.visibility = appWindow.visibility !== Window.FullScreen ? Window.FullScreen :
+ Window.Windowed
}
}
}