Page MenuHome

Property Search: Search with button groups
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on Wed, Sep 2, 4:39 PM.

Details

Summary

This is needed for property search where we want to highlight a button's label if it matches the search
filter. Otherwise the button itself is highlighted but it has no idea what label to highlight.

This is especially important because of the use of property split layouts where the label is almost
always outside of the button in a separate column.

The button groups here are basically just a flattened view of the layout data. Every function that adds
a new set of buttons creates a new button group, and the new buttons are added automatically to
that group. Then, each group is searched separately in the property search phase. It's important that
every function adding a new set of buttons has a call to layout_root_new_button_group.

Not that this isn't currently disabled when property search isn't active. It may be useful for other things
in the future, and trying to pass that information to the layout functions didn't feel worth it to me.

Diff Detail

Repository
rB Blender

Event Timeline

Hans Goudey (HooglyBoogly) requested review of this revision.Wed, Sep 2, 4:39 PM
Hans Goudey (HooglyBoogly) created this revision.
Hans Goudey (HooglyBoogly) retitled this revision from UI: Keep track of button's relationship with label buttons to Property Search: Keep track of button's relationship with label buttons.Wed, Sep 9, 6:58 PM
Julian Eisel (Severin) edited the summary of this revision. (Show Details)Thu, Sep 10, 2:18 PM
Julian Eisel (Severin) added inline comments.
source/blender/editors/interface/interface_layout.c
1038

Isn't this the only place where you pass in the r_layout? In that case this should be a separate function, e.g. an internal uiItemL_respect_property_split().

Hans Goudey (HooglyBoogly) planned changes to this revision.Sat, Sep 12, 6:58 PM

After talking with Julian I'm working on a method that should be much simpler than this.

  • Property Search: Use button groups instead of button pointers
  • Property Search: Use LinkData instead of button for group
  • Property Search: Replace pointer in group when button type switches
Hans Goudey (HooglyBoogly) retitled this revision from Property Search: Keep track of button's relationship with label buttons to Property Search: Search with button groups.Mon, Sep 14, 5:04 PM
Hans Goudey (HooglyBoogly) edited the summary of this revision. (Show Details)
source/blender/editors/interface/interface_layout.c
466

This function's existence is really unfortunate, just like ui_but_change_type, but it's necessary for now.

Great, I much prefer this over what we had before :)

source/blender/editors/interface/interface_layout.c
454–455

Can just use BLI_genericNodeN().

466

Yeah, but I'd blame legacy code more than us ;)

This revision is now accepted and ready to land.Tue, Sep 15, 11:30 AM
Hans Goudey (HooglyBoogly) marked 3 inline comments as done.
  • Property Search: Use BLI_genericNodeN()
  • Cleanup: Fix clang tidy consistent parameter names warning