Plasma-framework

ToolBar.qml
1/*
2 SPDX-FileCopyrightText: 2016 Marco Martin <mart@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7import QtQuick
8import QtQuick.Templates as T
9import org.kde.ksvg as KSvg
10//NOTE: importing PlasmaCore is necessary in order to make KSvg load the current Plasma Theme
11import org.kde.plasma.core as PlasmaCore
12import org.kde.kirigami as Kirigami
13
14T.ToolBar {
15 id: control
16
17 implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
18 contentWidth + leftPadding + rightPadding)
19 implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
20 contentHeight + topPadding + bottomPadding)
21
22 topPadding: (background as KSvg.FrameSvgItem)?.margins.top ?? undefined
23 leftPadding: (background as KSvg.FrameSvgItem)?.margins.left ?? undefined
24 rightPadding: (background as KSvg.FrameSvgItem)?.margins.right ?? undefined
25 bottomPadding: (background as KSvg.FrameSvgItem)?.margins.bottom ?? undefined
26
27 spacing: Kirigami.Units.smallSpacing
28
29 background: KSvg.FrameSvgItem {
30 implicitHeight: 40 // TODO: Find a good way to sync this with the size of (Button or ToolButton) + padding
31 imagePath: "widgets/toolbar"
33 imagePath: "widgets/listitem"
34 elementId: "separator"
35 anchors {
36 left: parent.left
37 right: parent.right
38 top: control.position == T.ToolBar.Footer || (control.parent.footer && control.parent.footer == control) ? parent.top : undefined
39 bottom: control.position == T.ToolBar.Footer || (control.parent.footer && control.parent.footer == control) ? undefined : parent.bottom
40 }
41 }
42 }
43}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:54:11 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.