fix: close chat menu when re-clicking the button
This commit is contained in:
parent
bcee0079e5
commit
b5619dadaf
|
@ -77,6 +77,8 @@ Rectangle {
|
||||||
font.pixelSize: 25
|
font.pixelSize: 25
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
property bool menuOpened: false
|
||||||
|
|
||||||
id: mouseArea
|
id: mouseArea
|
||||||
// The negative margins are for the mouse area to be a bit more wide around the button and have more space for the click
|
// The negative margins are for the mouse area to be a bit more wide around the button and have more space for the click
|
||||||
anchors.topMargin: -10
|
anchors.topMargin: -10
|
||||||
|
@ -90,9 +92,14 @@ Rectangle {
|
||||||
menu = groupContextMenu
|
menu = groupContextMenu
|
||||||
}
|
}
|
||||||
|
|
||||||
menu.arrowX = menu.width - 40
|
if (!menuOpened) {
|
||||||
menu.popup(moreActionsBtn.x, moreActionsBtn.height + 10)
|
menu.arrowX = menu.width - 40
|
||||||
|
menu.popup(moreActionsBtn.x, moreActionsBtn.height + 10)
|
||||||
|
menuOpened = true
|
||||||
|
} else {
|
||||||
|
menu.dismiss()
|
||||||
|
menuOpened = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||||
|
|
Loading…
Reference in New Issue