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

0001 // SPDX-FileCopyrightText: 2022 James Graham <james.h.graham@protonmail.com>
0002 // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0003 
0004 import QtQuick
0005 import QtQuick.Controls as QQC2
0006 import QtQuick.Layouts
0007 
0008 import org.kde.kirigami as Kirigami
0009 
0010 RowLayout {
0011     property alias mimeIconSource: icon.source
0012     property alias label: nameLabel.text
0013     property alias subLabel: subLabel.text
0014 
0015     spacing: Kirigami.Units.largeSpacing
0016 
0017     Kirigami.Icon {
0018         id: icon
0019 
0020         fallback: "unknown"
0021     }
0022     ColumnLayout {
0023         Layout.alignment: Qt.AlignVCenter
0024         Layout.fillWidth: true
0025 
0026         spacing: 0
0027 
0028         QQC2.Label {
0029             id: nameLabel
0030 
0031             Layout.fillWidth: true
0032             Layout.alignment: subLabel.visible ? Qt.AlignLeft | Qt.AlignBottom : Qt.AlignLeft | Qt.AlignVCenter
0033 
0034             elide: Text.ElideRight
0035         }
0036         QQC2.Label {
0037             id: subLabel
0038 
0039             Layout.fillWidth: true
0040 
0041             elide: Text.ElideRight
0042             visible: text.length > 0
0043             opacity: 0.7
0044         }
0045     }
0046 }