From 24d05b5ff9d6d85a7ff8f58b47bef31b5dbcec81 Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Fri, 6 Sep 2019 07:44:50 -0700 Subject: UI: File Browser Large Icon Update Replaces the large icons used in the File Browser with updated versions by Andrzej Ambroz (jendrzych). Differential Revision: https://developer.blender.org/D5698 Reviewed by Brecht Van Lommel --- source/blender/editors/space_file/file_draw.c | 20 ++++++++++---------- source/blender/editors/space_file/filelist.c | 13 +++++++------ source/tools | 2 +- 3 files changed, 18 insertions(+), 17 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 722cb885614..3e16a8473ad 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -316,18 +316,18 @@ static void file_draw_preview(uiBlock *block, if (is_icon) { const float icon_size = 16.0f / icon_aspect * U.dpi_fac; - float icon_opacity = MIN2(icon_aspect, 0.7); - uchar icon_color[4] = {255, 255, 255, 255}; - float bg[3]; - /* base this off theme color of file or folder later */ - UI_GetThemeColor3fv(TH_BACK, bg); - if (rgb_to_grayscale(bg) > 0.5f) { - icon_color[0] = 0; - icon_color[1] = 0; - icon_color[2] = 0; + float icon_opacity = 0.3f; + uchar icon_color[4] = {0, 0, 0, 255}; + float bgcolor[4]; + UI_GetThemeColor4fv(TH_TEXT, bgcolor); + if (rgb_to_grayscale(bgcolor) < 0.5f) + { + icon_color[0] = 255; + icon_color[1] = 255; + icon_color[2] = 255; } icon_x = xco + (ex / 2.0f) - (icon_size / 2.0f); - icon_y = yco + (ey / 2.0f) - (icon_size * ((typeflags & FILE_TYPE_DIR) ? 0.78f : 0.65f)); + icon_y = yco + (ey / 2.0f) - (icon_size * ((typeflags & FILE_TYPE_DIR) ? 0.78f : 0.75f)); UI_icon_draw_ex( icon_x, icon_y, icon, icon_aspect / U.dpi_fac, icon_opacity, 0.0f, icon_color, false); } diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index df783358625..1a7608ba291 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -334,15 +334,16 @@ enum { #define SPECIAL_IMG_SIZE 256 #define SPECIAL_IMG_ROWS 1 -#define SPECIAL_IMG_COLS 6 +#define SPECIAL_IMG_COLS 7 enum { SPECIAL_IMG_DOCUMENT = 0, - SPECIAL_IMG_FOLDER = 1, - SPECIAL_IMG_PARENT = 2, - SPECIAL_IMG_DRIVE_FIXED = 3, - SPECIAL_IMG_DRIVE_ATTACHED = 4, - SPECIAL_IMG_DRIVE_REMOTE = 5, + SPECIAL_IMG_UNSUPORTED = 1, + SPECIAL_IMG_FOLDER = 2, + SPECIAL_IMG_PARENT = 3, + SPECIAL_IMG_DRIVE_FIXED = 4, + SPECIAL_IMG_DRIVE_ATTACHED = 5, + SPECIAL_IMG_DRIVE_REMOTE = 6, SPECIAL_IMG_MAX, }; diff --git a/source/tools b/source/tools index 8598818108d..2550eda6bce 160000 --- a/source/tools +++ b/source/tools @@ -1 +1 @@ -Subproject commit 8598818108ddaf35e30d2a2dbd408ad371e41eb5 +Subproject commit 2550eda6bcefad45289acbb4b8e52107e742ce1f -- cgit v1.2.3