on bb09f86 help sign in
unity8/qml/Dash/PreviewView.qml
76 lines 2.1 kB history raw
1/*
2 * Copyright (C) 2013 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 */
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19import Unity 0.2
20import "../Components"
21import "Previews" as Previews
23Item {
24 id: root
26 property bool open: false
27 property var scope: null
28 property var scopeStyle: null
29 property alias showSignatureLine: header.showSignatureLine
30 property alias previewModel: preview.previewModel
31 readonly property bool processing: previewModel && (!previewModel.loaded || previewModel.processingAction)
33 signal backClicked()
35 DashPageHeader {
36 id: header
37 objectName: "pageHeader"
38 width: parent.width
39 title: root.scope ? root.scope.name : ""
40 showBackButton: true
41 searchEntryEnabled: false
42 scopeStyle: root.scopeStyle
44 onBackClicked: root.backClicked()
45 }
47 onOpenChanged: {
48 if (!open) {
49 root.scope.cancelActivation();
50 }
51 }
53 Previews.Preview {
54 id: preview
55 objectName: "preview"
56 anchors {
57 top: header.bottom
58 bottom: parent.bottom
59 left: parent.left
60 right: parent.right
61 }
62 scopeStyle: root.scopeStyle
63 }
65 MouseArea {
66 id: processingMouseArea
67 objectName: "processingMouseArea"
68 anchors {
69 top: header.bottom
70 bottom: parent.bottom
71 left: parent.left
72 right: parent.right
73 }
74 enabled: root.processing
75 }