lah7 / gtk3-classic

Patches to bring back a traditional experience for GTK+3
Other
338 stars 24 forks source link

Request: Consistent file size units #108

Open luigifab opened 9 months ago

luigifab commented 9 months ago

What should be patched?

With Caja there is an option to display 1 k = 1024 octets. Run caja-file-management-properties and go to Display tab (IEC units).

I have a file of 803404 octets / 1024 k = 784,6. File size is good in caja list view, but file size "is incorrect" in open/save dialog.

The idea, read the configuration of caja-file-management-properties, then use it to display file size in open/save dialog.

Screenshots

1

Commits

I don't know.

lah7 commented 9 months ago

Apparently, it's up to each application to decide IEC vs SI units. Using this Reddit comment as a hint, the line to be patched is most likely:

$ grep -r 'g_format_size'
gtk/gtkfilechooserwidget.c:        g_value_take_string (value, g_format_size (g_file_info_get_size (info)));

Historically, GNOME preferred SI units (1 MB == 1000 kB):

Comment 8 mentions g_format_size_for_display(), maybe that's the change needed to show the other unit?

For a permanent patch to be accepted, ideally this should be configurable via an environment variable, like GTK_FILE_PICKER_IEC_UNITS=1.

luigifab commented 9 months ago

done consistent_file_size_units.gtk3.patch