Unity 8
PreviewView.qml
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  */
16 
17 import QtQuick 2.4
18 import Ubuntu.Components 1.3
19 import Unity 0.2
20 import "../Components"
21 import "Previews" as Previews
22 
23 Item {
24  id: root
25 
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)
32 
33  signal backClicked()
34 
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
43 
44  onBackClicked: root.backClicked()
45  }
46 
47  onOpenChanged: {
48  if (!open) {
49  root.scope.cancelActivation();
50  }
51  }
52 
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  }
64 
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  }
76 }