[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37210] trunk/blender/source/blender/ editors: file selector now scales with DPI better

Campbell Barton ideasman42 at gmail.com
Sun Jun 5 16:00:06 CEST 2011


Revision: 37210
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37210
Author:   campbellbarton
Date:     2011-06-05 14:00:06 +0000 (Sun, 05 Jun 2011)
Log Message:
-----------
file selector now scales with DPI better

Modified Paths:
--------------
    trunk/blender/source/blender/editors/include/UI_interface_icons.h
    trunk/blender/source/blender/editors/space_file/file_draw.c
    trunk/blender/source/blender/editors/space_file/filesel.c

Modified: trunk/blender/source/blender/editors/include/UI_interface_icons.h
===================================================================
--- trunk/blender/source/blender/editors/include/UI_interface_icons.h	2011-06-05 13:59:04 UTC (rev 37209)
+++ trunk/blender/source/blender/editors/include/UI_interface_icons.h	2011-06-05 14:00:06 UTC (rev 37210)
@@ -49,6 +49,10 @@
 
 #define ICON_DEFAULT_HEIGHT 16
 #define ICON_DEFAULT_WIDTH	16
+
+#define ICON_DEFAULT_HEIGHT_SCALE	(UI_UNIT_Y * 0.8f)
+#define ICON_DEFAULT_WIDTH_SCALE	(UI_UNIT_X * 0.8f)
+
 #define PREVIEW_DEFAULT_HEIGHT 96
 
 /*

Modified: trunk/blender/source/blender/editors/space_file/file_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_file/file_draw.c	2011-06-05 13:59:04 UTC (rev 37209)
+++ trunk/blender/source/blender/editors/space_file/file_draw.c	2011-06-05 14:00:06 UTC (rev 37210)
@@ -517,8 +517,8 @@
 			
 			file_draw_preview(block, file, sx, sy, imb, layout, !is_icon && (file->flags & IMAGEFILE));
 		} else {
-			file_draw_icon(block, file->path, sx, sy-3, get_file_icon(file), ICON_DEFAULT_WIDTH, ICON_DEFAULT_WIDTH);
-			sx += ICON_DEFAULT_WIDTH + 4;
+			file_draw_icon(block, file->path, sx, sy-(UI_UNIT_Y / 6), get_file_icon(file), ICON_DEFAULT_WIDTH_SCALE, ICON_DEFAULT_WIDTH_SCALE);
+			sx += ICON_DEFAULT_WIDTH_SCALE + 4;
 		}
 
 		UI_ThemeColor4(TH_TEXT);

Modified: trunk/blender/source/blender/editors/space_file/filesel.c
===================================================================
--- trunk/blender/source/blender/editors/space_file/filesel.c	2011-06-05 13:59:04 UTC (rev 37209)
+++ trunk/blender/source/blender/editors/space_file/filesel.c	2011-06-05 14:00:06 UTC (rev 37210)
@@ -403,10 +403,12 @@
 	uiStyleFontSet(&style->widget);
 	s = BLF_height(style->widget.uifont_id, tmp);
 	return style->widget.points;
-#else
+#elif 0
 	uiStyle *style= U.uistyles.first;
 	uiStyleFontSet(&style->widget);
 	return style->widget.points;
+#else
+	return UI_UNIT_Y * 0.6666f;
 #endif
 }
 
@@ -497,11 +499,11 @@
 		column_widths(sfile->files, layout);
 
 		if (params->display == FILE_SHORTDISPLAY) {
-			maxlen = ICON_DEFAULT_WIDTH + 4 +
+			maxlen = ICON_DEFAULT_WIDTH_SCALE + 4 +
 					 (int)layout->column_widths[COLUMN_NAME] + 12 +
 					 (int)layout->column_widths[COLUMN_SIZE] + 12;
 		} else {
-			maxlen = ICON_DEFAULT_WIDTH + 4 +
+			maxlen = ICON_DEFAULT_WIDTH_SCALE + 4 +
 					 (int)layout->column_widths[COLUMN_NAME] + 12 +
 #ifndef WIN32
 					 (int)layout->column_widths[COLUMN_MODE1] + 12 +




More information about the Bf-blender-cvs mailing list