moment/src/gui/Popups/LeaveRoomPopup.qml

54 lines
1.3 KiB
QML
Raw Normal View History

// Copyright Mirage authors & contributors <https://github.com/mirukana/mirage>
2019-12-19 07:46:16 -04:00
// SPDX-License-Identifier: LGPL-3.0-or-later
2019-09-09 09:12:51 -04:00
import QtQuick 2.12
import "../Base"
import "../Base/Buttons"
2019-09-09 09:12:51 -04:00
HFlickableColumnPopup {
id: popup
2019-09-09 09:12:51 -04:00
property string userId: ""
property string roomId: ""
property string roomName: ""
property string inviterId: ""
2019-09-09 20:24:29 -04:00
property var leftCallback: null
page.footer: AutoDirectionLayout {
ApplyButton {
id: leaveButton
icon.name: "room-leave"
text: inviterId ? qsTr("Decline") : qsTr("Leave")
onClicked: {
py.callClientCoro(userId, "room_leave", [roomId], leftCallback)
popup.close()
}
}
CancelButton {
onClicked: popup.close()
}
}
onOpened: leaveButton.forceActiveFocus()
SummaryLabel {
readonly property string roomText:
utils.htmlColorize(roomName, theme.colors.accentText)
textFormat: Text.StyledText
text:
inviterId ?
qsTr("Decline invite to %1?").arg(roomText) :
qsTr("Leave %1?").arg(roomText)
}
DetailsLabel {
visible: inviterId === ""
text: qsTr(
"If this room is private, you will not be able to rejoin it."
)
}
2019-09-09 09:12:51 -04:00
}