Kirigami2

AbstractPageHeader.qml
1 /*
2  * SPDX-FileCopyrightText: 2018 Marco Martin <[email protected]>
3  *
4  * SPDX-License-Identifier: LGPL-2.0-or-later
5  */
6 
7 import QtQuick 2.15
8 import org.kde.kirigami 2.19 as Kirigami
9 
10 Kirigami.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 ? (Math.min(Qt.application.layoutDirection === Qt.LeftToRight
25  ? Math.max(page.title.length > 0 ? pageRow.globalToolBar.titleLeftPadding : 0, pageRow.Kirigami.ScenePosition.x - page.Kirigami.ScenePosition.x + pageRow.globalToolBar.leftReservedSpace + Kirigami.Units.smallSpacing)
26  : Math.max(page.title.length > 0 ? pageRow.globalToolBar.titleLeftPadding : 0, -pageRow.width + pageRow.Kirigami.ScenePosition.x + page.Kirigami.ScenePosition.x + page.width + pageRow.globalToolBar.leftReservedSpace),
27  width/2))
28  : Kirigami.Units.smallSpacing
29 
30  rightPadding: pageRow ? (Qt.application.layoutDirection === Qt.LeftToRight
31  ? Math.max(0, -pageRow.width - pageRow.Kirigami.ScenePosition.x + page.Kirigami.ScenePosition.x + page.width + pageRow.globalToolBar.rightReservedSpace)
32  : Math.max(0, pageRow.Kirigami.ScenePosition.x - page.Kirigami.ScenePosition.x + pageRow.globalToolBar.rightReservedSpace))
33  : 0
34 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Jan 29 2023 04:11:03 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.