Fix room forget and buttons bugs

This commit is contained in:
miruka
2019-04-26 16:52:26 -04:00
parent 5988eccdbb
commit c7dd602687
6 changed files with 33 additions and 17 deletions

View File

@@ -60,6 +60,7 @@ Button {
}
MouseArea {
z: 101
anchors.fill: parent
hoverEnabled: true
propagateComposedEvents: true

View File

@@ -81,26 +81,33 @@ Rectangle {
iconName: modelData.iconName
display: bannerButtons.displayMode
onClicked: {
if (alreadyClicked) { return }
MouseArea {
anchors.fill: parent
propagateComposedEvents: true
onClicked: {
if (alreadyClicked) { return }
iconName = "hourglass"
alreadyClicked = true
iconName = "hourglass"
alreadyClicked = true
// modelData might become undefined after Backend call
var signalId = modelData.signalId
var iconName_ = modelData.iconName
// modelData might be undefined after Backend call
var signalId = modelData.signalId
var isForget =
modelData.clientFunction === "forgetRoom"
var future =
Backend.clientManager.clients[chatPage.userId].
call(modelData.clientFunction,
modelData.clientArgs)
var future =
Backend.clientManager.clients[chatPage.userId].
call(modelData.clientFunction,
modelData.clientArgs)
future.onGotResult.connect(function() {
iconName = iconName_
})
if (! isForget) {
future.onGotResult.connect(function() {
iconName = modelData.iconName
})
}
if (signalId) { buttonClicked(signalId) }
if (signalId) { buttonClicked(signalId) }
}
}
Layout.maximumWidth: bannerButtons.compact ? height : -1

View File

@@ -111,6 +111,7 @@ Image {
Base.HButton {
text: qsTr("Login")
Layout.fillWidth: true
}
Base.HButton {
text: qsTr("Forgot?")