From b64cf71c1d23bb971b992acdea408b18b64ff884 Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Tue, 30 Jul 2024 21:30:22 +0200 Subject: [PATCH] Fix #125554: Change to File Browser Thumbnail Type Icon Location This PR changes the locations of the status icons shown on file item thumbnails in the File Browser. Rather than show the file type at the bottom-left of the thumbnail extent, show it at the item bounds. This way they always are aligned with each other. This also changes the current file indicator (top-right) similarly and adds an outline. Pull Request: https://projects.blender.org/blender/blender/pulls/125625 --- source/blender/editors/space_file/file_draw.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/blender/editors/space_file/file_draw.cc b/source/blender/editors/space_file/file_draw.cc index 76e2c53954a..d53e3a158ed 100644 --- a/source/blender/editors/space_file/file_draw.cc +++ b/source/blender/editors/space_file/file_draw.cc @@ -746,8 +746,8 @@ static void file_draw_preview(const FileList *files, { /* Smaller, fainter icon at bottom-left for preview image thumbnail, but not for fonts. */ const uchar light[4] = {255, 255, 255, 255}; - const float icon_x = float(xco) + (2.0f * UI_SCALE_FAC); - const float icon_y = float(yco) + (2.0f * UI_SCALE_FAC); + const float icon_x = float(tile_draw_rect->xmin) + (3.0f * UI_SCALE_FAC); + const float icon_y = float(tile_draw_rect->ymin) + (17.0f * UI_SCALE_FAC); UI_icon_draw_ex(icon_x, icon_y, icon, @@ -765,8 +765,8 @@ static void file_draw_preview(const FileList *files, * current file (from current #Main in fact). */ float icon_x, icon_y; const uchar light[4] = {255, 255, 255, 255}; - icon_x = xco + ex - UI_UNIT_X; - icon_y = yco + ey - UI_UNIT_Y; + icon_x = float(tile_draw_rect->xmax) - (16.0f * UI_SCALE_FAC); + icon_y = float(tile_draw_rect->ymax) - (20.0f * UI_SCALE_FAC); UI_icon_draw_ex(icon_x, icon_y, ICON_CURRENT_FILE, @@ -774,7 +774,7 @@ static void file_draw_preview(const FileList *files, 0.6f, 0.0f, light, - false, + true, UI_NO_ICON_OVERLAY_TEXT); }