Warning, /plasma/qqc2-breeze-style/style/qtquickcontrols/ToolBar.qml is written in an unsupported language. File is not indexed.

0001 /* SPDX-FileCopyrightText: 2020 Noah Davis <noahadvs@gmail.com>
0002  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0003  */
0004 
0005 import QtQuick
0006 import QtQuick.Templates as T
0007 import org.kde.kirigami as Kirigami
0008 
0009 import org.kde.breeze.impl as Impl
0010 
0011 T.ToolBar {
0012     id: control
0013 
0014     readonly property bool __isHeader: control.position === T.ToolBar.Header
0015     readonly property bool __isFooter: control.position === T.ToolBar.Footer
0016 
0017     implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
0018                             contentWidth + leftPadding + rightPadding)
0019     implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
0020                              contentHeight + topPadding + bottomPadding)
0021 
0022     spacing: Kirigami.Units.smallSpacing
0023 
0024     padding: Kirigami.Units.smallSpacing
0025 
0026     // Add space for the separator above the footer
0027     topPadding: __isFooter && background && background.hasOwnProperty("separator") ?
0028         background.separator.height + verticalPadding : verticalPadding
0029     // Add space for the separator below the header
0030     bottomPadding: __isHeader && background && background.hasOwnProperty("separator") ?
0031         background.separator.height + verticalPadding : verticalPadding
0032 
0033     Kirigami.Theme.colorSet: __isHeader ? Kirigami.Theme.Header : Kirigami.Theme.Window
0034     Kirigami.Theme.inherit: false
0035 
0036     background: Rectangle {
0037         // Enough height for Buttons/ComboBoxes/TextFields with smallSpacing padding on top and bottom
0038         implicitHeight: Impl.Units.mediumControlHeight + (Kirigami.Units.smallSpacing * 2) + (separator.visible ? separator.height : 0)
0039         color: Kirigami.Theme.backgroundColor
0040         property Item separator: Kirigami.Separator {
0041             parent: background
0042             visible: control.__isHeader || control.__isFooter
0043             width: parent.width
0044             y: control.__isFooter ? 0 : parent.height - height
0045         }
0046     }
0047 }