Fix Unclickable Invite in RoomPage
Move the invite PlaceholderMessage inside the ListView so mouse events can be received. Fixes network/neochat#558
This commit is contained in:
@@ -108,31 +108,6 @@ Kirigami.ScrollablePage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Kirigami.PlaceholderMessage {
|
|
||||||
id: invitation
|
|
||||||
|
|
||||||
visible: currentRoom && currentRoom.isInvite
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: i18n("Accept this invitation?")
|
|
||||||
RowLayout {
|
|
||||||
QQC2.Button {
|
|
||||||
Layout.alignment : Qt.AlignHCenter
|
|
||||||
text: i18n("Reject")
|
|
||||||
|
|
||||||
onClicked: RoomManager.leaveRoom(page.currentRoom);
|
|
||||||
}
|
|
||||||
|
|
||||||
QQC2.Button {
|
|
||||||
Layout.alignment : Qt.AlignHCenter
|
|
||||||
text: i18n("Accept")
|
|
||||||
|
|
||||||
onClicked: {
|
|
||||||
currentRoom.acceptInvitation();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Kirigami.LoadingPlaceholder {
|
Kirigami.LoadingPlaceholder {
|
||||||
id: loadingIndicator
|
id: loadingIndicator
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
@@ -182,7 +157,6 @@ Kirigami.ScrollablePage {
|
|||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
id: messageListView
|
id: messageListView
|
||||||
visible: !invitation.visible
|
|
||||||
|
|
||||||
readonly property int largestVisibleIndex: count > 0 ? indexAt(contentX + (width / 2), contentY + height - 1) : -1
|
readonly property int largestVisibleIndex: count > 0 ? indexAt(contentX + (width / 2), contentY + height - 1) : -1
|
||||||
readonly property bool isLoaded: page.width * page.height > 10
|
readonly property bool isLoaded: page.width * page.height > 10
|
||||||
@@ -196,6 +170,32 @@ Kirigami.ScrollablePage {
|
|||||||
verticalLayoutDirection: ListView.BottomToTop
|
verticalLayoutDirection: ListView.BottomToTop
|
||||||
highlightMoveDuration: 500
|
highlightMoveDuration: 500
|
||||||
|
|
||||||
|
// HACK: Needs to be here because the flickable in ScrollablePage gets all mouse events.
|
||||||
|
Kirigami.PlaceholderMessage {
|
||||||
|
id: invitation
|
||||||
|
|
||||||
|
visible: currentRoom && currentRoom.isInvite
|
||||||
|
anchors.centerIn: parent
|
||||||
|
text: i18n("Accept this invitation?")
|
||||||
|
RowLayout {
|
||||||
|
QQC2.Button {
|
||||||
|
Layout.alignment : Qt.AlignHCenter
|
||||||
|
text: i18n("Reject")
|
||||||
|
|
||||||
|
onClicked: RoomManager.leaveRoom(page.currentRoom);
|
||||||
|
}
|
||||||
|
|
||||||
|
QQC2.Button {
|
||||||
|
Layout.alignment : Qt.AlignHCenter
|
||||||
|
text: i18n("Accept")
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
currentRoom.acceptInvitation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
model: !isLoaded ? undefined : collapseStateProxyModel
|
model: !isLoaded ? undefined : collapseStateProxyModel
|
||||||
|
|
||||||
MessageEventModel {
|
MessageEventModel {
|
||||||
|
|||||||
Reference in New Issue
Block a user