/usr/lib/x86_64-linux-gnu/qt5/qml/org/kde/kirigami.2/ItemViewHeader.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 | /*
* Copyright 2017 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.5
import QtQuick.Templates 2.0 as T2
import QtGraphicalEffects 1.0
import org.kde.kirigami 2.2 as Kirigami
import "private"
/**
* An item that can be used as an header for a ListView.
* It will play nice with the margin policies of ScrollablePage and can
* automatically shrink when the list is scrolled, like the behavior
* of list headers in many mobile applications.
* It provides some default content: a title and an optional background image
* @since 2.1
*/
Kirigami.AbstractItemViewHeader {
id: root
property alias title: heading.text
property alias color: heading.color
property alias backgroundImage: image
maximumHeight: (backgroundImage.hasImage ? 10 : 6) * Kirigami.Units.gridUnit - (applicationWindow().header ? applicationWindow().header.height : 0) - bottomPadding
bottomPadding: Kirigami.Units.smallSpacing
leftPadding: Kirigami.Units.smallSpacing
background: Rectangle {
id: backgroundItem
color: Kirigami.Theme.backgroundColor
Image {
id: image
anchors.fill: parent
readonly property bool hasImage: backgroundImage.status === Image.Ready || backgroundImage.status === Image.Loading
fillMode: Image.PreserveAspectCrop
asynchronous: true
}
EdgeShadow {
edge: root.view.headerPositioning == ListView.InlineHeader ? Qt.BottomEdge : Qt.TopEdge
anchors {
right: parent.right
left: parent.left
top: root.view.headerPositioning == ListView.InlineHeader ? undefined : parent.bottom
bottom: root.view.headerPositioning == ListView.InlineHeader ? parent.top : undefined
}
}
readonly property Page page: {
var obj = root.view;
while(obj && !obj.hasOwnProperty("title") && !obj.hasOwnProperty("isCurrentPage")) {
obj = obj.parent
}
return obj;
}
Rectangle {
id: rect
color: backgroundItem.page.isCurrentPage ? Kirigami.Theme.highlightColor : Kirigami.Theme.disabledTextColor
height: root.bottomPadding
anchors {
left: parent.left
right: parent.right
bottom: parent.bottom
}
}
}
contentItem: Item {
Kirigami.Heading {
id: heading
anchors {
fill: parent
margins: Kirigami.Units.smallSpacing
}
height: undefined
text: page.title
fontSizeMode: Text.Fit
minimumPointSize: 10
font.pointSize: 30
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignBottom
color: root.backgroundImage.hasImage ? Kirigami.Theme.highlightedTextColor : Kirigami.Theme.highlightColor
opacity: 1
elide: Text.ElideRight
layer.enabled: root.backgroundImage.hasImage
layer.effect: DropShadow {
horizontalOffset: 0
verticalOffset: 2
radius: Kirigami.Units.smallSpacing*2
samples: 32
color: Qt.rgba(0, 0, 0, 0.7)
}
}
}
}
|