2020-07-20 15:29:57 -04:00
|
|
|
import QtQuick 2.13
|
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
|
|
|
|
width: reactionImage.width + Style.current.halfPadding
|
|
|
|
height: width
|
|
|
|
color: reactedByUser ? Style.current.secondaryBackground :
|
|
|
|
(isHovered ? Style.current.backgroundHover : Style.current.transparent)
|
|
|
|
border.width: reactedByUser ? 1 : 0
|
|
|
|
border.color: Style.current.borderTertiary
|
|
|
|
radius: Style.current.radius
|
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|