Bug 369622 - KDE apps always use 32px icons in system tray
Summary: KDE apps always use 32px icons in system tray
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: System Tray (show other bugs)
Version: 5.7.95
Platform: openSUSE Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-01 21:47 UTC by Guo Yunhe
Modified: 2016-11-08 09:54 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
amarok.svgz (4.06 KB, image/svg+xml-compressed)
2016-10-02 11:19 UTC, Guo Yunhe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Guo Yunhe 2016-10-01 21:47:23 UTC
I did a test to prove that even the actual icon size is 22px, system tray will use 32px icon of desktop themes. 22px icons are never used.

Here is the SVGZ file amarok.svgz I used:

http://imgur.com/NQEXWDn

It contains:
- #amarok (a red square)
- #32-32-amarok (a yellow square)

The result in system tray is a yellow 22px square icon, which is unexpected.

http://imgur.com/SacSrNW

Reproducible: Always

Steps to Reproduce:
1. Copy amarok.svgz in attachment to ~/.local/share/plasma/desktoptheme/default/icons/
2. Restart system or plasmashell to referesh Plasma cache.
3. Start Amarok.
4. Check amarok in system tray.

Actual Results:  
The icon is a yellow square (32px).

Expected Results:  
The icon is a red square (22px).
Comment 1 Guo Yunhe 2016-10-02 11:19:47 UTC
Created attachment 101375 [details]
amarok.svgz
Comment 2 Marco Martin 2016-10-03 14:13:07 UTC
is the system high dpi?
locally i can't reproduce, i get the 22px graphics for 22 pixels and less systray icons
Comment 3 Guo Yunhe 2016-10-03 18:23:06 UTC
(In reply to Marco Martin from comment #2)
> is the system high dpi?
> locally i can't reproduce, i get the 22px graphics for 22 pixels and less
> systray icons

Not High-DPI. It is Full HD (1920x1080) screen.

Can you test with my amarok.svgz and take a screenshot? Is it a red or yellow square on your system?
Comment 4 Guo Yunhe 2016-10-07 14:20:42 UTC
I have new evidence to support it. From latest git, folder src/desktoptheme/breeze/icons

1. In start.svgz file, objects are:
* 22-22-start-here-kde (22px)
* start-here-kde (32px)

2. In amarok.svgz file, objects are:

* amarok (22px)
* 32-32-amarok (32px)

I believe here must be some problems in naming and loading icon sizes. Otherwise, it won't be using inconsistent id.
Comment 5 Marco Martin 2016-11-04 14:21:00 UTC
tried with that exact svg and it's yellow.
but, for how the svg is done is kinda expected.
the problem is that the version without prefix is the 22x22px, while the bigger 32x32 version has a prefix.

the supported way (that works and makes the icon red) is the other way around: the biggest available version without prefix, and the smallest ones with a prefix instead, so if you have ids:
22-22-amarok
and
amarok

then the 22px version gets correctly picked
Comment 6 Guo Yunhe 2016-11-04 14:28:24 UTC
(In reply to Marco Martin from comment #5)
> tried with that exact svg and it's yellow.
> but, for how the svg is done is kinda expected.
> the problem is that the version without prefix is the 22x22px, while the
> bigger 32x32 version has a prefix.
> 
> the supported way (that works and makes the icon red) is the other way
> around: the biggest available version without prefix, and the smallest ones
> with a prefix instead, so if you have ids:
> 22-22-amarok
> and
> amarok
> 
> then the 22px version gets correctly picked

OK, I understand. Then it is the problem of SVG files. I checked those SVG files a long time ago and most of them are not correctly prefixed. When both 32px and 22px are available, 32px is prefixed but 22px is not.

I could submit a patch for that later. But I think this bug could be closed (not really a problem of programming).
Comment 7 Guo Yunhe 2016-11-04 14:38:14 UTC
I also have a suggestion: force every size to provide a prefix:

* 22-22-amarok
* 32-32-amarok

Then here will be no confusing about naming.
Comment 8 Guo Yunhe 2016-11-04 15:53:56 UTC
https://git.reviewboard.kde.org/r/129329/

This patch should fix the 22-22- ID prefix proglem.
Comment 9 Marco Martin 2016-11-08 09:54:04 UTC
Git commit f37cc1361481a2d6ce530e87c68706d81c326b98 by Marco Martin.
Committed on 08/11/2016 at 09:53.
Pushed by mart into branch 'master'.

Fix SVG icon ID prefix

As https://bugs.kde.org/show_bug.cgi?id=369622#c5 mentioned,
if icon has both 22px and 32px sizes, the 22px one should
have prefix of 22-22- in object ID while the 32px one shouldn't.
Checked all existing icons and to correct wrong IDs.

patch by Yunhe Guo <guoyunhebrave@gmail.com>

CCMAIL:guoyunhebrave@gmail.com
Change-Id: I9d8728cfa9ce47aaaaa3b0e5042ed616f142c19a
REVIEW:129329

M  +-    --    src/desktoptheme/breeze/icons/akonadi.svgz
M  +-    --    src/desktoptheme/breeze/icons/akregator.svgz
M  +-    --    src/desktoptheme/breeze/icons/amarok.svgz
M  +-    --    src/desktoptheme/breeze/icons/apport.svgz
M  +-    --    src/desktoptheme/breeze/icons/cantata.svgz
M  +-    --    src/desktoptheme/breeze/icons/configure.svgz
M  +-    --    src/desktoptheme/breeze/icons/document.svgz
M  +-    --    src/desktoptheme/breeze/icons/drive.svgz
M  +-    --    src/desktoptheme/breeze/icons/edit.svgz
M  +-    --    src/desktoptheme/breeze/icons/kalarm.svgz
M  +-    --    src/desktoptheme/breeze/icons/konv_message.svgz
M  +-    --    src/desktoptheme/breeze/icons/media.svgz
M  +-    --    src/desktoptheme/breeze/icons/nepomuk.svgz
M  +-    --    src/desktoptheme/breeze/icons/phone.svgz
M  +-    --    src/desktoptheme/breeze/icons/touchpad.svgz

http://commits.kde.org/plasma-framework/f37cc1361481a2d6ce530e87c68706d81c326b98