/usr/lib/x86_64-linux-gnu/qt5/qml/Ubuntu/Components/1.2/PageHeadConfiguration.qml is in qml-module-ubuntu-components 1.3.1918+16.04.20160404-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | /*
* Copyright 2014-2015 Canonical Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; version 3.
*
* This program 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.4
import Ubuntu.Components 1.2
/*!
\qmltype PageHeadConfiguration
\inqmlmodule Ubuntu.Components 1.1
\ingroup ubuntu
\since Ubuntu.Components 1.1
\brief Page.head is used to configure the header for a \l Page.
For examples how to use Page.head, see \l Page.
*/
Object {
// To be used inside a Page only.
id: headerConfig
/*!
List of actions to show in the header.
Example:
\qml
Page {
title: "Custom header actions"
head.actions: [
Action {
iconName: "save"
text: i18n.tr("Save")
},
Action {
iconName: "add"
text: i18n.tr("Add")
}
]
}
\endqml
*/
property list<Action> actions
/*!
Overrides the default \l PageStack back button and the
\l Tabs drawer button in the header.
Example:
\qml
Page {
title: "Back Action Page"
head.backAction: Action {
iconName: "close"
onTriggered: {
console.log("Run custom back action")
}
}
}
\endqml
*/
property Action backAction: null
/*!
Set this property to show this Item in the header instead of
the title. Use a \l TextField here for implementing search in header.
The parent of this Item will be binded while the \l Page is active.
The header contents will automatically be anchored to the left and
vertically centered inside the header.
Example:
\qml
Page {
title: "Invisible title"
head.contents: Rectangle {
color: UbuntuColors.orange
height: units.gu(5)
width: parent ? parent.width - units.gu(2) : undefined
}
}
\endqml
See \l PageHeadState for an example that shows how search mode can
be implemented.
*/
property Item contents: null
QtObject {
id: internal
property Item oldContents: null
}
onContentsChanged: {
if (internal.oldContents) {
// FIX: bug #1341814 and #1400297
// We have to force the removal of the previous head.contents
// in order to show the new contents
internal.oldContents.parent = null;
}
internal.oldContents = contents;
}
// FIXME: The example below can be much simplified using PageHeadState
// when bug #1345775 has been fixed.
/*!
Choose a preset for the header visuals and behavior.
The default is an empty string "".
By setting this to "select", title will be hidden and
actions will be represented by icons with a label.
Example:
\qml
import QtQuick 2.4
import Ubuntu.Components 1.2
MainView {
id: mainView
width: units.gu(40)
height: units.gu(50)
Page {
id: page
title: "Demo"
state: "default"
states: [
PageHeadState {
name: "default"
head: page.head
actions: [
Action {
iconName: "contact"
text: "Contact"
}
]
},
State {
id: selectState
name: "select"
property Action leaveSelect: Action {
iconName: "back"
text: "Back"
onTriggered: page.state = "default"
}
property list<Action> actions: [
Action {
iconName: "select"
text: "Select All"
},
Action {
iconName: "delete"
text: "Delete"
}
]
PropertyChanges {
target: page.head
backAction: selectState.leaveSelect
actions: selectState.actions
preset: "select"
}
}
]
Label {
anchors.centerIn: parent
text: "Use back button to leave selection mode."
visible: page.state == "select"
}
Button {
anchors.centerIn: parent
onClicked: page.state = "select"
visible: page.state != "select"
text: "selection mode"
}
}
}
\endqml
*/
property string preset: ""
/*!
\qmlproperty PageHeadSections sections
Defines the sections in the page header divider.
*/
readonly property alias sections: headSections
PageHeadSections {
id: headSections
}
/*!
The color of the text and icons.
*/
property color foregroundColor: Theme.palette.selected.backgroundText
}
|