[Bf-blender-cvs] [dce8259] master: Fix T37830: UILists text now right align.

Bastien Montagne noreply at git.blender.org
Thu Dec 19 09:38:22 CET 2013


Commit: dce82591a7504cac25bc53d4f92ca234bf85c3aa
Author: Bastien Montagne
Date:   Thu Dec 19 09:34:53 2013 +0100
http://developer.blender.org/rBdce82591a7504cac25bc53d4f92ca234bf85c3aa

Fix T37830: UILists text now right align.

Simply check for non-embossed TEX buttons inside uiList items, and align their text like labels do.

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

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

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

diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 8c49d8c..5c2ce7a 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -1307,6 +1307,10 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB
 	else if (ELEM(but->type, NUM, NUMSLI)) {
 		ui_text_clip_right_label(fstyle, but, rect);
 	}
+	/* Special hack for non-embossed TEX buttons in uiList (we want them to behave as much as possible as labels). */
+	else if ((but->type == TEX) && (but->flag & UI_BUT_LIST_ITEM) && (but->dt & UI_EMBOSSN)) {
+		but->ofs = 0;
+	}
 	else if (ELEM3(but->type, TEX, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
 		ui_text_clip_left(fstyle, but, rect);
 	}




More information about the Bf-blender-cvs mailing list