-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[ui] Improve Search Bar component #2581
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
Conversation
| Layout.rightMargin: 10 | ||
| Layout.leftMargin: 10 | ||
|
|
||
| toggle: true // enable toggling the actual text field by the search button |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| toggle: true // enable toggling the actual text field by the search button | |
| toggle: true // enable toggling the actual text field by the search button | |
| isVisible: true |
I think the search bar should already be expanded in the case of the 3D inspector. Otherwise, you just have the magnifier icon on the top-left that blocks the entire row while the loaded elements are displayed on the entire row below, and it creates a major imbalance visually speaking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have reverted the search bar UI on the Inspector 3d to be the default as how it used to be.
Keeping in mind that a toggle feature here does not do us any good, even hidden the search bar takes an entire row.
That should make it better.
| anchors.right: parent.right | ||
| anchors.verticalCenter: parent.verticalCenter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is now fixed with the change here,
| anchors.rightMargin: 2 // Leave a tiny bit of space so that its highlight does not overlap with the boundary of the parent |
This change ensures we're leaving sufficient space on the right side as to not overlap with the parent's bounds.
Hoping this makes it better 🙂
| Layout.minimumWidth: searchBar.width | ||
| maxWidth: parent.width |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something around here triggers the following binding loop:
meshroom/ui/qml/Viewer3D/Inspector3D.qml:280:9: QML Group: Binding loop detected for property "implicitWidth"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inspector 3d gets the default search bar, so this warning doesn't appear anymore.
1a0d2cf to
65660ae
Compare
65660ae to
37b1b6a
Compare
yann-lty
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | ||
|
|
||
| // Handle enter Key press and forward it to the parent | ||
| Keys.onPressed: (event)=> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be using the more semantic onAccepted slot to have both Return and Enter key considered
(to work with Enter key on numpad).
The root signal for the search bar could be accepted to match that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The core signal from the class is updated to be called accepted but using onAccepted instead of Keys.onPressed currently is emitting the signal twice so keeping it same at the moment,
Have updated the event to consider both Return and Number Pad Enter key though.
| } | ||
| function modelData(item, roleName_) { | ||
| return item.model.object[roleName_] | ||
| Item { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, could you elaborate on why this extra Item is needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started facing the issue with Qt6 rebase where the width of the panel reacts to the model contents in the repeater, as the filteredNodes repeater has root.graph.nodes as the model, a new node getting add to the graph was increasing the width of the panel and same when the node gets removed, the width would get decreased. Prior to Qt6 this was working as expected without need for the additional Item which is hidden.
meshrec.mp4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have taken the easy road here, just the previous code with the delegate Item { visible: false } avoids this issue as of now, so we don't have to add an extra item. I see other search mechanisms in Meshroom also user a SortFilterDelegate so keeping it same at the moment.
| textField.onTextChanged: navigation.currentIndex = -1 | ||
|
|
||
| onReturnPressed: { | ||
| nextArrow.clicked() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be great to have a dedicated function to change the navigation current index, instead of triggering the event of another button here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is updated to now invoke navigation.navigateForward() instead
49b1e89 to
2a27f4c
Compare
…the search button. SearchBar gets the clear text feature allowing text to be cleared with a single click. Added accepted signal for the Searchbar with Return and Enter key Press
Search bar is now placed in the bottom pane of the Graph Editor making it non-obstructing for navigating nodes across Graph Editor
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
Node Editor search can now be toggled making it take lesser space by default.




Description
Search bar Updates