| 1 |
/* |
| 2 |
* Copyright (C) 2016 Canonical Ltd. |
| 3 |
* |
| 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; version 3. |
| 7 |
* |
| 8 |
* This program is distributed in the hope that it will be useful, |
| 9 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 |
* GNU General Public License for more details. |
| 12 |
* |
| 13 |
* You should have received a copy of the GNU General Public License |
| 14 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 |
*/ |
| 16 |
|
| 17 |
import QtQuick 2.15 |
| 18 |
import Lomiri.Components 1.3 |
| 19 |
|
| 20 |
Rectangle { |
| 21 |
id: root |
| 22 |
color: "white" |
| 23 |
implicitWidth: width |
| 24 |
implicitHeight: height |
| 25 |
|
| 26 |
property var surface |
| 27 |
|
| 28 |
Column { |
| 29 |
Button { |
| 30 |
text: "Open Menu" |
| 31 |
property real nextY: y |
| 32 |
property real menuHeight: units.gu(5) |
| 33 |
onClicked: { |
| 34 |
surface.openMenu(x+width, nextY, units.gu(10), menuHeight); |
| 35 |
nextY += menuHeight + units.gu(.5) |
| 36 |
} |
| 37 |
} |
| 38 |
|
| 39 |
Button { |
| 40 |
text: "Open Dialog" |
| 41 |
property real dialogWidth: units.gu(30) |
| 42 |
property real dialogHeight: units.gu(20) |
| 43 |
onClicked: { |
| 44 |
surface.openDialog(root.x+(root.width/2)-(dialogWidth/2), root.y+(root.height/2)-(dialogHeight/2), |
| 45 |
dialogWidth, dialogHeight); |
| 46 |
} |
| 47 |
} |
| 48 |
} |
| 49 |
} |