From 6646bde7a94e7f9eae034d0494987210368eaeba Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Thu, 22 Aug 2024 22:23:28 +0200 Subject: [PATCH] [ui] GraphEditor.newNodeMenu: fix unstable menu height Use an explicit height on the newNodeMenu, this fixes the issue with unstable size of the menu. --- meshroom/ui/qml/GraphEditor/GraphEditor.qml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/meshroom/ui/qml/GraphEditor/GraphEditor.qml b/meshroom/ui/qml/GraphEditor/GraphEditor.qml index 84422f5e..b774c48e 100755 --- a/meshroom/ui/qml/GraphEditor/GraphEditor.qml +++ b/meshroom/ui/qml/GraphEditor/GraphEditor.qml @@ -224,6 +224,7 @@ Item { id: newNodeMenu property point spawnPosition property variant menuKeys: Object.keys(root.nodeTypesModel).concat(Object.values(MeshroomApp.pipelineTemplateNames)) + height: searchBar.height + nodeMenuRepeater.height + instantiator.height function createNode(nodeType) { uigraph.clearNodeSelection() // Ensures that only the created node / imported pipeline will be selected @@ -268,10 +269,9 @@ Item { } onVisibleChanged: { + searchBar.clear() if (visible) { - // when menu is shown, - // clear and give focus to the TextField filter - searchBar.clear() + // when menu is shown, give focus to the TextField filter searchBar.forceActiveFocus() } } @@ -343,7 +343,8 @@ Item { // Dynamically add the menu categories Instantiator { - model: !(searchBar.text !== "") ? Object.keys(newNodeMenu.parseCategories()).sort() : undefined + id: instantiator + model: (searchBar.text === "") ? Object.keys(newNodeMenu.parseCategories()).sort() : undefined onObjectAdded: newNodeMenu.insertMenu(index + 1, object ) // add sub-menu under the search bar onObjectRemoved: newNodeMenu.removeMenu(object)