Kirigami2

PageRowGlobalToolBarStyleGroup.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
10QtObject {
11 id: globalToolBar
12 property int style: Kirigami.ApplicationHeaderStyle.None
13
14 readonly property int actualStyle: {
15 if (style === Kirigami.ApplicationHeaderStyle.Auto) {
16 if (!Kirigami.Settings.isMobile) {
17 return Kirigami.ApplicationHeaderStyle.ToolBar
18 } else if (root.wideMode) {
19 return Kirigami.ApplicationHeaderStyle.Titles
20 } else {
21 return Kirigami.ApplicationHeaderStyle.Breadcrumb
22 }
23 }
24 return style;
25 }
26
27 /** @property kirigami::ApplicationHeaderStyle::NavigationButtons */
28 property int showNavigationButtons: (!Kirigami.Settings.isMobile || Qt.platform.os === "ios")
29 ? (Kirigami.ApplicationHeaderStyle.ShowBackButton | Kirigami.ApplicationHeaderStyle.ShowForwardButton)
30 : Kirigami.ApplicationHeaderStyle.NoNavigationButtons
31 property bool separatorVisible: true
32 //Unfortunately we can't access pageRow.globalToolbar.Kirigami.Theme directly in a declarative way
33 property int colorSet: Kirigami.Theme.Header
34 // whether or not the header should be
35 // "pushed" back when scrolling using the
36 // touch screen
37 property bool hideWhenTouchScrolling: false
38 /**
39 * If true, when any kind of toolbar is shown, the drawer handles will be shown inside the toolbar, if they're present
40 */
41 property bool canContainHandles: true
42 property int toolbarActionAlignment: Qt.AlignRight
43 property int toolbarActionHeightMode: Kirigami.ToolBarLayout.ConstrainIfLarger
44
45 property int minimumHeight: 0
46 // FIXME: Figure out the exact standard size of a Toolbar
47 property int preferredHeight: (actualStyle === Kirigami.ApplicationHeaderStyle.ToolBar
48 ? Kirigami.Units.iconSizes.medium
49 : Kirigami.Units.gridUnit * 1.8) + Kirigami.Units.smallSpacing * 2
50 property int maximumHeight: preferredHeight
51
52 // Sets the minimum leading padding for the title in a page header
53 property int titleLeftPadding: Kirigami.Units.gridUnit
54}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 3 2024 11:49:34 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.