refactor(StatusPopupMenu): Refactor bug with reopen menu
This commit is contained in:
parent
12f6791d0c
commit
d8d5048622
|
@ -93,20 +93,9 @@ Rectangle {
|
|||
|
||||
property bool showMoreMenu: false
|
||||
onClicked: {
|
||||
if (!showMoreMenu) {
|
||||
popupMenuSlot.item.popup(-popupMenuSlot.item.width + menuButton.width, menuButton.height + 4)
|
||||
statusChatToolBar.menuButtonClicked()
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: menuClosedUpdater
|
||||
interval: 100
|
||||
repeat: false
|
||||
onTriggered: {
|
||||
menuButton.showMoreMenu = false
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: popupMenuSlot
|
||||
|
@ -114,12 +103,10 @@ Rectangle {
|
|||
onLoaded: {
|
||||
popupMenuSlot.item.closeHandler = function () {
|
||||
menuButton.highlighted = false
|
||||
menuClosedUpdater.start()
|
||||
}
|
||||
|
||||
popupMenuSlot.item.openHandler = function () {
|
||||
menuButton.highlighted = true
|
||||
menuButton.showMoreMenu = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,10 @@ Menu {
|
|||
property var openHandler
|
||||
property var closeHandler
|
||||
|
||||
dim: true
|
||||
Overlay.modeless: MouseArea {}
|
||||
|
||||
|
||||
signal menuItemClicked(int menuIndex)
|
||||
|
||||
onOpened: {
|
||||
|
|
Loading…
Reference in New Issue