Column Layouts bogus column widths returned

Things you’d like to miss in the future...
Post Reply
jupe
Posts: 2757
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Column Layouts bogus column widths returned

Post by jupe »

When you invoke the dialog that displays your "Current List Columns" including widths via the new Column Layouts button, all the widths shown are different than what is returned via setcolumns or normal save column layout files, which seems bizarre, at first I thought this was because of the new /g switch, but now I think it's possible all the widths displayed are shown in graphics aware values, instead of just showing adjusted values for the necessary columns.

Below is the return values using FRESH, both are of the exact same columns, so it seems confusing having these be different, is it expected to be like this?

via new Column Layouts Button:

Code: Select all

Index.51,Path.137,+Name.273,+Ext.39,+Size.57/g,+Type.137,+Modified.105,+Created.105,Accessed.105,Attr.73,Len.43,Label.51,Tags.48,Comment.74,Custom 1.72,Custom 2.72,Custom 3.72,Custom 4.72,Custom 5.72,Custom 6.72,Custom 7.72,Custom 8.72,Custom 9.72,Custom 10.72,Extra 1.58,Extra 2.58,Extra 3.58,Extra 4.58,Extra 5.58,Extra 16.58,Extra 6.58,Extra 7.58,Extra 8.58,Extra 9.58,Extra 10.58,Extra 11.58,Extra 12.58,Extra 13.58,Extra 14.58,Extra 15.58,
via setcolumns(), columnlayout() or alternate GUI methods;

Code: Select all

Index.70,Path.188,+Name.375,+Ext.54,+Size.78,+Type.188,+Modified.144,+Created.144,Accessed.144,Attr.100,Len.59,Label.70,Tags.66,Comment.102,Custom 1.99,Custom 2.99,Custom 3.99,Custom 4.99,Custom 5.99,Custom 6.99,Custom 7.99,Custom 8.99,Custom 9.99,Custom 10.99,Extra 1.80,Extra 2.80,Extra 3.80,Extra 4.80,Extra 5.80,Extra 16.80,Extra 6.80,Extra 7.80,Extra 8.80,Extra 9.80,Extra 10.80,Extra 11.80,Extra 12.80,Extra 13.80,Extra 14.80,Extra 15.80

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Column Layouts bogus column widths returned

Post by admin »

It's complicated. :)

I decided to have all metrics related to the Column Layouts button to be DPI-aware. I.e. they are stored (and for consistency also displayed, as you noted) with the pixels they would have in 100% screen resolution. Then when applied to the list those numbers are converted to the actual screen resolution. This is to ensure that your layouts work (and "work" means that there is enough space to show the column contents) the same in different screen resolutions. To further complicate things it proved to be necessary to additionally increase the numbers by a factor of 1.1 because fonts do not scale continuously but in discrete jumps.

So, for example, when the Name is nominally stored as "300" pixels wide and you apply this in 125% screen resolution, you get 300 * 1.25 * 1.1 = 413 pixels effective column width.

The scripting commands on the other hand return the true current state DPI-unawarely. So text setcolumns(,2); would give you the 413 pixels the Name column currently has.

* * *

I see that it is confusing, but I don't see a way to make it better. :| Or should Ctrl+Click on the Column Layouts button menu items return the true pixel values? Maybe yes, because it would make the returns usable for scripting and it would match what you actually see/measure on screen, so it would certainly be less confusing.

PS: The above would only work for clicks on "Update...". So that would probably lead to further confusion. Instead I will add Ctrl+Shift+Click as a way to show the true pixel values of the current columns. After all, this is a pretty much hidden nerd functionality anyway.

Post Reply