diff options
author | Julian Eisel <julian@blender.org> | 2022-04-26 23:26:15 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2022-04-26 23:26:15 +0300 |
commit | 83c8f996f1618a51496100dc680a877a89be7a4e (patch) | |
tree | d4592e88ad598c18084489940fcc79c5a3fa4bcc /source/blender/editors/interface/interface_utils.cc | |
parent | 5fe1624b0eba8267325f166de8e75c4d2dd6989b (diff) |
UI: Add callback for comparing button identity
The code to compare buttons from the previous to the current frame, to
see if they match (an thus should keep the same state) was quite
generic, and didn't allow much flexibility/customization. For some
cases this isn't enough, and a more specific comparison is needed. Say
if some buttons don't actually store comparable data themselves, only
via the button context. This was the case in D14653.
Diffstat (limited to 'source/blender/editors/interface/interface_utils.cc')
-rw-r--r-- | source/blender/editors/interface/interface_utils.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_utils.cc b/source/blender/editors/interface/interface_utils.cc index c59863f462a..993ccdf92f7 100644 --- a/source/blender/editors/interface/interface_utils.cc +++ b/source/blender/editors/interface/interface_utils.cc @@ -452,6 +452,11 @@ eAutoPropButsReturn uiDefAutoButsRNA(uiLayout *layout, return return_info; } +void UI_but_func_identity_compare_set(uiBut *but, uiButIdentityCompareFunc cmp_fn) +{ + but->identity_cmp_func = cmp_fn; +} + /* *** RNA collection search menu *** */ struct CollItemSearch { |