Set hourglass icon when clicking accept/decline
PyQtFuture's gotResult signal can now be used from QML/JS.
This commit is contained in:
@@ -73,16 +73,29 @@ Rectangle {
|
||||
model: []
|
||||
|
||||
Base.HButton {
|
||||
id: declineButton
|
||||
property bool alreadyClicked: false
|
||||
|
||||
text: modelData.text
|
||||
iconName: modelData.iconName
|
||||
icon.color: modelData.iconColor
|
||||
icon.width: 32
|
||||
display: bannerButtons.displayMode
|
||||
|
||||
onClicked:
|
||||
Backend.clientManager.clients[chatPage.userId].
|
||||
call(modelData.clientFunction, modelData.clientArgs)
|
||||
onClicked: {
|
||||
if (alreadyClicked) { console.log("all"); return }
|
||||
|
||||
iconName = "hourglass"
|
||||
alreadyClicked = true
|
||||
|
||||
var future =
|
||||
Backend.clientManager.clients[chatPage.userId].
|
||||
call(modelData.clientFunction,
|
||||
modelData.clientArgs)
|
||||
|
||||
future.onGotResult.connect(
|
||||
function() { iconName = modelData.iconName }
|
||||
)
|
||||
}
|
||||
|
||||
Layout.maximumWidth: bannerButtons.compact ? height : -1
|
||||
Layout.fillHeight: true
|
||||
|
Reference in New Issue
Block a user