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