diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2019-09-29 09:20:56 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2019-09-29 09:28:02 +0300 |
commit | ba90d2efa58fe23a87f98e014bcc02ea951a6a49 (patch) | |
tree | b1c3c245493b5e7ca358108801530926031f60f4 /source/blender/editors/interface/interface_query.c | |
parent | 44d042094e21b519b38a3d78761b64bb5ceeb350 (diff) |
Fix T58683: Reload Scripts breaks toolbar button formatting.
Assuming it's actually necessary to do this check very efficiently,
replace the hack based on caching a pointer, with a different one
that caches the string comparison result in the operator object.
Diffstat (limited to 'source/blender/editors/interface/interface_query.c')
-rw-r--r-- | source/blender/editors/interface/interface_query.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/source/blender/editors/interface/interface_query.c b/source/blender/editors/interface/interface_query.c index 457d01c5dc8..e08b13f65d4 100644 --- a/source/blender/editors/interface/interface_query.c +++ b/source/blender/editors/interface/interface_query.c @@ -139,17 +139,7 @@ bool ui_but_has_array_value(const uiBut *but) bool UI_but_is_tool(const uiBut *but) { - /* very evil! */ - if (but->optype != NULL) { - static wmOperatorType *ot = NULL; - if (ot == NULL) { - ot = WM_operatortype_find("WM_OT_tool_set_by_id", false); - } - if (but->optype == ot) { - return true; - } - } - return false; + return but->optype && but->optype->is_tool_button; } bool UI_but_has_tooltip_label(const uiBut *but) |