Warning, /network/neochat/src/qml/SectionDelegate.qml is written in an unsupported language. File is not indexed.

0001 // SPDX-FileCopyrightText: 2019 Black Hat <bhat@encom.eu.org>
0002 // SPDX-FileCopyrightText: 2020 Carl Schwan <carl@carlschwan.eu>
0003 // SPDX-License-Identifier: GPL-3.0-only
0004 
0005 import QtQuick
0006 import QtQuick.Controls as QQC2
0007 import QtQuick.Layouts
0008 
0009 import org.kde.kirigami as Kirigami
0010 
0011 import org.kde.neochat
0012 import org.kde.neochat.config
0013 
0014 QQC2.ItemDelegate {
0015     id: root
0016 
0017     property alias labelText: sectionLabel.text
0018     property var maxWidth: Number.POSITIVE_INFINITY
0019 
0020     property int colorSet: Kirigami.Theme.Window
0021 
0022     leftPadding: 0
0023     rightPadding: 0
0024     topPadding: Kirigami.Units.largeSpacing
0025     bottomPadding: 0 // Note not 0 by default
0026 
0027     contentItem: ColumnLayout {
0028         spacing: Kirigami.Units.smallSpacing
0029         Layout.fillWidth: true
0030 
0031         Kirigami.Heading {
0032             id: sectionLabel
0033             level: 4
0034             color: Kirigami.Theme.disabledTextColor
0035             horizontalAlignment: Text.AlignHCenter
0036             verticalAlignment: Text.AlignVCenter
0037             Layout.fillWidth: true
0038             Layout.maximumWidth: maxWidth
0039         }
0040         Kirigami.Separator {
0041             Layout.fillWidth: true
0042             Layout.maximumWidth: maxWidth
0043         }
0044     }
0045 
0046     background: Rectangle {
0047         color: Config.blur ? "transparent" : Kirigami.Theme.backgroundColor
0048         Kirigami.Theme.inherit: false
0049         Kirigami.Theme.colorSet: root.colorSet
0050     }
0051 }