Xfce Forum

Sub domains
 

You are not logged in.

#1 2021-11-27 22:40:58

eugenenine
Member
Registered: 2021-08-31
Posts: 26

Where in thunar code is the render of icons for special folders?

I see where emblems are displayed in thunar-icon-renderer.c but I don't see where the special folder icons are rendered.

this set:
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/"
XDG_PUBLICSHARE_DIR="$HOME/"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"

Thanks

Offline

#2 2021-11-27 23:45:46

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,491

Re: Where in thunar code is the render of icons for special folders?

Defined here and processed here.

This is based on the XDG User Dirs spec.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Online

#3 2021-11-28 01:28:25

eugenenine
Member
Registered: 2021-08-31
Posts: 26

Re: Where in thunar code is the render of icons for special folders?

Thanks, I got that far, I found the thunar_file_dirs[] in there which gets those from glib2.

You second link then I see where the icon is associated with each user dir in the loop, when where are the icons actually rendered?
I see in thunar.icon.renderer.c where the icon is set translucent if needed then the emblems are rendered below that in the file but i don't see where it knows if its a file or folder and then if its the special folder when rendering the icon.
I see the g_object_class_install_property call further up.

In thunar.icon.renderer.c
icon = thunar_icon_factory_load_file_icon

from thunar-icon-factory.c
which makes the call to thunar_file_get_icon_name in thunar-file.c

It looks like the symbol for the XDG special folders is overlaid on top of a plain folder just like how the emblems are overlaid on a regular folder. But I don't see how loop in thunar-file overlays the special icons on top of the regular.
I guess I should have specified when using the symbolic (svg's)

Last edited by eugenenine (2021-11-28 03:00:43)

Offline

#4 2021-11-28 11:21:03

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,491

Re: Where in thunar code is the render of icons for special folders?

thunar_file_get_icon_name is called from:

$ fgrep -ri thunar_file_get_icon_name
thunar/thunar-window.c:      icon_name = thunar_file_get_icon_name (window->current_directory,
thunar/thunar-window.c:                  icon_name = thunar_file_get_icon_name (thunar_file, THUNAR_FILE_ICON_STATE_DEFAULT, icon_theme);
thunar/thunar-location-button.c:      icon_name = g_strdup_printf ("%s-symbolic", thunar_file_get_icon_name (file,
thunar/thunar-location-button.c:      dnd_icon_name = thunar_file_get_icon_name (file, location_button->file_icon_state, icon_theme);
thunar/thunar-icon-factory.c:      icon_name = thunar_file_get_icon_name (file, icon_state, factory->icon_theme);
thunar/thunar-file.h:const gchar      *thunar_file_get_icon_name              (ThunarFile              *file,
thunar/thunar-file.c:thunar_file_get_icon_name_for_state (const gchar         *icon_name,
thunar/thunar-file.c: * thunar_file_get_icon_name:
thunar/thunar-file.c:thunar_file_get_icon_name (ThunarFile          *file,
thunar/thunar-file.c:    return thunar_file_get_icon_name_for_state (file->icon_name, icon_state);
thunar/thunar-file.c:  return thunar_file_get_icon_name_for_state (file->icon_name, icon_state);

It looks like the symbol for the XDG special folders is overlaid on top of a plain folder just like how the emblems are overlaid on a regular folder. But I don't see how loop in thunar-file overlays the special icons on top of the regular.

The icon theme will (should) have icons specific to each special folder type that would be used. For example, folder-documents, folder-download, folder-music, folder-pictures,...).


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Online

#5 2021-11-28 14:59:55

eugenenine
Member
Registered: 2021-08-31
Posts: 26

Re: Where in thunar code is the render of icons for special folders?

Yes, I get that far. but if you look inside an icon theme there is a folder for different sized and there is a scalable folder. Is thunar not using the symbolic icons and only the ones in the 128,64,48, etc folders? because the ones in the symbolic don't have a folder drawn around them, so they would have to merge with a folder icon.

ls -l
total 32
drwxr-xr-x 2 root root 4096 Jul 29 14:37 128
drwxr-xr-x 2 root root 4096 Jul 29 14:37 16
drwxr-xr-x 2 root root 4096 Jul 29 14:37 22
drwxr-xr-x 2 root root 4096 Jul 29 14:37 24
drwxr-xr-x 2 root root 4096 Jul 29 14:37 32
drwxr-xr-x 2 root root 4096 Jul 29 14:37 48
drwxr-xr-x 2 root root 4096 Jul 29 14:37 64
drwxr-xr-x 2 root root 4096 Jul 29 14:37 symbolic

Offline

#6 2021-11-28 15:31:03

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,491

Re: Where in thunar code is the render of icons for special folders?

What are you trying to do? Get the icon theme to display the proper icon?

You can run thunar through strace to get an idea which icon files it is actually using:

strace -o thunar.log thunar

...and then grep the file for the icon name. It should come from the sized folders - from the places folder (eg. .../places/24)


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Online

#7 2021-11-29 02:23:51

eugenenine
Member
Registered: 2021-08-31
Posts: 26

Re: Where in thunar code is the render of icons for special folders?

I was editing the svg and couldn't figure out why it wasn't working smile. so if thunar is displaying only the fixed size icons from the numbered folders what are the .svgs in the symbolic folder used for?

But big picture I wanted to see how the emblems work compared to the typical icons, the emblems appear to use the symbolic svg's so I'm wondering why the difference?

Last edited by eugenenine (2021-11-29 03:39:59)

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.010 seconds, 7 queries executed - Memory usage: 545.05 KiB (Peak: 545.89 KiB) ]