Discussion:
[Thunar-dev] how to tell thunar never to increase space between icons?
Bruno Dantas
2017-03-14 11:19:54 UTC
Permalink
This is a cosmetic issue but it's driving me bonkers.

I only use Thunar with the option to "View as Icons". I'd like the spacing between icons in Thunar to be constant, but Thunar insists on increasing the spacing between icons when long filenames are detected (e.g., when I press Control+H in my home folder and hidden files with long names show up).

A user perplexed by this same issue documented it here, with screenshots: https://bbs.archlinux.org/viewtopic.php?id=199121

If I put something like this in my ~/.gtkrc-2.0 to increase the baseline/initial distance between icons...

style "thunar-spaced-out-icons"
{
ThunarIconView::column-spacing = 70
ThunarIconView::row-spacing = 70
}
class "ThunarIconView" style "thunar-spaced-out-icons"

...Thunar increases the distance between icons even more when long file names are detected.

Is there a setting that tells Thunar to NOT change the distance between icons? If there is no such setting, I'd like to recompile Thunar without this "feature". I grepped the source code for "column-spacing" and didn't find an obvious culprit, so the offending function must change a variable of some other name. Please help.
Markus
2017-03-14 12:09:29 UTC
Permalink
I wrote patches for this a while back. I'll attach them to this mail,
maybe they'll prove useful for you. I can't exactly remember which
version I wrote them against but I think it should be the 4.12's Thunar
already. Here's a short overview (I'm citing my notes from when I wrote
those patches):

thunar_fixed_width_final.patch

This patch addresses the issue of varying horizontal spacing in icon
view by using a fixed width (= maximum width) for the columns of the
grid layout.
The patch introduces the following xfconf variable:

misc-fixed-item-width: toggles the fixed item width on (TRUE) or
off (FALSE); default: TRUE

The patch only affects icon view and the new behavior only applies
to views with text below items.


thunar_truncate_final.patch

The appended patch addresses the issue of huge filename labels by
adding filename truncation using ellipsis insertion and introduces 3
new xfconf values:

icon-view-text-lines: maximum amount of lines for filenames in
icon view (default: 4)

compact-view-text-width: maximum pixel width for filenames in
compact view (default: 300)

misc-truncate-filenames: boolean toggling the new
truncate/ellipsize behavior for filenames (default: TRUE)

I chose to not put the ellipsis at the end of the filenames as many
other file managers do it, but in the center. This will keep the
file extension readable in most cases which I find quite handy.
However if you deem this unsuitable, feel free to replace the
occurences of "PANGO_ELLIPSIZE_MIDDLE" with "PANGO_ELLIPSIZE_END"
which will result in the ellipsis being at the end.

_______________________________

The first patch is essentially what you are looking for. I added a
second as a bonus since it complements the first one beautifully by
limiting the size of item labels. This guarantees fixed horizontal
spacing as well as limited vertical spacing when using text below icons.
The truncation should still apply to text besides icons as well. Use the
xfconf editor to set the introduced settings values.
Be aware that I wrote those patches a long time ago. I currently can't
check whether they are still working but they should point you into the
right direction at least!

Cheers!

Markus.
Post by Bruno Dantas
This is a cosmetic issue but it's driving me bonkers.
I only use Thunar with the option to "View as Icons". I'd like the spacing between icons in Thunar to be constant, but Thunar insists on increasing the spacing between icons when long filenames are detected (e.g., when I press Control+H in my home folder and hidden files with long names show up).
A user perplexed by this same issue documented it here, with screenshots: https://bbs.archlinux.org/viewtopic.php?id=199121
If I put something like this in my ~/.gtkrc-2.0 to increase the baseline/initial distance between icons...
style "thunar-spaced-out-icons"
{
ThunarIconView::column-spacing = 70
ThunarIconView::row-spacing = 70
}
class "ThunarIconView" style "thunar-spaced-out-icons"
...Thunar increases the distance between icons even more when long file names are detected.
Is there a setting that tells Thunar to NOT change the distance between icons? If there is no such setting, I'd like to recompile Thunar without this "feature". I grepped the source code for "column-spacing" and didn't find an obvious culprit, so the offending function must change a variable of some other name. Please help.
_______________________________________________
Thunar-dev mailing list
https://mail.xfce.org/mailman/listinfo/thunar-dev
Bruno Dantas
2017-03-14 12:40:19 UTC
Permalink
Markus, you are a wizard! Thank you so much. I will try your patches
ASAP and will report back.
Post by Markus
I wrote patches for this a while back. I'll attach them to this mail,
maybe they'll prove useful for you. I can't exactly remember which
version I wrote them against but I think it should be the 4.12's Thunar
thunar_fixed_width_final.patch
This patch addresses the issue of varying horizontal spacing in icon
view by using a fixed width (= maximum width) for the columns of the
grid layout.
misc-fixed-item-width: toggles the fixed item width on (TRUE) or
off (FALSE); default: TRUE
The patch only affects icon view and the new behavior only applies
to views with text below items.
thunar_truncate_final.patch
The appended patch addresses the issue of huge filename labels by
adding filename truncation using ellipsis insertion and introduces 3
icon-view-text-lines: maximum amount of lines for filenames in
icon view (default: 4)
compact-view-text-width: maximum pixel width for filenames in
compact view (default: 300)
misc-truncate-filenames: boolean toggling the new
truncate/ellipsize behavior for filenames (default: TRUE)
I chose to not put the ellipsis at the end of the filenames as many
other file managers do it, but in the center. This will keep the
file extension readable in most cases which I find quite handy.
However if you deem this unsuitable, feel free to replace the
occurences of "PANGO_ELLIPSIZE_MIDDLE" with "PANGO_ELLIPSIZE_END"
which will result in the ellipsis being at the end.
_______________________________
The first patch is essentially what you are looking for. I added a
second as a bonus since it complements the first one beautifully by
limiting the size of item labels. This guarantees fixed horizontal
spacing as well as limited vertical spacing when using text below icons.
The truncation should still apply to text besides icons as well. Use the
xfconf editor to set the introduced settings values.
Be aware that I wrote those patches a long time ago. I currently can't
check whether they are still working but they should point you into the
right direction at least!
Cheers!
Markus.
Post by Bruno Dantas
This is a cosmetic issue but it's driving me bonkers.
I only use Thunar with the option to "View as Icons". I'd like the spacing between icons in Thunar to be constant, but Thunar insists on increasing the spacing between icons when long filenames are detected (e.g., when I press Control+H in my home folder and hidden files with long names show up).
A user perplexed by this same issue documented it here, with screenshots: https://bbs.archlinux.org/viewtopic.php?id=199121
If I put something like this in my ~/.gtkrc-2.0 to increase the baseline/initial distance between icons...
style "thunar-spaced-out-icons"
{
ThunarIconView::column-spacing = 70
ThunarIconView::row-spacing = 70
}
class "ThunarIconView" style "thunar-spaced-out-icons"
...Thunar increases the distance between icons even more when long file names are detected.
Is there a setting that tells Thunar to NOT change the distance between icons? If there is no such setting, I'd like to recompile Thunar without this "feature". I grepped the source code for "column-spacing" and didn't find an obvious culprit, so the offending function must change a variable of some other name. Please help.
_______________________________________________
Thunar-dev mailing list
https://mail.xfce.org/mailman/listinfo/thunar-dev
_______________________________________________
Thunar-dev mailing list
https://mail.xfce.org/mailman/listinfo/thunar-dev
Bruno Dantas
2017-03-14 19:16:29 UTC
Permalink
Markus,

Success!

For the benefit of others similarly grieved by this behavior:

My version of thunar is slightly older than the version for which you wrote the patch (1.6.3-2 vs. 1.6.10), so I manually applied the changes in thunar_fixed_width_final.patch just to make sure everything was in the right place. Then I compiled the patched thunar and installed it.

At first I didn't notice anything different, so I did some internet searching and instinctively tried this:

$ xfconf-query --channel thunar --property /misc-fixed-item-width --create --type bool --set true

BINGO! Your patch now does its magic. Now, icons are *always* a fixed distance from one another.

Wish I could buy you a beer for this fix. Thunar was seriously aggravating my OCD with this annoying behavior. I may try thunar_truncate_final.patch at some point, but I'm perfectly happy for now.

THANK YOU.
Markus
2017-03-14 19:49:29 UTC
Permalink
Glad it is of help to you! I feel you about the OCD - this is where
those patches came from ;)

Too bad those changes never actually made it into Thunar; I just
remembered that I already submitted those 2 patches one and half years ago:

https://bugzilla.xfce.org/show_bug.cgi?id=12126

https://bugzilla.xfce.org/show_bug.cgi?id=12153

Either I did something wrong with the reports or development is near
dead after all.


Cheers!

Markus.
Post by Bruno Dantas
Markus,
Success!
My version of thunar is slightly older than the version for which you wrote the patch (1.6.3-2 vs. 1.6.10), so I manually applied the changes in thunar_fixed_width_final.patch just to make sure everything was in the right place. Then I compiled the patched thunar and installed it.
$ xfconf-query --channel thunar --property /misc-fixed-item-width --create --type bool --set true
BINGO! Your patch now does its magic. Now, icons are *always* a fixed distance from one another.
Wish I could buy you a beer for this fix. Thunar was seriously aggravating my OCD with this annoying behavior. I may try thunar_truncate_final.patch at some point, but I'm perfectly happy for now.
THANK YOU.
_______________________________________________
Thunar-dev mailing list
https://mail.xfce.org/mailman/listinfo/thunar-dev
Loading...