Debian Codegraph @

import/Lomiri/Content/qml5/ContentPageHeader.qml

raw
1 /*
2 * Copyright 2015 Canonical Ltd.
3 *
4 * This file is part of lomiri-content-hub.
5 *
6 * webbrowser-app is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 3.
9 *
10 * webbrowser-app is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 import QtQuick 2.4
20 import Lomiri.Components 1.3
21 import Lomiri.Components.ListItems 1.3 as ListItem
22
23 /*
24 * Component to use as page header in the ContentPeerPicker
25 *
26 * It has a cancel() signal fired when cancel button is pressed and a title
27 * property to set the page title
28 */
29
30 Column {
31 id: root
32 signal cancel()
33 property string title
34
35 height: childrenRect.height
36
37 anchors {
38 left: parent.left
39 right: parent.right
40 }
41
42 Rectangle {
43 id: title
44
45 height: units.gu(7) - divider.height
46 anchors { left: parent.left; right: parent.right }
47
48 Rectangle {
49 anchors.fill: parent
50 color: Theme.palette.normal.background
51 }
52
53 AbstractButton {
54 id: cancelButton
55 objectName: "cancelButton"
56
57 width: height
58
59 onTriggered: root.cancel()
60 anchors {
61 top: parent.top
62 bottom: parent.bottom
63 left: parent.left
64 }
65
66 Rectangle {
67 anchors.fill: parent
68 anchors.leftMargin: units.gu(1)
69 anchors.rightMargin: units.gu(1)
70 color: "#E6E6E6"
71 visible: parent.pressed
72 }
73
74 Icon {
75 name: "close"
76 anchors {
77 fill: parent
78 topMargin: units.gu(2)
79 bottomMargin: units.gu(2)
80 }
81 }
82 }
83
84 Label {
85 anchors {
86 left: cancelButton.right
87 verticalCenter: parent.verticalCenter
88 }
89 text: root.title
90 fontSize: 'x-large'
91 }
92 }
93
94 ListItem.Divider {
95 id: divider
96 }
97 }