fix(StatusChatInfoButton): disable hover effects when sensor is disabled

Closes #231
This commit is contained in:
Pascal Precht 2021-07-06 11:22:41 +02:00 committed by Pascal Precht
parent cbdaf12814
commit f7e38c9c72
1 changed files with 3 additions and 2 deletions

View File

@ -22,6 +22,7 @@ Rectangle {
property StatusIconSettings icon: StatusIconSettings {} property StatusIconSettings icon: StatusIconSettings {}
property int type: StatusChatInfoButton.Type.PublicChat property int type: StatusChatInfoButton.Type.PublicChat
property alias tooltip: statusToolTip property alias tooltip: statusToolTip
property alias sensor: sensor
signal clicked(var mouse) signal clicked(var mouse)
signal pinnedMessagesCountClicked(var mouse) signal pinnedMessagesCountClicked(var mouse)
@ -38,13 +39,13 @@ Rectangle {
} }
radius: 8 radius: 8
color: sensor.containsMouse ? Theme.palette.baseColor2 : "transparent" color: sensor.enabled && sensor.containsMouse ? Theme.palette.baseColor2 : "transparent"
MouseArea { MouseArea {
id: sensor id: sensor
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
onClicked: statusChatInfoButton.clicked(mouse) onClicked: statusChatInfoButton.clicked(mouse)