You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nheko/resources/qml/StatusIndicator.qml

55 lines
1.4 KiB

// SPDX-FileCopyrightText: Nheko Contributors
//
// SPDX-License-Identifier: GPL-3.0-or-later
import QtQuick 2.5
import QtQuick.Controls 2.1
import im.nheko 1.0
ImageButton {
id: indicator
required property string eventId
1 year ago
required property int status
ToolTip.text: {
switch (status) {
case MtxEvent.Failed:
return qsTr("Failed");
case MtxEvent.Sent:
return qsTr("Sent");
case MtxEvent.Received:
return qsTr("Received");
case MtxEvent.Read:
return qsTr("Read");
default:
return "";
}
}
1 year ago
ToolTip.visible: hovered && status != MtxEvent.Empty
changeColorOnHover: (status == MtxEvent.Read)
cursor: (status == MtxEvent.Read) ? Qt.PointingHandCursor : Qt.ArrowCursor
height: 16
hoverEnabled: true
image: {
switch (status) {
case MtxEvent.Failed:
return ":/icons/icons/ui/dismiss.svg";
case MtxEvent.Sent:
return ":/icons/icons/ui/clock.svg";
case MtxEvent.Received:
return ":/icons/icons/ui/checkmark.svg";
case MtxEvent.Read:
return ":/icons/icons/ui/double-checkmark.svg";
default:
return "";
}
}
1 year ago
width: 16
onClicked: {
if (status == MtxEvent.Read)
room.showReadReceipts(eventId);
}
}