diff options
author | Julian Eisel <julian@blender.org> | 2022-03-17 19:45:29 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2022-03-17 19:52:50 +0300 |
commit | 7fed4c06c2ff45d9ab4f809d542b6e1ee8f76488 (patch) | |
tree | 131ea0f54eb57b52cc17b075f1d8b9966801152c /source | |
parent | 17906794f555fb8452d677d7db576e78b7a115a6 (diff) |
Fix keying-set selector broken
The menu for Timeline > Keying > Active Keying Set wouldn't show up.
Caused by d8e3bcf770c2. The function to attach search menu data to the button
would be called twice with different arguments for the same button now.
Shouldn't be an issue in general, but the first call now had the unexpected
side effect that the button would get disabled. Make sure it's re-enabled when
the second call sets the proper search data now.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_intern.h | 3 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 694ae78ca9e..a7a2409ef17 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -1275,7 +1275,8 @@ void ui_layout_remove_but(uiLayout *layout, const uiBut *but); */ bool ui_layout_replace_but_ptr(uiLayout *layout, const void *old_but_ptr, uiBut *new_but); /** - * \note May reallocate \a but, so the possibly new address is returned. + * \note May reallocate \a but, so the possibly new address is returned. May also override the + * #UI_BUT_DISABLED flag depending on if a search pointer-property pair was provided/found. */ uiBut *ui_but_add_search(uiBut *but, PointerRNA *ptr, diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 17f0ae1f2d4..cbc21bd481f 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -2751,6 +2751,10 @@ uiBut *ui_but_add_search( ui_rna_collection_search_arg_free_fn, NULL, NULL); + /* If this is called multiple times for the same button, an earlier call may have taken the + * else branch below so the button was disabled. Now we have a searchprop, so it can be enabled + * again. */ + but->flag &= ~UI_BUT_DISABLED; } else if (but->type == UI_BTYPE_SEARCH_MENU) { /* In case we fail to find proper searchprop, |