Warning, /frameworks/qqc2-desktop-style/org.kde.desktop/ToolBar.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2017 Marco Martin <mart@kde.org>
0003     SPDX-FileCopyrightText: 2017 The Qt Company Ltd.
0004 
0005     SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-or-later
0006 */
0007 
0008 
0009 import QtQuick 2.6
0010 import QtQuick.Templates 2.15 as T
0011 import org.kde.kirigami 2.4 as Kirigami
0012 
0013 T.ToolBar {
0014     id: controlRoot
0015 
0016     implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, contentWidth + leftPadding + rightPadding)
0017     implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, contentHeight + topPadding + bottomPadding)
0018 
0019     padding: Kirigami.Units.smallSpacing
0020     contentItem: Item {}
0021     position: controlRoot.parent.footer === controlRoot ? ToolBar.Footer : ToolBar.Header
0022 
0023     // Use Header colors if it's a header and Header colors are available
0024     // (if not, this will fall back to window colors)
0025     // Window colors
0026     Kirigami.Theme.colorSet: position === T.ToolBar.Footer || (parent.footer && parent.footer === controlRoot) ? Kirigami.Theme.Window : Kirigami.Theme.Header
0027     Kirigami.Theme.inherit: false
0028 
0029     background: Rectangle {
0030         implicitHeight: 40
0031         color: Kirigami.Theme.backgroundColor
0032         Kirigami.Separator {
0033             anchors {
0034                 left: parent.left
0035                 right: parent.right
0036                 top: controlRoot.position === T.ToolBar.Footer || (controlRoot.parent.footer && controlRoot.parent.footer === controlRoot) ? parent.top : undefined
0037                 bottom: controlRoot.position === T.ToolBar.Footer || (controlRoot.parent.footer && controlRoot.parent.footer === controlRoot) ? undefined : parent.bottom
0038             }
0039         }
0040     }
0041 }