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
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user