Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-02-12 21:09:02 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-02-12 21:09:02 +0400
commitdcea2800a74ea2112e3cda5b3ff3035752ecb7ee (patch)
tree20da197f111c83840a61d3dafbadbe018d088d2c /source/blender/editors/space_file/filesel.c
parente1419a5bea6fb9c4ad35689919833e9ce731edaa (diff)
Fix file editor not properly scaling with DPI, this was not implemented yet.
Still todo is high resolution file icons as they look a bit pixelated now.
Diffstat (limited to 'source/blender/editors/space_file/filesel.c')
-rw-r--r--source/blender/editors/space_file/filesel.c43
1 files changed, 23 insertions, 20 deletions
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index 8c45b161d26..aed7fc45e95 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -500,12 +500,12 @@ void ED_fileselect_init_layout(struct SpaceFile *sfile, ARegion *ar)
layout->textheight = textheight;
if (params->display == FILE_IMGDISPLAY) {
- layout->prv_w = 96;
- layout->prv_h = 96;
- layout->tile_border_x = 6;
- layout->tile_border_y = 6;
- layout->prv_border_x = 6;
- layout->prv_border_y = 6;
+ layout->prv_w = 4.8f*UI_UNIT_X;
+ layout->prv_h = 4.8f*UI_UNIT_Y;
+ layout->tile_border_x = 0.3f*UI_UNIT_X;
+ layout->tile_border_y = 0.3f*UI_UNIT_X;
+ layout->prv_border_x = 0.3f*UI_UNIT_X;
+ layout->prv_border_y = 0.3f*UI_UNIT_Y;
layout->tile_w = layout->prv_w + 2 * layout->prv_border_x;
layout->tile_h = layout->prv_h + 2 * layout->prv_border_y + textheight;
layout->width = (int)(BLI_rctf_size_x(&v2d->cur) - 2 * layout->tile_border_x);
@@ -520,10 +520,13 @@ void ED_fileselect_init_layout(struct SpaceFile *sfile, ARegion *ar)
layout->flag = FILE_LAYOUT_VER;
}
else {
+ int column_space = 0.6f*UI_UNIT_X;
+ int column_icon_space = 0.2f*UI_UNIT_X;
+
layout->prv_w = 0;
layout->prv_h = 0;
- layout->tile_border_x = 8;
- layout->tile_border_y = 2;
+ layout->tile_border_x = 0.4f*UI_UNIT_X;
+ layout->tile_border_y = 0.1f*UI_UNIT_Y;
layout->prv_border_x = 0;
layout->prv_border_y = 0;
layout->tile_h = textheight * 3 / 2;
@@ -533,22 +536,22 @@ void ED_fileselect_init_layout(struct SpaceFile *sfile, ARegion *ar)
column_widths(sfile->files, layout);
if (params->display == FILE_SHORTDISPLAY) {
- maxlen = ICON_DEFAULT_WIDTH_SCALE + 4 +
- (int)layout->column_widths[COLUMN_NAME] + 12 +
- (int)layout->column_widths[COLUMN_SIZE] + 12;
+ maxlen = ICON_DEFAULT_WIDTH_SCALE + column_icon_space +
+ (int)layout->column_widths[COLUMN_NAME] + column_space +
+ (int)layout->column_widths[COLUMN_SIZE] + column_space;
}
else {
- maxlen = ICON_DEFAULT_WIDTH_SCALE + 4 +
- (int)layout->column_widths[COLUMN_NAME] + 12 +
+ maxlen = ICON_DEFAULT_WIDTH_SCALE + column_icon_space +
+ (int)layout->column_widths[COLUMN_NAME] + column_space +
#ifndef WIN32
- (int)layout->column_widths[COLUMN_MODE1] + 12 +
- (int)layout->column_widths[COLUMN_MODE2] + 12 +
- (int)layout->column_widths[COLUMN_MODE3] + 12 +
- (int)layout->column_widths[COLUMN_OWNER] + 12 +
+ (int)layout->column_widths[COLUMN_MODE1] + column_space +
+ (int)layout->column_widths[COLUMN_MODE2] + column_space +
+ (int)layout->column_widths[COLUMN_MODE3] + column_space +
+ (int)layout->column_widths[COLUMN_OWNER] + column_space +
#endif
- (int)layout->column_widths[COLUMN_DATE] + 12 +
- (int)layout->column_widths[COLUMN_TIME] + 12 +
- (int)layout->column_widths[COLUMN_SIZE] + 12;
+ (int)layout->column_widths[COLUMN_DATE] + column_space +
+ (int)layout->column_widths[COLUMN_TIME] + column_space +
+ (int)layout->column_widths[COLUMN_SIZE] + column_space;
}
layout->tile_w = maxlen;