[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53144] trunk/blender/source/blender/ editors: DPI: fix wrong scaling of editor type choosing buttons, and for menu arrows

Brecht Van Lommel brechtvanlommel at pandora.be
Tue Dec 18 21:00:53 CET 2012


Revision: 53144
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53144
Author:   blendix
Date:     2012-12-18 20:00:52 +0000 (Tue, 18 Dec 2012)
Log Message:
-----------
DPI: fix wrong scaling of editor type choosing buttons, and for menu arrows
overlapping or being too close to icons in small buttons.

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

Modified: trunk/blender/source/blender/editors/interface/interface_widgets.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_widgets.c	2012-12-18 19:35:54 UTC (rev 53143)
+++ trunk/blender/source/blender/editors/interface/interface_widgets.c	2012-12-18 20:00:52 UTC (rev 53144)
@@ -566,19 +566,14 @@
 
 static void widget_menu_trias(uiWidgetTrias *tria, const rcti *rect)
 {
-	float centx, centy, size, asp;
+	float centx, centy, size;
 	int a;
 		
 	/* center position and size */
-	centx = rect->xmax - 0.5f * BLI_rcti_size_y(rect);
-	centy = rect->ymin + 0.5f * BLI_rcti_size_y(rect);
+	centx = rect->xmax - 0.32f * BLI_rcti_size_y(rect);
+	centy = rect->ymin + 0.50f * BLI_rcti_size_y(rect);
 	size = 0.4f * (float)BLI_rcti_size_y(rect);
 	
-	/* XXX exception */
-	asp = ((float)BLI_rcti_size_x(rect)) / ((float)BLI_rcti_size_y(rect));
-	if (asp > 1.2f && asp < 2.6f)
-		centx = rect->xmax - 0.4f * (float)BLI_rcti_size_y(rect);
-	
 	for (a = 0; a < 6; a++) {
 		tria->vec[a][0] = size * menu_tria_vert[a][0] + centx;
 		tria->vec[a][1] = size * menu_tria_vert[a][1] + centy;

Modified: trunk/blender/source/blender/editors/screen/area.c
===================================================================
--- trunk/blender/source/blender/editors/screen/area.c	2012-12-18 19:35:54 UTC (rev 53143)
+++ trunk/blender/source/blender/editors/screen/area.c	2012-12-18 20:00:52 UTC (rev 53144)
@@ -1545,22 +1545,22 @@
 {
 	ScrArea *sa = CTX_wm_area(C);
 	uiBut *but;
-	int xco = 8;
+	int xco = 0.4 * U.widget_unit;
 	
 	but = uiDefIconTextButC(block, ICONTEXTROW, 0, ICON_VIEW3D, 
-	                        editortype_pup(), xco, yco, UI_UNIT_X + 10, UI_UNIT_Y,
+	                        editortype_pup(), xco, yco, 1.5 * U.widget_unit, U.widget_unit,
 	                        &(sa->butspacetype), 1.0, SPACEICONMAX, 0, 0,
 	                        TIP_("Display current editor type (click for a menu of available types)"));
 	uiButSetFunc(but, spacefunc, NULL, NULL);
 	uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */
 	
-	return xco + UI_UNIT_X + 14;
+	return xco + 1.7 * U.widget_unit;
 }
 
 int ED_area_header_standardbuttons(const bContext *C, uiBlock *block, int yco)
 {
 	ScrArea *sa = CTX_wm_area(C);
-	int xco = 8;
+	int xco = 0.4 * U.widget_unit;
 	uiBut *but;
 	
 	if (!sa->full)
@@ -1571,14 +1571,14 @@
 	if (sa->flag & HEADER_NO_PULLDOWN) {
 		but = uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, 0,
 		                       ICON_DISCLOSURE_TRI_RIGHT,
-		                       xco, yco, UI_UNIT_X, UI_UNIT_Y - 2,
+		                       xco, yco, U.widget_unit, U.widget_unit*0.9,
 		                       &(sa->flag), 0, 0, 0, 0,
 		                       "Show pulldown menus");
 	}
 	else {
 		but = uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, 0,
 		                       ICON_DISCLOSURE_TRI_DOWN,
-		                       xco, yco, UI_UNIT_X, UI_UNIT_Y - 2,
+		                       xco, yco, U.widget_unit, U.widget_unit*0.9,
 		                       &(sa->flag), 0, 0, 0, 0,
 		                       "Hide pulldown menus");
 	}
@@ -1587,7 +1587,7 @@
 
 	uiBlockSetEmboss(block, UI_EMBOSS);
 	
-	return xco + UI_UNIT_X;
+	return xco + U.widget_unit;
 }
 
 /************************ standard UI regions ************************/
@@ -1638,7 +1638,7 @@
 			if (pt->draw_header && !(pt->flag & PNL_NO_HEADER) && (open || vertical)) {
 				/* for enabled buttons */
 				panel->layout = uiBlockLayout(block, UI_LAYOUT_HORIZONTAL, UI_LAYOUT_HEADER,
-				                              triangle, UI_UNIT_Y + style->panelspace + 2, UI_UNIT_Y, 1, style);
+				                              triangle, (UI_UNIT_Y * 1.1f) + style->panelspace, UI_UNIT_Y, 1, style);
 
 				pt->draw_header(C, panel);
 




More information about the Bf-blender-cvs mailing list