Scene Dock: Simplify Filter Nodes related UI#112343
Scene Dock: Simplify Filter Nodes related UI#112343akien-mga merged 1 commit intogodotengine:masterfrom
Conversation
|
The menu options don't mention shorthands ( |
2526c42 to
1d4a807
Compare
|
Updated. The shorthand is now mentioned in the menu item's tooltip. See OP. |
|
Placeholder part is actually covered by #107942 |
| void SceneTreeDock::_update_tree_menu() { | ||
| PopupMenu *tree_menu = button_tree_menu->get_popup(); | ||
| tree_menu->clear(); |
There was a problem hiding this comment.
I just realized that this menu doesn't need to be re-created every time. Only needs to update the checkboxes.
You could change it, but idk if it's within scope of this PR.
There was a problem hiding this comment.
No, no, you didn't just realise. Older you did as well. But the performance benefit didn't outweigh the extra code at the time.
There was a problem hiding this comment.
Well, now if there are no icons, there is no reason to clear it anymore.
I guess I will fix it together with auto-translation changes.
1d4a807 to
a146639
Compare
Just to be pedantic, it was never necessary to change the placeholder. They always were available 😭 |
| filter_menu->set_item_icon(filter_menu->get_item_index(FILTER_BY_TYPE), get_editor_theme_icon(SNAME("Node"))); | ||
| filter_menu->set_item_icon(filter_menu->get_item_index(FILTER_BY_GROUP), get_editor_theme_icon(SNAME("Groups"))); |
There was a problem hiding this comment.
Icons are removed. Together with the checkbox above, they create confusing empty spaces.
They don't have to since #112545 . As the original author, I do like the icons...
|
|
||
| void SceneTreeDock::_append_filter_options_to(PopupMenu *p_menu, bool p_include_separator) { | ||
| if (p_include_separator) { | ||
| p_menu->add_separator(TTR("Filters")); |
There was a problem hiding this comment.
The "Filters" text is removed from the separator. It's redundant, already in "Filter by Type" & "Filter by Group".
It's admittedly redundant, but it made for a nice distinction between other completely unrelated options. Is there any way to keep it, such as by shortening each option?
| filter_quick_menu->clear(); | ||
| if (filter_quick_menu == nullptr) { | ||
| filter_quick_menu = memnew(PopupMenu); | ||
| filter_quick_menu->set_theme_type_variation("FlatMenuButton"); |
There was a problem hiding this comment.
What's the variation for?
EDIT:
Wrong copy paste. It shouldn't have been assigned.
|
Thanks! |
The current placeholder is too long for regular usage.
It was introduced to enhance the discoverability of the filtering syntax. But nowadays, the filter options are available in the related menus. It's no longer necessary to use this placeholder I think.
The syntax is already mentioned in the LineEdit's tooltip. It is now also added to the tooltip of the related menu items:
Options in the context menu:
Options in the three-dots menu:
There is also a filters popup menu for middle mouse button click in the LineEdit. This PR makes it created on demand.