2 * Copyright (C) 2011 Lukáš Karas <lukas.karas@centrum.cz>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 property variant wrapper: _wrapper
26 property int animationInLength: 500
27 property int animationOutLength: 500
28 property int popupFromX: parent.width
29 property int popupFromY: 0
30 property int finalWidth: parent.width * 0.8
31 property int finalHeight: parent.height * 0.8
32 property int minCorner: main.toolbarHeight
33 //property int minCorner: 50
34 property int finalX: (popupFromX - finalWidth) < minCorner ? minCorner: popupFromX - finalWidth
35 property int finalY: (popupFromY + finalHeight) > parent.height - minCorner ? parent.height - finalHeight - minCorner: popupFromY
36 property bool destroyOnHide: true
39 console.log("II [AbstractPopup.qml]: "+msg);
42 console.log("EE [AbstractPopup.qml]: "+msg);
45 console.log("WW [AbstractPopup.qml]: "+msg);
56 interval: animationOutLength; running: false; repeat: false
69 PropertyChanges { target: background; opacity: 0 }
70 PropertyChanges { target: backgroundMouseArea; enabled: false}
71 PropertyChanges { target: wrapper; width: 0; height: 0; x: popupFromX; y: popupFromY; opacity: 0}
75 PropertyChanges { target: background; opacity: .5 }
76 PropertyChanges { target: backgroundMouseArea; enabled: true}
77 PropertyChanges { target: wrapper; width: finalWidth; height: finalHeight; x: finalX; y: finalY; opacity: 1}
82 from: "hide"; to: "visible"
83 NumberAnimation { properties: "width,height"; easing.type: Easing.InOutQuad; duration: animationInLength }
84 NumberAnimation { properties: "x,y"; easing.type: Easing.InOutQuad; duration: animationInLength }
85 NumberAnimation { properties: "opacity"; easing.type: Easing.InOutQuad; duration: animationInLength }
88 from: "visible"; to: "hide"
89 NumberAnimation { properties: "width,height"; easing.type: Easing.InOutQuad; duration: animationOutLength }
90 NumberAnimation { properties: "x,y"; easing.type: Easing.InOutQuad; duration: animationOutLength }
91 NumberAnimation { properties: "opacity"; easing.type: Easing.InOutQuad; duration: animationOutLength }
95 SystemPalette { id: syspal }
103 id: backgroundMouseArea
119 height : main.toolbarHeight
123 border.color: main.useSyspal? syspal.light :"white"
125 color: main.useSyspal? syspal.mid :"#323235"
126 anchors.horizontalCenter: _wrapper.right
127 anchors.verticalCenter: _wrapper.top
128 opacity: _wrapper.opacity
131 x: _wrapper.x + _wrapper.width - (width /2)
132 y: _wrapper.y - (height /2)
137 source: "img/cross.png"
138 //anchors.fill: parent
139 anchors.horizontalCenter: parent.horizontalCenter
140 anchors.verticalCenter: parent.verticalCenter
141 width: parent.width * .6