UI: Recent Menu Previews #112644

Merged
Harley Acheson merged 14 commits from Harley/blender:RecentPreviews into main 2024-01-04 00:46:57 +01:00
2 changed files with 8 additions and 1 deletions
Showing only changes of commit 56a8f0d9b8 - Show all commits

View File

@ -288,6 +288,7 @@ static void ui_tooltip_region_draw_cb(const bContext * /*C*/, ARegion *region)
nullptr);
GPU_blend(GPU_BLEND_ALPHA);
/* Draw border around it. */
GPUVertFormat *format = immVertexFormat();
uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);

View File

@ -7188,13 +7188,18 @@ static void uiTemplateRecentFiles_tooltip_func(bContext * /*C*/,
void *argN)
{
char *path = (char *)argN;
eFileAttributes attributes = BLI_file_attributes(path);
/* Filename. */
//UI_tooltip_text_field_add(
// tip, BLI_strdup(path), nullptr, UI_TIP_STYLE_HEADER, UI_TIP_LC_MAIN);
//UI_tooltip_text_field_add(tip, nullptr, nullptr, UI_TIP_STYLE_SPACER, UI_TIP_LC_NORMAL);
/* File path. */
char root[FILE_MAX];
BLI_path_split_dir_part(path, root, FILE_MAX);
UI_tooltip_text_field_add(tip, BLI_strdup(root), nullptr, UI_TIP_STYLE_NORMAL, UI_TIP_LC_NORMAL);
UI_tooltip_text_field_add(tip, nullptr, nullptr, UI_TIP_STYLE_SPACER, UI_TIP_LC_NORMAL);
/* Blender version. */
char version_st[128] = {0};
ImBuf *thumb = IMB_thumb_read(path, THB_LARGE);
@ -7204,6 +7209,7 @@ static void uiTemplateRecentFiles_tooltip_func(bContext * /*C*/,
thumb->metadata, "Thumb::Blender::Version", version_st, sizeof(version_st));
}
eFileAttributes attributes = BLI_file_attributes(path);
if (!version_st[0] && !(attributes & FILE_ATTR_OFFLINE)) {
/* Load Blender version directly from the file. */
short version = BLO_version_from_file(path);