Skip to content

Popup menu on top #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ Item {
StyledMenuLoader {
id: contextMenuLoader

onMenuChanged: {
if (menu) {
menu.setParentWindow(root.Window.window)
}
}

onHandleMenuItem: function(itemId) {
container.handleMenuItem(itemId)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Loader {
signal openNextMenu()
signal opened()
signal closed(bool force)
signal menuLoaded()

property StyledMenu menu: loader.item as StyledMenu
property Item menuAnchorItem: null
Expand All @@ -42,6 +43,12 @@ Loader {

property string accessibleName: ""

onMenuChanged: {
if (menu) {
loader.menuLoaded()
}
}

QtObject {
id: prv

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ MenuView {
root.subMenuLoader.menuAnchorItem = root.anchorItem
root.subMenuLoader.hasSiblingMenus = root.hasSiblingMenus

root.subMenuLoader.menuLoaded.connect(function() {
root.subMenuLoader.menu.setParentWindow(root.parent.Window.window)
})

root.subMenuLoader.handleMenuItem.connect(function(itemId) {
Qt.callLater(root.handleMenuItem, itemId)
root.subMenuLoader.close()
Expand Down
2 changes: 1 addition & 1 deletion framework/uicomponents/view/popupview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ void PopupView::resolveNavigationParentControl()
setNavigationParentControl(nullptr);
});

setParentWindow(ctrl->window());
// setParentWindow(ctrl->window());
}
}

Expand Down