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