2019-09-18 23:58:25 +03:00
|
|
|
import QtQuick 2.5
|
2019-10-06 12:08:13 +03:00
|
|
|
import QtQuick.Controls 2.1
|
2019-11-30 03:43:39 +03:00
|
|
|
import im.nheko 1.0
|
2019-09-18 23:58:25 +03:00
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: indicator
|
|
|
|
property int state: 0
|
|
|
|
color: "transparent"
|
|
|
|
width: 16
|
|
|
|
height: 16
|
2020-01-29 03:20:39 +03:00
|
|
|
ToolTip {
|
|
|
|
palette: colors
|
|
|
|
visible: ma.containsMouse && state != MtxEvent.Empty
|
|
|
|
text: switch (state) {
|
|
|
|
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 ""
|
|
|
|
}
|
2019-09-18 23:58:25 +03:00
|
|
|
}
|
|
|
|
MouseArea{
|
|
|
|
id: ma
|
|
|
|
anchors.fill: parent
|
|
|
|
hoverEnabled: true
|
|
|
|
}
|
|
|
|
|
|
|
|
Image {
|
|
|
|
id: stateImg
|
|
|
|
// Workaround, can't get icon.source working for now...
|
|
|
|
anchors.fill: parent
|
|
|
|
source: switch (indicator.state) {
|
2019-11-08 16:39:45 +03:00
|
|
|
case MtxEvent.Failed: return "image://colorimage/:/icons/icons/ui/remove-symbol.png?" + colors.buttonText
|
|
|
|
case MtxEvent.Sent: return "image://colorimage/:/icons/icons/ui/clock.png?" + colors.buttonText
|
|
|
|
case MtxEvent.Received: return "image://colorimage/:/icons/icons/ui/checkmark.png?" + colors.buttonText
|
|
|
|
case MtxEvent.Read: return "image://colorimage/:/icons/icons/ui/double-tick-indicator.png?" + colors.buttonText
|
2019-09-18 23:58:25 +03:00
|
|
|
default: return ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|