simplified window v1

This commit is contained in:
marcin
2014-07-19 16:07:40 +02:00
parent ce7e7fd38a
commit 1eb08fe26a
11 changed files with 316 additions and 17 deletions

View File

@@ -4,7 +4,6 @@ import QtQuick 2.2
TextField {
font.family: "Arial"
font.pixelSize: 18
style: TextFieldStyle {
textColor: "#3F3F3F"

View File

@@ -3,6 +3,7 @@ import QtQuick 2.0
Item {
property alias placeholderText: input.placeholderText
property alias text: input.text
property int fontSize: 18
height: 37
Rectangle {
@@ -24,5 +25,6 @@ Item {
anchors.fill: parent
anchors.leftMargin: 4
anchors.rightMargin: 4
font.pixelSize: parent.fontSize
}
}

View File

@@ -1,6 +1,7 @@
import QtQuick 2.0
Item {
id: button
height: 37
property string shadowPressedColor
property string shadowReleasedColor
@@ -8,6 +9,7 @@ Item {
property string releasedColor
property string icon: ""
property string textColor: "#FFFFFF"
property int fontSize: 12
property alias text: label.text
signal clicked()
@@ -39,7 +41,7 @@ Item {
font.family: "Arial"
font.bold: true
font.letterSpacing: -1
font.pixelSize: 12
font.pixelSize: button.fontSize
color: parent.textColor
visible: parent.icon === ""
}

View File

@@ -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
}
}
}