Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2018-10-11 18:36:37 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-10-11 18:36:37 +0300
commitcd23e89634bb79893abadea27d22839e0db47878 (patch)
tree35dcbed1205de81c20d2437779eb1f94ed4268c8
parent4add09053cbf2e3d86ab0f23d46bba7eb2d47829 (diff)
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...
-rw-r--r--source/blender/editors/interface/interface_region_search.c5
1 files changed, 3 insertions, 2 deletions
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;
}