Set hourglass icon when clicking accept/decline
PyQtFuture's gotResult signal can now be used from QML/JS.
This commit is contained in:
parent
99d5fb551c
commit
677117983a
3
TODO.md
3
TODO.md
@ -22,6 +22,7 @@
|
||||
- Proper button background componant
|
||||
- Collapsible roomList sections, + button
|
||||
- Prevent using the SendBox if no permission (power levels)
|
||||
- Spinner when loading past room events, images or clicking buttons
|
||||
- Reorganize SidePane
|
||||
- Proper theme, with components taking their colors from theme settings
|
||||
- Settings page
|
||||
@ -38,7 +39,6 @@
|
||||
- Client improvements
|
||||
- On sync, check messages API, if a limited sync timeline was received
|
||||
- Markdown: don't turn #things into title (space), disable __ syntax
|
||||
- Spinner when loading past room events or images
|
||||
- Push instead of replacing in stack view
|
||||
- Make links in room subtitle clickable, formatting?
|
||||
- `<pre>` scrollbar on overflow
|
||||
@ -49,6 +49,7 @@
|
||||
it should be the peer's display name instead.
|
||||
|
||||
- Missing nio support
|
||||
- Forget room
|
||||
- Left room events
|
||||
- `org.matrix.room.preview_urls` event
|
||||
- `m.room.aliases` event
|
||||
|
@ -12,14 +12,16 @@ from PyQt5.QtCore import QObject, pyqtProperty, pyqtSignal, pyqtSlot
|
||||
|
||||
|
||||
class PyQtFuture(QObject):
|
||||
gotResult = pyqtSignal()
|
||||
gotResult = pyqtSignal("QVariant")
|
||||
|
||||
def __init__(self, future: Future, parent: QObject) -> None:
|
||||
super().__init__(parent)
|
||||
self.future = future
|
||||
self._result = None
|
||||
|
||||
self.future.add_done_callback(lambda _: self.gotResult.emit())
|
||||
self.future.add_done_callback(
|
||||
lambda future: self.gotResult.emit(future.result())
|
||||
)
|
||||
|
||||
|
||||
def __repr__(self) -> str:
|
||||
|
@ -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
|
||||
|
7
harmonyqml/icons/hourglass.svg
Normal file
7
harmonyqml/icons/hourglass.svg
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Svg Vector Icons : http://www.onlinewebfonts.com/icon -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1000 1000" enable-background="new 0 0 1000 1000" xml:space="preserve">
|
||||
<metadata> Svg Vector Icons : http://www.onlinewebfonts.com/icon </metadata>
|
||||
<g><path d="M926,68v-8.3c0-27.4-22.4-49.8-49.8-49.8H123.7C96.4,10,74,32.4,74,59.8V68c0,27.4,22.4,49.8,49.8,49.8H143c9.9,0,9.1,9.2,9.1,13.9c0,55.3,22.7,119.2,40,160c34.8,81.9,114.1,149,179.2,196.4c11.9,8.7,9,16.7,2.1,22.2c-63.1,50.6-146.1,115.2-181.3,198c-17.1,40.2-39.3,102.7-40,157.4c-0.1,5.6,2.2,16.5-11.2,16.5h-17.1C96.4,882.2,74,904.6,74,932v8.3c0,27.4,22.4,49.8,49.8,49.8h752.5c27.4,0,49.8-22.4,49.8-49.8V932c0-27.4-22.4-49.8-49.8-49.8h-10.8c-19.8,0-17.8-14.8-17.6-22.5c1.4-51.1-13.6-109.1-35.6-152.7c-48.9-97-125.9-158.7-173.4-194.4c-10.3-7.7-11.3-17.3,0-25.1C687.8,453.8,763.4,390,812.3,293c23.4-46.5,38.9-109.3,35.1-162.6c-0.3-4.3-0.6-12.6,10.6-12.6h18.3C903.6,117.8,926,95.4,926,68z M772.6,273c-45.5,90.3-118.4,154.8-181.9,193.8c-3.8,2.3-11.1,8.1-11.1,24.3v19.3c0,17.1,7.8,20.9,11.8,23.4c63.4,39,135.8,103.4,181.1,193.3c20.9,41.6,31.8,91.8,30.7,131.8c-0.2,8.3,3,23.4-18.7,23.4H214.9c-19,0-18.3-9.5-18.2-14.7c0.3-36.4,12.9-86.8,36.3-141.8c40.6-95.5,125.9-155.1,182.7-190.7c2.5-1.6,7.4-4.4,7.4-19.5v-28.9c0-15.6-7.5-21.7-11.4-24.2c-56.7-35.8-139-94.9-178.7-188.1c-23.7-55.6-36.2-106.5-36.3-142.9c0-4.8,0.6-13.6,11.2-13.6h582.9c11.8,0,11.6,8.9,12,13.6C806.1,172.7,795.2,228,772.6,273z"/><path d="M488.4,563.6l-194,242.7c-6.4,8-3.3,14.6,7,14.6h397.2c10.3,0,13.4-6.6,7-14.6l-194-242.7C505.2,555.6,494.8,555.6,488.4,563.6z"/><path d="M486.8,450.8c7.3,7.2,19.2,7.2,26.4,0l97.6-97.3c7.3-7.2,4.8-13.2-5.5-13.2H394.7c-10.3,0-12.7,5.9-5.5,13.2L486.8,450.8z"/></g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.9 KiB |
Loading…
Reference in New Issue
Block a user