Commit a7aa9f29 authored by Pekka Vuorela's avatar Pekka Vuorela

Common base for popup windows and avoid showing during orientation change

parent 9ff2af5f
......@@ -49,7 +49,8 @@ OTHER_FILES += \
qml/MenuFingerterm.qml \
qml/NotifyWin.qml \
qml/UrlWindow.qml \
qml/LayoutWindow.qml
qml/LayoutWindow.qml \
qml/PopupWindow.qml
RESOURCES += \
resources.qrc
......
......@@ -19,26 +19,10 @@
import QtQuick 2.0
Rectangle {
PopupWindow {
id: layoutWindow
property variant layouts: [""]
property bool show
width: window.width-1
height: window.height-1
color: "#000000"
y: show ? 0 : -(height+1)
border.color: "#c0c0c0"
border.width: 1
radius: window.radiusMedium
Behavior on y { NumberAnimation { duration: 200; easing.type: Easing.InOutCubic } }
MouseArea {
// event eater
anchors.fill: parent
}
Component {
id: listDelegate
......
......@@ -19,28 +19,13 @@
import QtQuick 2.0
Rectangle {
PopupWindow {
id: notifyWin
property string text
property bool show
signal dismissed()
width: window.width-1
height: window.height-1
color: "#000000"
y: show ? 0 : -(height+1)
border.color: "#c0c0c0"
border.width: 1
radius: window.radiusMedium
Behavior on y { NumberAnimation { duration: 200; easing.type: Easing.InOutCubic } }
MouseArea {
// event eater
anchors.fill: parent
}
Item {
anchors.top: notifyWin.top
anchors.left: notifyWin.left
......
/*
Copyright 2011-2012 Heikki Holstila <heikki.holstila@gmail.com>
This file is part of FingerTerm.
FingerTerm is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
FingerTerm is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with FingerTerm. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.0
Rectangle {
id: root
property bool show
width: window.width
height: window.height
color: "#000000"
y: -height
border.color: "#c0c0c0"
border.width: 1
radius: window.radiusMedium
MouseArea {
// event eater
anchors.fill: parent
}
states: [
State {
name: "shown"
when: root.show
PropertyChanges { target: root; y: 0 }
}
]
transitions: [
Transition {
to: "*"
NumberAnimation {
properties: "y"
duration: 200
easing.type: Easing.InOutCubic
}
}
]
}
......@@ -19,26 +19,10 @@
import QtQuick 2.0
Rectangle {
PopupWindow {
id: urlWindow
property variant urls: [""]
property bool show
width: window.width-1
height: window.height-1
color: "#000000"
y: show ? 0 : -(height+1)
border.color: "#c0c0c0"
border.width: 1
radius: window.radiusMedium
Behavior on y { NumberAnimation { duration: 200; easing.type: Easing.InOutCubic } }
MouseArea {
// event eater
anchors.fill: parent
}
Component {
id: listDelegate
......
......@@ -7,6 +7,7 @@
<file>qml/Button.qml</file>
<file>qml/MenuFingerterm.qml</file>
<file>qml/NotifyWin.qml</file>
<file>qml/PopupWindow.qml</file>
<file>icons/backspace.png</file>
<file>icons/down.png</file>
<file>icons/enter.png</file>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment