Some settings and themes makes date in file browser to be ended by ellipsis. #99207

Closed
opened 2022-06-27 15:15:57 +02:00 by Michael Soluyanov · 9 comments

System Information
Operating system: Windows-10-10.0.19044-SP0 64 Bits
Graphics card: GeForce RTX 2060/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 456.38

Blender Version
Broken: version: 3.2.0, branch: master, commit date: 2022-06-08 10:22, hash: e05e1e3691
Worked: (newest version of Blender that worked as expected)

Short description of error
Some settings and themes makes date in file browser to be ended by ellipsis.

Exact steps for others to reproduce the error
Set theme to "modo", open file browser:

image.png

**System Information** Operating system: Windows-10-10.0.19044-SP0 64 Bits Graphics card: GeForce RTX 2060/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 456.38 **Blender Version** Broken: version: 3.2.0, branch: master, commit date: 2022-06-08 10:22, hash: `e05e1e3691` Worked: (newest version of Blender that worked as expected) **Short description of error** Some settings and themes makes date in file browser to be ended by ellipsis. **Exact steps for others to reproduce the error** Set theme to "modo", open file browser: ![image.png](https://archive.blender.org/developer/F13232556/image.png)
Author
Member

Added subscriber: @crantisz

Added subscriber: @crantisz

Added subscriber: @SUNGHOON-JEONG

Added subscriber: @SUNGHOON-JEONG

There may be other factors that determine the size of the text. But I noticed that the Modo theme changes the Widget Points value in the Text Style panel. Other themes default to 11, but the Modo theme is 10. If you change this value to 11, the contents of the Date Modified column are not omitted.
If Widget Points are the main cause of this problem, it may be a good idea to set the default value for Widget Points in the Modo theme to 11 as in other themes so that it becomes the default behavior of Blender.
image.png
image.png

There may be other factors that determine the size of the text. But I noticed that the Modo theme changes the Widget Points value in the Text Style panel. Other themes default to 11, but the Modo theme is 10. If you change this value to 11, the contents of the Date Modified column are not omitted. If Widget Points are the main cause of this problem, it may be a good idea to set the default value for Widget Points in the Modo theme to 11 as in other themes so that it becomes the default behavior of Blender. ![image.png](https://archive.blender.org/developer/F13232566/image.png) ![image.png](https://archive.blender.org/developer/F13232569/image.png)
Member

Added subscriber: @JulianEisel

Added subscriber: @JulianEisel
Member

Can be fixed with this:

diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index e42e1e98660..4fdde7a63fe 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -890,8 +890,8 @@ FileAttributeColumnType file_attribute_column_type_find_isect(const View2D *v2d,
 float file_string_width(const char *str)
 {
   const uiStyle *style = UI_style_get();
-  UI_fontstyle_set(&style->widget);
-  return BLF_width(style->widget.uifont_id, str, BLF_DRAW_STR_DUMMY_MAX);
+  UI_fontstyle_set(&style->widgetlabel);
+  return BLF_width(style->widgetlabel.uifont_id, str, BLF_DRAW_STR_DUMMY_MAX);
 }
 
 float file_font_pointsize(void)
@@ -905,8 +905,8 @@ float file_font_pointsize(void)
   return style->widget.points;
 #else
   const uiStyle *style = UI_style_get();
-  UI_fontstyle_set(&style->widget);
-  return style->widget.points * UI_DPI_FAC;
+  UI_fontstyle_set(&style->widgetlabel);
+  return style->widgetlabel.points * UI_DPI_FAC;
 #endif
 }
 

However I'm wondering if it makes sense even for the File Browser text to use the Widget Label font style. I'd suggest using the Widget font style instead:

diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 0e2b98ca349..f3359336b14 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -202,7 +202,7 @@ static void file_draw_string(int sx,
   }
 
   const uiStyle *style = UI_style_get();
-  fs = style->widgetlabel;
+  fs = style->widget;
 
   BLI_strncpy(fname, string, FILE_MAXFILE);
   UI_text_clip_middle_ex(&fs, fname, width, UI_DPI_ICON_SIZE, sizeof(fname), '\0');
@@ -245,7 +245,7 @@ static void file_draw_string_multiline(int sx,
   }
 
   const uiStyle *style = UI_style_get();
-  int font_id = style->widgetlabel.uifont_id;
+  int font_id = style->widget.uifont_id;
   int len = strlen(string);
 
   rcti textbox;

@pablovazquez any opinion on what font style to use for the text in the File Browser? Widget Label or Widget?

Can be fixed with this: ```lines=10 diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index e42e1e98660..4fdde7a63fe 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -890,8 +890,8 @@ FileAttributeColumnType file_attribute_column_type_find_isect(const View2D *v2d, float file_string_width(const char *str) { const uiStyle *style = UI_style_get(); - UI_fontstyle_set(&style->widget); - return BLF_width(style->widget.uifont_id, str, BLF_DRAW_STR_DUMMY_MAX); + UI_fontstyle_set(&style->widgetlabel); + return BLF_width(style->widgetlabel.uifont_id, str, BLF_DRAW_STR_DUMMY_MAX); } float file_font_pointsize(void) @@ -905,8 +905,8 @@ float file_font_pointsize(void) return style->widget.points; #else const uiStyle *style = UI_style_get(); - UI_fontstyle_set(&style->widget); - return style->widget.points * UI_DPI_FAC; + UI_fontstyle_set(&style->widgetlabel); + return style->widgetlabel.points * UI_DPI_FAC; #endif } ``` However I'm wondering if it makes sense even for the File Browser text to use the *Widget Label* font style. I'd suggest using the *Widget* font style instead: ```lines=10 diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 0e2b98ca349..f3359336b14 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -202,7 +202,7 @@ static void file_draw_string(int sx, } const uiStyle *style = UI_style_get(); - fs = style->widgetlabel; + fs = style->widget; BLI_strncpy(fname, string, FILE_MAXFILE); UI_text_clip_middle_ex(&fs, fname, width, UI_DPI_ICON_SIZE, sizeof(fname), '\0'); @@ -245,7 +245,7 @@ static void file_draw_string_multiline(int sx, } const uiStyle *style = UI_style_get(); - int font_id = style->widgetlabel.uifont_id; + int font_id = style->widget.uifont_id; int len = strlen(string); rcti textbox; ``` @pablovazquez any opinion on what font style to use for the text in the File Browser? *Widget Label* or *Widget*?
Member

Added subscriber: @pablovazquez

Added subscriber: @pablovazquez

This issue was referenced by 6f7171525b

This issue was referenced by 6f7171525b4abd0a4c0e22dc64f4d53d3a313643
Member

Changed status from 'Needs Triage' to: 'Resolved'

Changed status from 'Needs Triage' to: 'Resolved'
Julian Eisel self-assigned this 2022-06-27 16:21:29 +02:00
Member

Checked with Pablo in person, we agreed on using the "Widget" font style for the File Browser text.

Checked with Pablo in person, we agreed on using the "Widget" font style for the File Browser text.
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
Interest: X11
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
4 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#99207
No description provided.