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
This commit is contained in:
Harley Acheson
2024-07-30 21:30:22 +02:00
committed by Harley Acheson
parent 4b9f286af0
commit b64cf71c1d

View File

@@ -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);
}