mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-04-28 17:57:16 +02:00
[ui] GraphEditor: Search filtering fix
Fixed the issue where navigation arrows on the Filtering was allowing to set an index even when the search had null as the result. Accepted signal on the Seach invokes the function rather than invoking the sigal for the button
This commit is contained in:
parent
b0ed5e465e
commit
3a04ce668f
1 changed files with 32 additions and 15 deletions
|
@ -1096,32 +1096,23 @@ Item {
|
|||
textField.onTextChanged: navigation.currentIndex = -1
|
||||
|
||||
onAccepted: {
|
||||
nextArrow.clicked()
|
||||
navigation.navigateForward()
|
||||
}
|
||||
}
|
||||
|
||||
MaterialToolButton {
|
||||
text: MaterialIcons.arrow_left
|
||||
padding: 0
|
||||
enabled: graphSearchBar.text !== ""
|
||||
onClicked: {
|
||||
navigation.currentIndex--
|
||||
if (navigation.currentIndex === -1)
|
||||
navigation.currentIndex = filteredNodes.count - 1
|
||||
navigation.nextItem()
|
||||
}
|
||||
visible: graphSearchBar.text !== ""
|
||||
onClicked: navigation.navigateBackward()
|
||||
}
|
||||
|
||||
MaterialToolButton {
|
||||
id: nextArrow
|
||||
text: MaterialIcons.arrow_right
|
||||
padding: 0
|
||||
enabled: graphSearchBar.text !== ""
|
||||
onClicked: {
|
||||
navigation.currentIndex++
|
||||
if (navigation.currentIndex === filteredNodes.count)
|
||||
navigation.currentIndex = 0
|
||||
navigation.nextItem()
|
||||
}
|
||||
visible: graphSearchBar.text !== ""
|
||||
onClicked: navigation.navigateForward()
|
||||
}
|
||||
|
||||
Label {
|
||||
|
@ -1147,6 +1138,32 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
function navigateForward() {
|
||||
/**
|
||||
* Moves the navigation index forwards and focuses on the next node as per index.
|
||||
*/
|
||||
if (!filteredNodes.count)
|
||||
return
|
||||
|
||||
navigation.currentIndex++
|
||||
if (navigation.currentIndex === filteredNodes.count)
|
||||
navigation.currentIndex = 0
|
||||
navigation.nextItem()
|
||||
}
|
||||
|
||||
function navigateBackward() {
|
||||
/**
|
||||
* Moves the navigation index backwards and focuses on the previous node as per index.
|
||||
*/
|
||||
if (!filteredNodes.count)
|
||||
return
|
||||
|
||||
navigation.currentIndex--
|
||||
if (navigation.currentIndex === -1)
|
||||
navigation.currentIndex = filteredNodes.count - 1
|
||||
navigation.nextItem()
|
||||
}
|
||||
|
||||
function nextItem() {
|
||||
// Compute bounding box
|
||||
var node = nodeRepeater.itemAt(filteredNodes.itemAt(navigation.currentIndex).index_)
|
||||
|
|
Loading…
Add table
Reference in a new issue