[Bf-blender-cvs] [cd23e89634b] blender2.8: Fix (unreported) wrong 'use_sep' setting for menu items.

Bastien Montagne noreply at git.blender.org
Thu Oct 11 17:41:12 CEST 2018


Commit: cd23e89634bb79893abadea27d22839e0db47878
Author: Bastien Montagne
Date:   Thu Oct 11 17:36:37 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBcd23e89634bb79893abadea27d22839e0db47878

Fix (unreported) wrong 'use_sep' setting for menu items.

This option defines whether or not menu items drawing code must
separate drawstring in two, keeping right part at all cost.

This is used to show shortcuts of operators' enum entries usually.

Previous way to decide that was based on button having an RNA prop
pointer, assuming those without it were not 'data buttons' and hence
needed the shortcut special handling thingy.

That's wrong is many, many cases (especially since search templates
often generate more than one buttons, not all linked to actual RNA
data). So instead now checking whether a button has an optype set or
not, hopefully this will be much more accurate...

Other solution if thsi also fails, is to add new flag to buttons, and
explicitely set it when needed, instead of trying to guesstimate...

===================================================================

M	source/blender/editors/interface/interface_region_search.c

===================================================================

diff --git a/source/blender/editors/interface/interface_region_search.c b/source/blender/editors/interface/interface_region_search.c
index d262cbc38bd..471055ed24a 100644
--- a/source/blender/editors/interface/interface_region_search.c
+++ b/source/blender/editors/interface/interface_region_search.c
@@ -533,8 +533,9 @@ ARegion *ui_searchbox_create_generic(bContext *C, ARegion *butregion, uiBut *but
 		data->prv_cols = but->a2;
 	}
 
-	/* only show key shortcuts when needed (not rna buttons) [#36699] */
-	if (but->rnaprop == NULL) {
+	/* Only show key shortcuts when needed (checking RNA prop pointer is useless here, a lot of buttons are about data
+	 * without having that pointer defined, let's rather try with optype!). */
+	if (but->optype != NULL) {
 		data->use_sep = true;
 	}



More information about the Bf-blender-cvs mailing list