Asset Browser/File Browser: Add display name tooltip to tile view #104693

Closed
Angus Stanton wants to merge 3 commits from ab_stanton/blender:asset-display-name into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
First-time contributor

Adds the filename as a tooltip to the tile view tiles in the filebrowser/asset browser.

New behaviour:
Asset Browser
image

File Browser
image

Adds the filename as a tooltip to the tile view tiles in the filebrowser/asset browser. New behaviour: Asset Browser ![image](/attachments/d529e24d-8b40-4dc3-aec8-dbf70af913e3) File Browser ![image](/attachments/9647f56f-da05-4a6f-9424-02c24db40d77)
Angus Stanton added 2 commits 2023-02-13 13:28:40 +01:00
Brecht Van Lommel added this to the User Interface project 2023-02-13 19:00:06 +01:00
Angus Stanton added 1 commit 2023-02-17 14:50:04 +01:00
Brecht Van Lommel requested review from Harley Acheson 2023-03-10 13:14:24 +01:00
Brecht Van Lommel requested review from Julian Eisel 2023-03-10 13:14:24 +01:00
Member

I'm not certain that I like this particular fix for this problem. In the normal case it looks redundant, and seems less informative than the tooltip hint we get while in list view.

If you try something like this instead...

diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index ab29413be22..7271cbc80b0 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -325,20 +325,21 @@ static void file_add_preview_drag_but(const SpaceFile *sfile,
                         drag_rect.ymin,
                         BLI_rcti_size_x(&drag_rect),
                         BLI_rcti_size_y(&drag_rect),
                         NULL,
                         0.0,
                         0.0,
                         0,
                         0,
                         NULL);
   file_but_enable_drag(but, sfile, file, path, preview_image, icon, scale);
+  UI_but_func_tooltip_set(but, file_draw_tooltip_func, BLI_strdup(path), MEM_freeN);
 }
 
 static void file_draw_preview(const FileDirEntry *file,
                               const rcti *tile_draw_rect,
                               const float icon_aspect,
                               ImBuf *imb,
                               const int icon,
                               FileLayout *layout,
                               const bool is_icon,
                               const bool dimmed,

Then you get the long name, but you also get the path - which is especially important if you are in Thumbnail view with recursion on. And it then matches the same tooltip you get off the icon in list view.

I'm not certain that I like this particular fix for this problem. In the normal case it looks redundant, and seems less informative than the tooltip hint we get while in list view. If you try something like this instead... ```Diff diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index ab29413be22..7271cbc80b0 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -325,20 +325,21 @@ static void file_add_preview_drag_but(const SpaceFile *sfile, drag_rect.ymin, BLI_rcti_size_x(&drag_rect), BLI_rcti_size_y(&drag_rect), NULL, 0.0, 0.0, 0, 0, NULL); file_but_enable_drag(but, sfile, file, path, preview_image, icon, scale); + UI_but_func_tooltip_set(but, file_draw_tooltip_func, BLI_strdup(path), MEM_freeN); } static void file_draw_preview(const FileDirEntry *file, const rcti *tile_draw_rect, const float icon_aspect, ImBuf *imb, const int icon, FileLayout *layout, const bool is_icon, const bool dimmed, ``` Then you get the long name, but you also get the path - which is especially important if you are in Thumbnail view with recursion on. And it then matches the same tooltip you get off the icon in list view.
Member

I think we should put a bit more effort into tooltips for assets. They could show more metadata, maybe even the full size preview. Not sure about showing the full library path for assets, it looks a bit weird/overwhelming to me: Screenshot from 2023-03-15 16-22-03.png Arguably, the name is the important part, the path is secondary. I rather show them separately.

I think something like this would be a decent start: Screenshot from 2023-03-15 16-37-21.png The tooltip callback can create a string containing \n characters for manual line breaks.

(I'm also a bit worried about showing the path in the tooltip for the essentials asset library. We really shouldn't expose this internal path that prominently - but we already do in the sidebar.)

I think we should put a bit more effort into tooltips for assets. They could show more metadata, maybe even the full size preview. Not sure about showing the full library path for assets, it looks a bit weird/overwhelming to me: ![Screenshot from 2023-03-15 16-22-03.png](/attachments/628f4368-7dda-4960-9935-f38f94c23496) Arguably, the name is the important part, the path is secondary. I rather show them separately. I think something like this would be a decent start: ![Screenshot from 2023-03-15 16-37-21.png](/attachments/433480aa-7ddd-4fee-b640-73f10b9d173b) The tooltip callback can create a string containing `\n` characters for manual line breaks. (I'm also a bit worried about showing the path in the tooltip for the essentials asset library. We really shouldn't expose this internal path that prominently - but we already do in the sidebar.)
Member

@ab_stanton - I've added a PR which does similar to this one, making tooltip hints for Asset and File Browser items. #106189

@ab_stanton - I've added a PR which does similar to this one, making tooltip hints for Asset and File Browser items. https://projects.blender.org/blender/blender/pulls/106189
Angus Stanton closed this pull request 2023-05-01 18:47:23 +02:00

Pull request closed

Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#104693
No description provided.