! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Impossible to set an icon for folder menu item in panel
Status:
RESOLVED: MOVED
Product:
Xfce4-panel
Component:
Directory Menu

Comments

Description JD 2019-08-26 16:09:50 CEST
Hello,
Since last update, it seems impossible to set an icon to a folder menu item. It keeps the "forbidden" icon no matter what.
Comment 1 ToZ editbugs 2019-08-29 03:16:10 CEST
The Directory Menu uses gtk_image_set_from_icon_name()[1] to set the icon, so it needs to be an icon from the icon theme to work - custom icons not supported. 

As a workaround, you can copy your custom icon to ~/.icons (create the folder if it doesn't exist) and then you can find the icon under the "Uncategorized" or "All" sections.

[1]https://git.xfce.org/xfce/xfce4-panel/tree/plugins/directorymenu/directorymenu.c#n247
Comment 2 JD 2019-08-29 09:20:41 CEST
Created attachment 8966 
Screenshot
Comment 3 JD 2019-08-29 09:20:54 CEST
Hello and thank you for your answer!

It seems to me that it's a regression since it was possible to use custom images in the previous version.
Moreover, the system allows me to pick a custom image (as seen in attached screenshots), it's just that it has no effects when I validate (with no warning nor alert message).

Regards,

JD
Comment 4 Andre Miranda editbugs 2019-09-01 21:12:35 CEST
The behavior was changed by this commit:
https://git.xfce.org/xfce/xfce4-panel/commit/plugins/directorymenu/directorymenu.c?id=ccfa438

xfce_panel_image_set_from_source was replaced by gtk_image_set_from_icon_name. The former accepts a "source " which "can be an absolute path or an icon-name" according to the docs.
Comment 5 JD 2019-09-02 11:00:44 CEST
Well it seems that there's an issue somewhere, but I don't know if it's related to gtk_image_set_from_icon_name or to the way XFCE sends parameters to the method.
In my  xfce4-panel.xml, I do have the following

    <property name="plugin-22" type="string" value="directorymenu">
      <property name="base-directory" type="string" value="/home/xxx/Applications/Applis AMUE"/>
      <property name="icon-name" type="string" value="/home/xxx/Applications/Applis AMUE/LogoAMUE.png"/>
      <property name="file-pattern" type="string" value="*.jnlp"/>
    </property>

where /home/xxx/Applications/Applis AMUE/LogoAMUE.png is a valid existing absolute path to a png image.

If I copy the icon to /usr/share/pixmaps then I can use it as an "uncategorized icon", but it requires privileges to copy files there (so it's still a regression, in my opinion).

I wonder if the problem could be in the property name "icon-name", maybe it should be a "button-icon"? 

Regards,

JD
Comment 6 cryptogopher 2019-12-12 00:29:09 CET
(In reply to JD from comment #5)
> If I copy the icon to /usr/share/pixmaps then I can use it as an
> "uncategorized icon", but it requires privileges to copy files there (so
> it's still a regression, in my opinion).

To avoid the need to copy to system directory, you can use xdg-icon-resource to install icon resource in your homedir. I did it like that:

xdg-icon-resource install --size 48 your-icon-file.png

(where 48 is size of the icon, you can choose whatever size suits you).

In my case icon gets installed inside ~/.local/share/icons/hicolor/48x48/apps/, so no system permissions are necessary. Icon installed that way can be easily selected as directorymenu plugin icon and is visible under "Application icons" (actually I found this solution just to do that).
Comment 7 Git Bot editbugs 2020-05-28 02:14:58 CEST
-- GitLab Migration Automatic Message --

This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/xfce/xfce4-panel/-/issues/254.

Please create an account or use an existing account on one of our supported OAuth providers. 

If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests

Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev

Bug #15888

Reported by:
JD
Reported on: 2019-08-26
Last modified on: 2020-05-28

People

Assignee:
Xfce Bug Triage
CC List:
4 users

Version

Version:
4.14.0

Attachments

Screenshot (350.44 KB, image/png)
2019-08-29 09:20 CEST , JD
no flags

Additional information