69 lines
2.3 KiB
QML
69 lines
2.3 KiB
QML
// SPDX-FileCopyrightText: 2024 Tobias Fella <tobias.fella@kde.org>
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
import QtQuick
|
|
import QtQuick.Controls as QQC2
|
|
import QtQuick.Layouts
|
|
import org.kde.kirigami as Kirigami
|
|
import org.kde.kirigamiaddons.formcard as FormCard
|
|
import org.kde.kirigamiaddons.components
|
|
|
|
import org.kde.neochat
|
|
|
|
Kirigami.Dialog {
|
|
id: root
|
|
|
|
property var connection
|
|
|
|
leftPadding: 0
|
|
rightPadding: 0
|
|
topPadding: 0
|
|
bottomPadding: 0
|
|
|
|
title: i18nc("@title Join <name of a space>", "Join %1", SpaceHierarchyCache.recommendedSpaceDisplayName)
|
|
|
|
width: Math.min(QQC2.ApplicationWindow.window.width, Kirigami.Units.gridUnit * 24)
|
|
|
|
contentItem: ColumnLayout {
|
|
FormCard.AbstractFormDelegate {
|
|
background: null
|
|
contentItem: RowLayout {
|
|
spacing: Kirigami.Units.largeSpacing
|
|
Avatar {
|
|
source: SpaceHierarchyCache.recommendedSpaceAvatar.toString().length > 0 ? root.connection.makeMediaUrl(SpaceHierarchyCache.recommendedSpaceAvatar) : 0
|
|
name: SpaceHierarchyCache.recommendedSpaceDisplayName
|
|
}
|
|
ColumnLayout {
|
|
Layout.fillWidth: true
|
|
Kirigami.Heading {
|
|
Layout.fillWidth: true
|
|
text: SpaceHierarchyCache.recommendedSpaceDisplayName
|
|
}
|
|
QQC2.Label {
|
|
Layout.fillWidth: true
|
|
text: SpaceHierarchyCache.recommendedSpaceDescription
|
|
}
|
|
}
|
|
}
|
|
}
|
|
FormCard.FormDelegateSeparator {}
|
|
FormCard.FormButtonDelegate {
|
|
text: i18nc("@action:button", "Join")
|
|
icon.name: "list-add-symbolic"
|
|
onClicked: {
|
|
SpaceHierarchyCache.recommendedSpaceHidden = true;
|
|
RoomManager.resolveResource(SpaceHierarchyCache.recommendedSpaceId, "join");
|
|
root.close();
|
|
}
|
|
}
|
|
FormCard.FormButtonDelegate {
|
|
icon.name: "mail-thread-ignored-symbolic"
|
|
text: i18nc("@action:button", "Ignore")
|
|
onClicked: {
|
|
SpaceHierarchyCache.recommendedSpaceHidden = true;
|
|
root.close();
|
|
}
|
|
}
|
|
}
|
|
}
|