[Bf-blender-cvs] [5e72724] ui-preview-buttons: Check if string is empty before setting UI flag

Campbell Barton noreply at git.blender.org
Mon May 11 05:22:19 CEST 2015


Commit: 5e72724b91b6c8a586fb52c85e03fd27d500ca24
Author: Campbell Barton
Date:   Mon May 11 13:18:09 2015 +1000
Branches: ui-preview-buttons
https://developer.blender.org/rB5e72724b91b6c8a586fb52c85e03fd27d500ca24

Check if string is empty before setting UI flag

match logic in master

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

M	source/blender/editors/include/UI_interface_icons.h
M	source/blender/editors/interface/interface.c

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

diff --git a/source/blender/editors/include/UI_interface_icons.h b/source/blender/editors/include/UI_interface_icons.h
index adaa364..97c1952 100644
--- a/source/blender/editors/include/UI_interface_icons.h
+++ b/source/blender/editors/include/UI_interface_icons.h
@@ -36,7 +36,6 @@ struct bContext;
 struct ID;
 struct PreviewImage;
 struct PointerRNA;
-struct Scene;
 
 typedef struct IconFile {
 	struct IconFile *next, *prev;
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 8aabc74..a9cc926 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -3244,7 +3244,7 @@ void ui_def_but_icon(uiBut *but, const int icon, const int flag) {
 	but->icon = (BIFIconID)icon;
 	but->flag |= flag;
 
-	if (but->str) {
+	if (but->str && but->str[0]) {
 		but->drawflag |= UI_BUT_ICON_LEFT;
 	}
 }




More information about the Bf-blender-cvs mailing list