Bug 4592 - Date-column zigzags due to proportional fonts
Summary: Date-column zigzags due to proportional fonts
Status: CLOSED PATCHESWELCOME
Alias: None
Product: Claws Mail
Classification: Unclassified
Component: UI/Message List (show other bugs)
Version: 4.1.0
Hardware: PC Windows NT
: P3 minor
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2022-05-03 04:08 UTC by jb_dk
Modified: 2022-05-03 09:59 UTC (History)
0 users

See Also:


Attachments

Description jb_dk 2022-05-03 04:08:52 UTC
The "date" column in the message list isn't aligned for readability, because the various sub-fields of dates are shown with varying width depending on the value.  So for example, "Fri" and "Wed" field values end up having different pixel width, thus causing all fields to the right of them to zigzag as the user tries to visually scan for mails from a specific date period.

Historically, the fix would have been to use a fixed width terminal font, but that wouldn't look right in a modern graphical user interface, where proportional fonts are the norm.

The proposed fix is to add UI initialization code which, upon startup or font/locale change, loops over all the values for each name column type (such as the (un)abbreviated week days) and all the digits (0 to 9) and measure the max pixel width of each of these short lists.  Then when displaying the date values, format each text value left aligned in its max pixel width, and each digit centered in the max digit width.  So something like "Fri,,,, ,2,,9,-,0,,4,-,2,,0,,2,,2, ,1,,5,:,2,,2," where each "," represents where zero or more padding pixels will need to be inserted.

Note that all this must be done after expanding "locale-default" format codes to basic format codes, and using the format-relevant names of weekdays, months and Japanese Eras (or any other name-based fields in locales that use names instead of numbers).
Comment 1 Paul 2022-05-03 09:59:48 UTC
(In reply to jb_dk from comment #0)
> Historically, the fix would have been to use a fixed width terminal font, but 
> that wouldn't look right in a modern graphical user interface, where 
> proportional fonts are the norm.

Actually, the reverse is true - a proportional font doesn't look right. In fact, this comment is nothing but subjective.

Patches welcome.

Note You need to log in before you can comment on or make changes to this bug.