summary refs log tree commit diff
diff options
context:
space:
mode:
authorLoren Burkholder <computersemiexpert@outlook.com>2021-01-16 10:16:27 -0500
committerLoren Burkholder <computersemiexpert@outlook.com>2021-01-16 10:16:27 -0500
commit7671927fa4c2de3194f0650d5bd7fc48ce03e15b (patch)
tree0b5f935fe8df1b8ea70fc6e5deb26a893ef55065
parentUse an ImageButton for the StatusIndicator (diff)
downloadnheko-7671927fa4c2de3194f0650d5bd7fc48ce03e15b.tar.xz
Remove unnecessary properties; simplify hover code
-rw-r--r--resources/qml/StatusIndicator.qml19
-rw-r--r--resources/qml/TimelineRow.qml2
2 files changed, 5 insertions, 16 deletions
diff --git a/resources/qml/StatusIndicator.qml b/resources/qml/StatusIndicator.qml

index 923fdead..e9659f20 100644 --- a/resources/qml/StatusIndicator.qml +++ b/resources/qml/StatusIndicator.qml
@@ -5,13 +5,11 @@ import im.nheko 1.0 ImageButton { id: indicator - property int state: 0 - property string eventId - width: 16 height: 16 hoverEnabled: true - ToolTip.visible: hovered && state != MtxEvent.Empty + changeColorOnHover: (model.state == MtxEvent.Read) + ToolTip.visible: hovered && model.state != MtxEvent.Empty ToolTip.text: { switch (state) { case MtxEvent.Failed: @@ -28,12 +26,12 @@ ImageButton { } onClicked: { - if (state == MtxEvent.Read) - TimelineManager.timeline.readReceiptsAction(eventId); + if (model.state == MtxEvent.Read) + TimelineManager.timeline.readReceiptsAction(model.id); } image: { - switch (state) { + switch (model.state) { case MtxEvent.Failed: return ":/icons/icons/ui/remove-symbol.png"; case MtxEvent.Sent: @@ -46,11 +44,4 @@ ImageButton { return ""; } } - - changeColorOnHover: { - if (state == MtxEvent.Read) - return true; - else - return false; - } } diff --git a/resources/qml/TimelineRow.qml b/resources/qml/TimelineRow.qml
index 1eb07daa..077171c9 100644 --- a/resources/qml/TimelineRow.qml +++ b/resources/qml/TimelineRow.qml
@@ -69,8 +69,6 @@ Item { } StatusIndicator { - state: model.state - eventId: model.id Layout.alignment: Qt.AlignRight | Qt.AlignTop Layout.preferredHeight: 16 width: 16