Kirigami2

AbstractPageHeader.qml
1/*
2 * SPDX-FileCopyrightText: 2018 Marco Martin <mart@kde.org>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7import QtQuick
8import org.kde.kirigami as Kirigami
9
10Kirigami.AbstractApplicationHeader {
11 id: root
12 // anchors.fill: parent
13 property Item container
14 property bool current
15
16 minimumHeight: pageRow ? pageRow.globalToolBar.minimumHeight : Kirigami.Units.iconSizes.medium + Kirigami.Units.smallSpacing * 2
17 maximumHeight: pageRow ? pageRow.globalToolBar.maximumHeight : minimumHeight
18 preferredHeight: pageRow ? pageRow.globalToolBar.preferredHeight : minimumHeight
19
20 separatorVisible: pageRow ? pageRow.globalToolBar.separatorVisible : true
21
22 Kirigami.Theme.colorSet: pageRow ? pageRow.globalToolBar.colorSet : Kirigami.Theme.Header
23
24 leftPadding: pageRow
25 ? Math.min(
26 width / 2,
27 Math.max(
28 (page.title.length > 0 ? pageRow.globalToolBar.titleLeftPadding : 0),
29 Qt.application.layoutDirection === Qt.LeftToRight
30 ? Math.min(pageRow.globalToolBar.leftReservedSpace,
31 pageRow.Kirigami.ScenePosition.x
32 - page.Kirigami.ScenePosition.x
33 + pageRow.globalToolBar.leftReservedSpace)
34 + Kirigami.Units.smallSpacing
35 : Math.min(pageRow.globalToolBar.leftReservedSpace,
36 -pageRow.width
37 + pageRow.Kirigami.ScenePosition.x
38 + page.Kirigami.ScenePosition.x
39 + page.width
40 + pageRow.globalToolBar.leftReservedSpace)
41 + Kirigami.Units.smallSpacing))
42 : Kirigami.Units.smallSpacing
43 rightPadding: pageRow
44 ? Math.max(0,
45 Qt.application.layoutDirection === Qt.LeftToRight
46 ? (-pageRow.width
47 - pageRow.Kirigami.ScenePosition.x
48 + page.width
49 + page.Kirigami.ScenePosition.x
50 + pageRow.globalToolBar.rightReservedSpace)
51 : (pageRow.Kirigami.ScenePosition.x
52 - page.Kirigami.ScenePosition.x
53 + pageRow.globalToolBar.rightReservedSpace))
54 : 0
55}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:56:52 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.