[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56672] trunk/blender/source/blender/ editors/interface/interface_widgets.c: Fix #35281: search menu buttons ( with an X on the right side to clear) had text

Brecht Van Lommel brechtvanlommel at pandora.be
Fri May 10 22:34:36 CEST 2013


Revision: 56672
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56672
Author:   blendix
Date:     2013-05-10 20:34:35 +0000 (Fri, 10 May 2013)
Log Message:
-----------
Fix #35281: search menu buttons (with an X on the right side to clear) had text
overlapping the X icon if the text was long.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/interface/interface_widgets.c

Modified: trunk/blender/source/blender/editors/interface/interface_widgets.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_widgets.c	2013-05-10 20:17:18 UTC (rev 56671)
+++ trunk/blender/source/blender/editors/interface/interface_widgets.c	2013-05-10 20:34:35 UTC (rev 56672)
@@ -968,9 +968,15 @@
 static void ui_text_clip_left(uiFontStyle *fstyle, uiBut *but, const rcti *rect)
 {
 	int border = (but->flag & UI_BUT_ALIGN_RIGHT) ? 8 : 10;
-	int okwidth = max_ii(BLI_rcti_size_x(rect) - border, 0);
-	if (but->flag & UI_HAS_ICON) okwidth -= UI_DPI_ICON_SIZE;
+	int okwidth = BLI_rcti_size_x(rect) - border;
 
+	if (but->flag & UI_HAS_ICON)
+		okwidth -= UI_DPI_ICON_SIZE;
+	if (but->type == SEARCH_MENU_UNLINK && !but->editstr)
+		okwidth -= BLI_rcti_size_y(rect);
+
+	okwidth = max_ii(okwidth, 0);
+
 	/* need to set this first */
 	uiStyleFontSet(fstyle);
 	
@@ -1347,7 +1353,7 @@
 		}
 		
 		/* unlink icon for this button type */
-		if (but->type == SEARCH_MENU_UNLINK && but->drawstr[0]) {
+		if (but->type == SEARCH_MENU_UNLINK && !but->editstr && but->drawstr[0]) {
 			rcti temp = *rect;
 
 			temp.xmin = temp.xmax - (BLI_rcti_size_y(rect) * 1.08f);




More information about the Bf-blender-cvs mailing list