/usr/lib/x86_64-linux-gnu/qt5/qml/org/kde/kirigami.2/Page.qml is in qml-module-org-kde-kirigami2 5.44.0-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 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 | /*
* Copyright 2015 Marco Martin <mart@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2, or
* (at your option) any later version.
*
* 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 Library General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import QtQuick 2.1
import QtQuick.Layouts 1.2
import org.kde.kirigami 2.2 as Kirigami
import "private"
import QtQuick.Templates 2.0 as T2
/**
* Page is a container for all the app pages: everything pushed to the
* ApplicationWindow stackView should be a Page instabnce (or a subclass,
* such as ScrollablePage)
* @see ScrollablePage
* @inherit QtQuick.Templates.Page
*/
T2.Page {
id: root
/**
* leftPadding: int
* default contents padding at left
*/
leftPadding: Kirigami.Units.gridUnit
/**
* topPadding: int
* default contents padding at top
*/
topPadding: Kirigami.Units.gridUnit
/**
* rightPadding: int
* default contents padding at right
*/
rightPadding: Kirigami.Units.gridUnit
/**
* bottomPadding: int
* default contents padding at bottom
*/
bottomPadding: actionButtons.item ? actionButtons.height : Kirigami.Units.gridUnit
/**
* flickable: Flickable
* if the central element of the page is a Flickable
* (ListView and Gridview as well) you can set it there.
* normally, you wouldn't need to do that, but just use the
* ScrollablePage element instead
* @see ScrollablePage
* Use this if your flickable has some non standard properties, such as not covering the whole Page
*/
property Flickable flickable
/**
* actions.contextualActions: list<QtObject>
* Defines the contextual actions for the page:
* an easy way to assign actions in the right sliding panel
*
* Example usage:
* @code
* import org.kde.kirigami 2.2 as Kirigami
*
* Kirigami.ApplicationWindow {
* [...]
* contextDrawer: Kirigami.ContextDrawer {
* id: contextDrawer
* }
* [...]
* }
* @endcode
*
* @code
* import org.kde.kirigami 2.2 as Kirigami
*
* Kirigami.Page {
* [...]
* actions.contextualActions: [
* Kirigami.Action {
* iconName: "edit"
* text: "Action text"
* onTriggered: {
* // do stuff
* }
* },
* Kirigami.Action {
* iconName: "edit"
* text: "Action text"
* onTriggered: {
* // do stuff
* }
* }
* ]
* [...]
* }
* @endcode
*/
//TODO: remove
property alias contextualActions: actionsGroup.contextualActions
/**
* actions.main: Action
* An optional single action for the action button.
* it can be a Kirigami.Action or a QAction
*
* Example usage:
*
* @code
* import org.kde.kirigami 2.2 as Kirigami
* Kirigami.Page {
* actions.main: Kirigami.Action {
* iconName: "edit"
* onTriggered: {
* // do stuff
* }
* }
* }
* @endcode
*/
//TODO: remove
property alias mainAction: actionsGroup.main
/**
* actions.left: Action
* An optional extra action at the left of the main action button.
* it can be a Kirigami.Action or a QAction
*
* Example usage:
*
* @code
* import org.kde.kirigami 2.2 as Kirigami
* Kirigami.Page {
* actions.left: Kirigami.Action {
* iconName: "edit"
* onTriggered: {
* // do stuff
* }
* }
* }
* @endcode
*/
//TODO: remove
property alias leftAction: actionsGroup.left
/**
* actions.right: Action
* An optional extra action at the right of the main action button.
* it can be a Kirigami.Action or a QAction
*
* Example usage:
*
* @code
* import org.kde.kirigami 2.2 as Kirigami
* Kirigami.Page {
* actions.right: Kirigami.Action {
* iconName: "edit"
* onTriggered: {
* // do stuff
* }
* }
* }
* @endcode
*/
//TODO: remove
property alias rightAction: actionsGroup.right
/**
* Actions properties are grouped.
*
* @code
* import org.kde.kirigami 2.2 as Kirigami
* Kirigami.Page {
* actions {
* main: Kirigami.Action {...}
* left: Kirigami.Action {...}
* right: Kirigami.Action {...}
* contextualActions: [
* Kirigami.Action {...},
* Kirigami.Action {...}
* ]
* }
* }
* @endcode
*/
readonly property alias actions: actionsGroup
/**
* isCurrentPage: bool
*
* Specifies if it's the currently selected page in the window's pages row.
*
* @since 2.1
*/
readonly property bool isCurrentPage: applicationWindow().pageStack.layers.depth > 1
? applicationWindow().pageStack.layers.currentItem == root
: applicationWindow().pageStack.currentItem == root
PageActionPropertyGroup {
id: actionsGroup
}
/**
* emitted When the application requests a Back action
* For instance a global "back" shortcut or the Android
* Back button has been pressed.
* The page can manage the back event by itself,
* and if it set event.accepted = true, it will stop the main
* application to manage the back event.
*/
signal backRequested(var event);
anchors.topMargin: (applicationWindow() && !applicationWindow().wideScreen && Kirigami.Settings.isMobile && applicationWindow().controlsVisible && applicationWindow().header ? applicationWindow().header.preferredHeight : 0)
//NOTE: This exists just because control instances require it
contentItem: Item {
onChildrenChanged: {
//NOTE: make sure OverlaySheets are directly under the root
//so they are over all the contents and don't have margins
//search for an OverlaySheet, unfortunately have to blind test properties
//as there is no way to get the classname from qml objects
//TODO: OverlaySheets should be Popup instead?
for (var i = children.length -1; i >= 0; --i) {
var child = children[i];
if (child.toString().indexOf("OverlaySheet") === 0 ||
(child.sheetOpen !== undefined && child.open !== undefined && child.close !== undefined)) {
child.parent = root;
child.z = 9997
}
}
}
}
//on material the shadow would bleed over
clip: header !== undefined
Loader {
id: actionButtons
z: 9999
parent: root
anchors {
left: parent.left
right: parent.right
bottom: parent.bottom
}
//It should be T2.Page, Qt 5.7 doesn't like it
property Item page: root
height: item ? item.height : 0
source: (applicationWindow().header && applicationWindow().header.toString().indexOf("ToolBarApplicationHeader") === 0) ||
(applicationWindow().footer && applicationWindow().footer.visible && applicationWindow().footer.toString().indexOf("ToolBarApplicationHeader") === 0)
? "" : Qt.resolvedUrl("./private/ActionButton.qml")
}
Layout.fillWidth: true
}
|