Warning, /multimedia/elisa/src/qml/HeaderFooterToolbar.qml is written in an unsupported language. File is not indexed.

0001 /*
0002    SPDX-FileCopyrightText: 2016 (c) Matthieu Gallien <matthieu_gallien@yahoo.fr>
0003    SPDX-FileCopyrightText: 2019 (c) Nate Graham <nate@kde.org>
0004 
0005    SPDX-License-Identifier: LGPL-3.0-or-later
0006  */
0007 
0008 import QtQuick 2.10
0009 import QtQuick.Controls 2.2
0010 import QtQuick.Layouts 1.2
0011 import org.kde.kirigami 2.5 as Kirigami
0012 import org.kde.elisa 1.0
0013 
0014 Rectangle {
0015     enum ToolbarType {
0016         Header, // separator drawn on bottom
0017         Footer, // separator drawn on top
0018         Other   // no separator drawn; used for stacking toolbars
0019     }
0020 
0021     // The type of toolbar it is
0022     property int toolbarType: HeaderFooterToolbar.ToolbarType.Header
0023 
0024     // A list of items to be shown within the header or footer
0025     property alias contentItems: contentLayout.children
0026 
0027     // Spacing of content items. Defaults to Kirigami.Units.smallSpacing
0028     property alias contentLayoutSpacing: contentLayout.spacing
0029 
0030     implicitHeight: Math.round(Kirigami.Units.gridUnit * 2.5)
0031 
0032     color: myPalette.window
0033 
0034     // Top separator line for a footer
0035     Kirigami.Separator {
0036         visible: toolbarType === HeaderFooterToolbar.ToolbarType.Footer
0037         width: parent.width
0038         anchors.top: parent.top
0039     }
0040 
0041     // Content layout
0042     RowLayout {
0043         id: contentLayout
0044 
0045         anchors.fill: parent
0046         anchors.leftMargin: Kirigami.Units.smallSpacing
0047         anchors.rightMargin: Kirigami.Units.smallSpacing
0048 
0049         spacing: Kirigami.Units.smallSpacing
0050 
0051         // Items provided by the contentItems property will go here
0052     }
0053 
0054     // Bottom separator line for a header
0055     Kirigami.Separator {
0056         visible: toolbarType === HeaderFooterToolbar.ToolbarType.Header
0057         width: parent.width
0058         anchors.bottom: parent.bottom
0059     }
0060 }