Do not show %t to user on right click menu buttons which use "Name%t|...%x0|..."...
authorSv. Lockal <lockalsash@gmail.com>
Tue, 4 Sep 2012 17:09:40 +0000 (17:09 +0000)
committerSv. Lockal <lockalsash@gmail.com>
Tue, 4 Sep 2012 17:09:40 +0000 (17:09 +0000)
source/blender/editors/interface/interface.c

index ffce2b618a31dec929f9fc88977ceb3307e66c08..f97b9864539f2dc0d884157ac634d44c88effdec 100644 (file)
@@ -3722,8 +3722,14 @@ void uiButGetStrInfo(bContext *C, uiBut *but, int nbr, ...)
 
                if (type == BUT_GET_LABEL) {
                        if (but->str) {
-                               /* Menu labels can have some complex formating stuff marked by pipes, we don't want those here! */
-                               char *tc = strchr(but->str, '|');
+                               /* Menu labels can have some complex formating stuff marked by pipes or %t, we don't want those here! */
+                               const char *tc;
+                               
+                               if (but->type == MENU)
+                                       tc = strstr(but->str, "%t");
+                               else
+                                       tc = strchr(but->str, '|');
+                               
                                if (tc)
                                        tmp = BLI_strdupn(but->str, tc - but->str);
                                else