a-la-karte/src/qml/components/EmptyState.qml
Marco Allegretti 747b02035a alakarte: Initial import
Initial release of A-La-Karte, a unified game launcher for KDE Plasma.

Includes the QML UI, platform importers, AppStream metadata, icons,

and developer documentation.
2026-01-18 13:13:07 +01:00

54 lines
1.5 KiB
QML

// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: 2024 A-La-Karte Contributors
import QtQuick
import QtQuick.Controls as QQC2
import QtQuick.Layouts
import org.kde.kirigami as Kirigami
ColumnLayout {
id: emptyState
property string icon: "applications-games"
property string title: ""
property string description: ""
property string actionText: ""
signal actionTriggered()
spacing: Kirigami.Units.largeSpacing
width: parent ? Math.min(parent.width - Kirigami.Units.gridUnit * 4, Kirigami.Units.gridUnit * 20) : Kirigami.Units.gridUnit * 20
Kirigami.Icon {
source: emptyState.icon
Layout.preferredWidth: Kirigami.Units.iconSizes.enormous
Layout.preferredHeight: Kirigami.Units.iconSizes.enormous
Layout.alignment: Qt.AlignHCenter
opacity: 0.5
}
Kirigami.Heading {
text: emptyState.title
level: 2
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap
Layout.fillWidth: true
}
QQC2.Label {
text: emptyState.description
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap
color: Kirigami.Theme.disabledTextColor
Layout.fillWidth: true
visible: text.length > 0
}
QQC2.Button {
text: emptyState.actionText
icon.name: "document-import"
Layout.alignment: Qt.AlignHCenter
visible: emptyState.actionText.length > 0
onClicked: emptyState.actionTriggered()
}
}