manatools / dnfdragora

dnfdragora is a dnf frontend based on libyui abstraction
GNU General Public License v3.0
137 stars 41 forks source link

Blurry updater tray icon in Plasma 5 #139

Closed vinzv closed 4 years ago

vinzv commented 5 years ago

The tray icon of dnfdragora-update is blurry in Plasma 5 (OpenMandriva Lx 4), see screenshot: Screenshot_20190624_224134

I tried to fix it manually and dug through the source, both without any luck. Can you fix that or tell me where to look at?

Conan-Kudo commented 5 years ago

This is where that code is:

https://github.com/manatools/dnfdragora/blob/56006a7c6e3d73db4fe0ccfc28bcae27d810d37d/dnfdragora/updater.py#L60-L73

The issue is that we don't send a vector icon, only a raster one. Unfortunately, our toolkit currently doesn't support vector icons. 😞

This is an issue with libyui, and needs to be fixed there: https://github.com/libyui/libyui/issues/126

blackcrack commented 5 years ago

hmm.. https://www.pling.com/p/1254749/

therewith be you in possible move a 256x256 png in a svg/svgz and have a clean, sharp icon who be in able for a nice scaling ..

i have make it with my whole iconthemes https://www.pling.com/u/blackcrack/ with the script : https://www.pling.com/p/1224130/

anaselli commented 5 years ago

IIrc in updater i changed that... if you use an svg file is converted to png...

vinzv commented 5 years ago

@anaselli I saw some code doing that here. Yet I don't think it works. Forcing another icon path to svg files still loads the 128px png:

$ dnfdragora-updater --icon-path /usr/share/icons/hicolor/scalable/apps/
Skipped exception: <[Errno 2] Datei oder Verzeichnis nicht gefunden: './dnfdragora.yaml'> 
Icon: /usr/share/icons/hicolor/128x128/apps/dnfdragora.png

The same happens with directly pointing to the svg file. Both ways the tray icon stays blurry.

anaselli commented 5 years ago

As far as i can say it should load the theme one or our default if not present but i see it is a 128 pixels icon anyway as you can see here Maybe you can force it to 256 px iirc it should take the biggest one but at most at the size. If it works we can change it.

vinzv commented 5 years ago

Tried forcing 256px version, same result:

dnfdragora-updater --icon-path /usr/share/icons/hicolor/256x256/apps/dnfdragora.png 
Skipped exception: <[Errno 2] Datei oder Verzeichnis nicht gefunden: './dnfdragora.yaml'> 
Icon: /usr/share/icons/hicolor/128x128/apps/dnfdragora.png

I also copied the 256px png to some different location to make sure it's no path issue. But the result was exact the same.

anaselli commented 5 years ago

I'm not sure but i think /usr/share/icons/hicolor/128x128/apps/dnfdragora.png is your theme icon- And you should change 256 into code

      pathname = xdg.IconTheme.getIconPath("dnfdragora", 128)

and of course having a 256 theme icon. For some reasons i can't remember now - a previous bug maybe- theme icon wins so option icon-path doesn't

anaselli commented 5 years ago

please try this patch and tell me if it works.

vinzv commented 5 years ago

I applied the patch and now I can at least force the use of a different path. Nevertheless, the icon stays blurred. I tried various sizes and even completely different icons but without any luck. :-(

anaselli commented 5 years ago

i don't think our 256x256 icon is so nice... maybe you should try something better (fedora should have changed our icons iirc), contributes are also welcome :D

vinzv commented 5 years ago

I can try to make something, but that won't solve this issue. See this quick try: Screenshot_20190626_230210

The PNG has 256x256 px at 96dpi and still gets blurred. I assume the conversion done in Python messes it up somehow.

Edit: I just found this which shows that pyrsvg might be the way to a solution. Or go with SVGs overall instead which would be a good idea regarding HiDPI sreen compatibility.

anaselli commented 5 years ago

Well that icon is from a contributor, I'm not a graphic designer so I probably won't be able to do a good job there anyway. But I am ready to release any better solution from contributors . And yes we convert any svg provided as theme for instance to png by using cairosvg already.

anaselli commented 4 years ago

Could you please new icons added by @pontaoski?