Merge pull request #516

8dc95a1 remove animation when swithing to basic layout (Jaquee)
d9a2b1a fix broken basic button (Jaquee)
This commit is contained in:
Riccardo Spagni
2017-03-03 16:26:02 +02:00
2 changed files with 17 additions and 30 deletions

View File

@@ -41,6 +41,7 @@ Rectangle {
y: -height y: -height
property string title property string title
property alias maximizeButtonVisible: maximizeButton.visible property alias maximizeButtonVisible: maximizeButton.visible
z: 1
Text { Text {
anchors.centerIn: parent anchors.centerIn: parent
@@ -52,28 +53,26 @@ Rectangle {
visible: customDecorations visible: customDecorations
} }
Behavior on y {
NumberAnimation { duration: 100; easing.type: Easing.InQuad }
}
Rectangle { Rectangle {
id: goToBasicVersionButton id: goToBasicVersionButton
property bool containsMouse: titleBar.mouseX >= x && titleBar.mouseX <= x + width property bool containsMouse: titleBar.mouseX >= x && titleBar.mouseX <= x + width
property bool checked: false property bool checked: false
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
color: containsMouse || checked ? "#FFE00A" : "#000000" color: basicMouseArea.containsMouse || checked ? "#FFE00A" : "#000000"
height: 30 height: 30
width: height width: height
Image { Image {
anchors.centerIn: parent anchors.centerIn: parent
rotation: parent.checked ? 180 : 0 rotation: parent.checked ? 180 : 0
source: parent.containsMouse || parent.checked ? "../images/goToBasicVersionHovered.png" : source: parent.customDecorations || parent.checked ? "../images/goToBasicVersionHovered.png" :
"../images/gotoBasicVersion.png" "../images/gotoBasicVersion.png"
} }
MouseArea { MouseArea {
id: basicMouseArea
hoverEnabled: true
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
parent.checked = !parent.checked parent.checked = !parent.checked

View File

@@ -1046,19 +1046,15 @@ ApplicationWindow {
properties: "visible" properties: "visible"
value: false value: false
} }
NumberAnimation { PropertyAction {
target: appWindow target: appWindow
properties: "height" properties: "height"
to: 30 value: 30
easing.type: Easing.InCubic
duration: 200
} }
NumberAnimation { PropertyAction {
target: appWindow target: appWindow
properties: "width" properties: "width"
to: 470 value: 470
easing.type: Easing.InCubic
duration: 200
} }
PropertyAction { PropertyAction {
targets: [leftPanel, rightPanel] targets: [leftPanel, rightPanel]
@@ -1071,12 +1067,10 @@ ApplicationWindow {
value: true value: true
} }
NumberAnimation { PropertyAction {
target: appWindow target: appWindow
properties: "height" properties: "height"
to: middlePanel.height value: middlePanel.height
easing.type: Easing.InCubic
duration: 200
} }
onStopped: { onStopped: {
@@ -1088,12 +1082,10 @@ ApplicationWindow {
SequentialAnimation { SequentialAnimation {
id: goToProAnimation id: goToProAnimation
NumberAnimation { PropertyAction {
target: appWindow target: appWindow
properties: "height" properties: "height"
to: 30 value: 30
easing.type: Easing.InCubic
duration: 200
} }
PropertyAction { PropertyAction {
target: middlePanel target: middlePanel
@@ -1105,19 +1097,15 @@ ApplicationWindow {
properties: "visible" properties: "visible"
value: true value: true
} }
NumberAnimation { PropertyAction {
target: appWindow target: appWindow
properties: "width" properties: "width"
to: rightPanelExpanded ? 1269 : 1269 - 300 value: rightPanelExpanded ? 1269 : 1269 - 300
easing.type: Easing.InCubic
duration: 200
} }
NumberAnimation { PropertyAction {
target: appWindow target: appWindow
properties: "height" properties: "height"
to: maxWindowHeight value: maxWindowHeight
easing.type: Easing.InCubic
duration: 200
} }
PropertyAction { PropertyAction {
target: frameArea target: frameArea