2024-10-15 19:26:12 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
|
|
|
|
import StatusQ.Core.Theme 0.1
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
2020-07-20 19:29:57 +00:00
|
|
|
|
2021-02-01 20:37:50 +00:00
|
|
|
Rectangle {
|
|
|
|
property alias source: reactionImage.source
|
2020-07-20 19:29:57 +00:00
|
|
|
property int emojiId
|
2021-02-01 20:37:50 +00:00
|
|
|
property bool reactedByUser: false
|
2021-02-02 16:24:45 +00:00
|
|
|
property bool isHovered: false
|
2021-10-01 15:58:36 +00:00
|
|
|
signal closeModal()
|
2021-02-01 20:37:50 +00:00
|
|
|
|
|
|
|
id: root
|
2024-10-15 19:26:12 +00:00
|
|
|
width: reactionImage.width + Theme.halfPadding
|
2021-02-01 20:37:50 +00:00
|
|
|
height: width
|
2024-10-15 19:26:12 +00:00
|
|
|
color: reactedByUser ? Theme.palette.secondaryBackground :
|
|
|
|
(isHovered ? Theme.palette.backgroundHover : Theme.palette.transparent)
|
2021-02-01 20:37:50 +00:00
|
|
|
border.width: reactedByUser ? 1 : 0
|
2024-10-15 19:26:12 +00:00
|
|
|
border.color: Theme.palette.primaryColor1
|
|
|
|
radius: Theme.radius
|
2021-02-01 20:37:50 +00:00
|
|
|
|
|
|
|
SVGImage {
|
|
|
|
id: reactionImage
|
|
|
|
width: 32
|
|
|
|
fillMode: Image.PreserveAspectFit
|
|
|
|
anchors.centerIn: parent
|
|
|
|
}
|
2020-07-20 19:29:57 +00:00
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
2021-02-01 20:37:50 +00:00
|
|
|
hoverEnabled: !reactedByUser
|
|
|
|
onEntered: root.isHovered = true
|
|
|
|
onExited: root.isHovered = false
|
2020-07-20 19:29:57 +00:00
|
|
|
onClicked: {
|
2021-10-01 15:58:36 +00:00
|
|
|
root.closeModal();
|
2020-07-20 19:29:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|