-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Avoid duplicating the "Filters" section #79650
Conversation
I found a related bug while testing this change, but actually it has existed for some time. I opened a new PR that includes both fixes but if that's not right, let me know. I would be happy to raise a separate bug and create a PR including just the icon fix. |
I think the original code makes little sense. Why is this method called on every popup if the menu is supposed to always be the same? It should only be initialized once, right after |
I agree. This seems to be a better solution. |
The icons should be assigned in NOTIFICATION_THEME_CHANGED. |
40f77a1
to
d33f56b
Compare
editor/scene_tree_dock.cpp
Outdated
@@ -1386,6 +1386,11 @@ void SceneTreeDock::_notification(int p_what) { | |||
|
|||
filter->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons"))); | |||
|
|||
PopupMenu *p_menu = filter->get_menu(); |
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.
PopupMenu *p_menu = filter->get_menu(); | |
PopupMenu *filter_menu = filter->get_menu(); |
p_
prefix should be used only for parameters.
You should remove |
d33f56b
to
e0cbbe4
Compare
@@ -1386,6 +1386,11 @@ void SceneTreeDock::_notification(int p_what) { | |||
|
|||
filter->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons"))); | |||
|
|||
PopupMenu *filter_menu = filter->get_menu(); | |||
filter_menu->set_item_icon(filter_menu->get_item_idx_from_text(TTR("Filters")), get_theme_icon(SNAME("Search"), SNAME("EditorIcons"))); |
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 wonder if there is a better way to get this item than using the text.
Looks like we forgot to say "thanks", so here's Thanks! |
Fixes #79630
Bugsquad edit: Fixes #79663 Supersedes #79664