Bug 360333 - New system tray: icons do not scale with panel height, stay very small
Summary: New system tray: icons do not scale with panel height, stay very small
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: System Tray (show other bugs)
Version: master
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Nate Graham
URL:
Keywords:
: 360420 363562 369887 370525 375997 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-03-09 19:45 UTC by Luca Beltrame
Modified: 2020-06-10 08:51 UTC (History)
40 users (show)

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


Attachments
plasmoidviewer screenshot with large height (256.49 KB, image/png)
2016-03-09 19:46 UTC, Luca Beltrame
Details
Screenshot of system tray in the panel (7.83 KB, image/png)
2016-03-09 19:47 UTC, Luca Beltrame
Details
hidden icons expanded (39.13 KB, image/png)
2016-03-10 16:33 UTC, Hrvoje Senjan
Details
Left — stand-alone widgets, right — systray (72.27 KB, image/png)
2016-10-15 22:16 UTC, Nikita Skovoroda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luca Beltrame 2016-03-09 19:45:00 UTC
With the merge of the new system tray, icons in the tray keep on being very small (22px is my guess) with taller panels. In particular, as the panel gets taller, the icons get moved on two rows and keep on being very, very small (see attached screenshot). 

Increasing panel height makes icons stack on top, and does not increase their size (see screenshot)

Reproducible: Always

Steps to Reproduce:
1. Increase panel height


Actual Results:  
Icons are displayed on two or more rows, their height doesn't change

Expected Results:  
Icons should increase in size.

Latest plasma-workspace as of today (2016-03-09).
Comment 1 Luca Beltrame 2016-03-09 19:46:27 UTC
Created attachment 97801 [details]
plasmoidviewer screenshot with large height
Comment 2 Luca Beltrame 2016-03-09 19:47:38 UTC
Created attachment 97802 [details]
Screenshot of system tray in the panel
Comment 3 Hrvoje Senjan 2016-03-10 16:33:58 UTC
Created attachment 97822 [details]
hidden icons expanded
Comment 4 Martin Klapetek 2016-03-11 18:05:44 UTC
*** Bug 360420 has been marked as a duplicate of this bug. ***
Comment 5 Yuking 2016-03-13 08:59:27 UTC
Have the same problem. 
lfs with today's git codes.
Comment 6 Marco Martin 2016-03-15 10:44:57 UTC
this bug is pretty much mutually exclusive with
https://bugs.kde.org/show_bug.cgi?id=353834
I fear icons are either going to be too big for some people or too small for some other people (and i don't want to add a configure icon size ui)
Comment 7 Luca Beltrame 2016-03-15 10:53:00 UTC
Can a middle ground be at least tested? Currently, *any* resolution >  1366 x 768 in my tests (which is the one I have in my X220) makes icons unbearably tiny and even painful to look at.

At least, where is this set in the code? If all else fails, I'll patch it for myself...
Comment 8 Greg Varsanyi 2016-03-19 20:45:16 UTC
(In reply to Marco Martin from comment #6)
> this bug is pretty much mutually exclusive with
> https://bugs.kde.org/show_bug.cgi?id=353834
> I fear icons are either going to be too big for some people or too small for
> some other people (and i don't want to add a configure icon size ui)

This maybe an issue VDG could be involved with.

I'm not sure what you mean by "too big for some", but systray icons did indeed look bigger than the clock font next to them (since both got the same height, but fonts have some padding b/c of unused accent space above and below). Having that aligned would be a win.

But now it's not following the height of the panel at all. Fixed height systray icons mean they will look wrong on every resized taskbar panel - proportionally with how much it is resized.

Bringing back the proportionate design with make it much more usable for many of us, making it aligned with the text-based plasmoids on the panel would just make it look awesome.
Comment 9 Luca Beltrame 2016-03-23 22:28:30 UTC
With the latest state I have of plasma-workspace (cad0705)  at least now the icons are in a straight line, although smaller than the previous version. Makes things at least easier than before.
Comment 10 Luca Beltrame 2016-03-23 22:29:47 UTC
Sorry, wrong revision: i meant 8b677a9.
Comment 11 Dainius Masiliūnas 2016-08-27 18:28:39 UTC
I find this to be a problem too. I always make the panel higher, so that icons are easy to distinguish at a glance on big screens. With this change, it feels like we're back to the bad old xembed days of icons not scaling at all...

How about a panel option of how many rows the icons should be put into? This is both for system tray icons and taskbar buttons.
Comment 12 Jan Wiele 2016-09-29 08:37:49 UTC
This also makes the icons hard to see and click on high dpi screens. :(
Comment 13 Guillaume Martres 2016-10-04 20:03:57 UTC
Is there any way at all to work around this, even including recompiling stuff to hardcode a bigger size somewhere? On a 4K 15' screen I can barely see the systray icons.
Comment 14 Guillaume Martres 2016-10-04 20:12:41 UTC
Alright, I got it, let me know if there's a less terrible way of doing this:
- Edit /usr/share/plasma/plasmoids/org.kde.plasma.private.systemtray/contents/config/main.xml
- Under "<entry name="iconSize" type="Int">" you'll see:
  <default>1</default>
- Replace 1 by 2 or something bigger, for me 2 was exactly right.
Comment 15 David Edmundson 2016-10-04 21:33:48 UTC
*** Bug 369887 has been marked as a duplicate of this bug. ***
Comment 16 Keith Hammond 2016-10-05 16:15:46 UTC
How did this bug slip into an LTS release? It should be fixed immediately. If I booted up to a fresh install with this bug (rather than having updated to it and not wanting to move all of my data) I would straight away install a different DE or distro.
Comment 17 Guillaume Martres 2016-10-05 16:47:26 UTC
I suspect this bug is worse on hidpi screen because plasmashell does not respect hidpi settings (https://bugs.kde.org/show_bug.cgi?id=356446) so 16x16 is really 16x16 and is not scaled up as the comment in /usr/share/plasma/plasmoids/org.kde.plasma.private.systemtray/contents/config/main.xml indicates.
Comment 18 Jens Reuterberg 2016-10-06 06:59:54 UTC
(In reply to Marco Martin from comment #6)
> this bug is pretty much mutually exclusive with
> https://bugs.kde.org/show_bug.cgi?id=353834
> I fear icons are either going to be too big for some people or too small for
> some other people (and i don't want to add a configure icon size ui)

I guess that any variant will rub some people wrong. We simply can't account for all tastes and any change will make one group or another angry. The question is: which group do we want to piss off, or do we accept the problems that come with such a configuration UI. 
Also if Guillame is correct above, that HiDPI screens make the icons stick to 16x16, that's the main issue since that would make them close to unusable. 

One solution would be to create a third size of 32x32 icons and simply skip to that size when the panel is resized to something that could accomade them. But that means recreating the icon theme (so its pixel aligned) and that will take a while (IIRC only a few of the panel icons exists in 32x32)
Comment 19 rndbit 2016-10-06 07:19:41 UTC
Reality is that screen sizes are increasing, not decreasing, and downscaled icon looks better than upscaled. If plasma wants to be future-proof then you kind of have to have icons in bigger size available.
Comment 20 Dainius Masiliūnas 2016-10-06 07:26:29 UTC
(In reply to Jens Reuterberg from comment #18)
> I guess that any variant will rub some people wrong. We simply can't account
> for all tastes and any change will make one group or another angry. The
> question is: which group do we want to piss off, or do we accept the
> problems that come with such a configuration UI. 
> Also if Guillame is correct above, that HiDPI screens make the icons stick
> to 16x16, that's the main issue since that would make them close to
> unusable. 

Or, you know, make use of the thing KDE is renowned for: configuration options.
Comment 21 Guillaume Martres 2016-10-06 08:23:20 UTC
(In reply to Jens Reuterberg from comment #18)
> (In reply to Marco Martin from comment #6)
> > this bug is pretty much mutually exclusive with
> > https://bugs.kde.org/show_bug.cgi?id=353834
> > I fear icons are either going to be too big for some people or too small for
> > some other people (and i don't want to add a configure icon size ui)
> 
> I guess that any variant will rub some people wrong. We simply can't account
> for all tastes and any change will make one group or another angry. The
> question is: which group do we want to piss off, or do we accept the
> problems that come with such a configuration UI. 

I disagree with this, looking at https://bugs.kde.org/show_bug.cgi?id=353834 the issue is specifically with two rows of systray icons where the icons almost overlap, the bug report title even says "(ok if single row)". No one is clamoring for one row of very small icons.
Comment 22 Anthony Vital 2016-10-06 11:04:52 UTC
Could the problem be the method used to scale the icon size on hidpi monitors?
Looking in  plasma-framework/src/declarativeimports/core/units.cpp:
    // Scale the icon sizes up using the devicePixelRatio
    // This function returns the next stepping icon size
    // and multiplies the global settings with the dpi ratio.
    const qreal ratio = devicePixelRatio();
 
    if (ratio < 1.5) {
        return size;
    } else if (ratio < 2.0) {
        return size * 1.5;
    } else if (ratio < 2.5) {
        return size * 2.0;
    } else if (ratio < 3.0) {
        return size * 2.5;
    } else if (ratio < 3.5) {
        return size * 3.0;
    } else {
        return size * ratio;
    }
My ratio is 1.47674, that means I have no scaling at all when there is a 1.5 factor existing. Is it reasonable? Wouldn't it make more sense to use the factor the closest to the ratio rather than  what is done here?
Comment 23 Guillaume Martres 2016-10-06 11:14:16 UTC
(In reply to Anthony Vital from comment #22)
> Could the problem be the method used to scale the icon size on hidpi
> monitors?
> Looking in  plasma-framework/src/declarativeimports/core/units.cpp:
>     // Scale the icon sizes up using the devicePixelRatio
>     // This function returns the next stepping icon size
>     // and multiplies the global settings with the dpi ratio.
>     const qreal ratio = devicePixelRatio();
>  
>     if (ratio < 1.5) {
>         return size;
>     } else if (ratio < 2.0) {
>         return size * 1.5;
>     } else if (ratio < 2.5) {
>         return size * 2.0;
>     } else if (ratio < 3.0) {
>         return size * 2.5;
>     } else if (ratio < 3.5) {
>         return size * 3.0;
>     } else {
>         return size * ratio;
>     }
> My ratio is 1.47674, that means I have no scaling at all when there is a 1.5
> factor existing. Is it reasonable? Wouldn't it make more sense to use the
> factor the closest to the ratio rather than  what is done here?

Good point, but even if you fix that, I think that devicePixelRatio() will still return 1 because of: 
  qunsetenv("QT_DEVICE_PIXEL_RATIO");
  QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling)
in https://quickgit.kde.org/?p=plasma-workspace.git&a=blob&h=ec117f3bf9c12894bc7d3f80858256fab0026da4&hb=e88b52a18ff9c7ed43a9bed4e4ba270a8ee18355&f=shell%2Fmain.cpp (cf https://bugs.kde.org/show_bug.cgi?id=356446)
Comment 24 Anthony Vital 2016-10-06 11:34:35 UTC
(In reply to Guillaume Martres from comment #23)
> Good point, but even if you fix that, I think that devicePixelRatio() will
> still return 1 because of: 
>   qunsetenv("QT_DEVICE_PIXEL_RATIO");
>   QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling)
> in
> https://quickgit.kde.org/?p=plasma-workspace.
> git&a=blob&h=ec117f3bf9c12894bc7d3f80858256fab0026da4&hb=e88b52a18ff9c7ed43a9
> bed4e4ba270a8ee18355&f=shell%2Fmain.cpp (cf
> https://bugs.kde.org/show_bug.cgi?id=356446)
I don't think this problem affects icon sizes. Also I used the code from devicePixelRatio() to find the value 1.47674.
Comment 25 Dainius Masiliūnas 2016-10-06 18:11:30 UTC
Shouldn't the HiDPI scaling issues be in another bug report, though? This one is about icons scaling with panel size, regardless whether it's HiDPI or not.
Comment 26 Max 2016-10-11 12:28:07 UTC
I have a ratio of 1.3 on my machine, and the icons don't scale at all in 5.8.0. Used to scale properly in 5.7.last.
Comment 27 Nikita Skovoroda 2016-10-15 22:16:19 UTC
Created attachment 101576 [details]
Left — stand-alone widgets, right — systray

I would expect the systray be the same size as the widgets. Current systray is just barely visible (in fact unusable) on a HiDPI screen.
Comment 28 Dainius Masiliūnas 2017-02-05 17:49:47 UTC
Still an issue in Plasma 5.9.
Comment 29 David Edmundson 2017-02-08 09:15:34 UTC
*** Bug 375997 has been marked as a duplicate of this bug. ***
Comment 30 Keith Hammond 2017-02-12 04:39:54 UTC
Well, seeing as though the Plasma/KDE devs don't want to help out their HiDPI users and fix this issue (There has been one major release and multiple point releases since the creation of this bug) they have one less user and one less person that would recommend KDE to a friend.

I know that spiel isn't really relevant to fixing the bug, but maybe at least the devs will see that it is a major issue and get it fixed.
Comment 31 adr.fantini 2017-03-24 19:48:39 UTC
(In reply to Keith Hammond from comment #30)
> Well, seeing as though the Plasma/KDE devs don't want to help out their
> HiDPI users and fix this issue (There has been one major release and
> multiple point releases since the creation of this bug) they have one less
> user and one less person that would recommend KDE to a friend.
> 
> I know that spiel isn't really relevant to fixing the bug, but maybe at
> least the devs will see that it is a major issue and get it fixed.

Not only HiDPI users! I'm on a 1920x1080 15" screen, which nowadays is very common. Still, icon tray sizes are way too small, and it has been so for a whole year!

How is this possible? Why is noone fixing this extremely annoying bug? Everyone using Plasma on a moderately modern high-end laptop will be affected by this bug and likely believe that not much care is put into Plasma, if bugs like this go unnoticed.
Comment 32 Alexis J. 2017-03-27 18:43:45 UTC
+1

Sorry to "spam" people following this issue, but as end user I am also disappointed by this issue who persist release after release... Why?
Comment 33 Marco Parillo 2017-04-13 23:05:05 UTC
(In reply to Guillaume Martres from comment #14)
> Alright, I got it, let me know if there's a less terrible way of doing this:
> - Edit
> /usr/share/plasma/plasmoids/org.kde.plasma.private.systemtray/contents/
> config/main.xml
> - Under "<entry name="iconSize" type="Int">" you'll see:
>   <default>1</default>
> - Replace 1 by 2 or something bigger, for me 2 was exactly right.

Your approach does work for me, but the file seems to be over-written with every Plasma release. Instead, I found a solution (similarly described twice) that I was able to follow:

https://bbs.archlinux.org/viewtopic.php?pid=1686987#p1686987

https://forum.kde.org/viewtopic.php?f=289&t=131736&start=30#p365350
Comment 34 Uwe Dippel 2017-09-05 15:50:55 UTC
I fell under the same spell with 5.8, and didn't find a solution with askubuntu.

I have to say that it is most frustrating to read that the ui-people feel that it is their task and not the users' prerogative to change the icon sizes.
(https://forum.kde.org/viewtopic.php?f=289&t=131736#p359606)

Also, I can't agree with comment#6: 
I have modified the file as indicated in comment#14, to '2', and now it looks pretty much better here. Most of all, however, when I drag the vertical panel to a larger width, automatically the icons get sorted in two - or more - columns. 

Also, I can't see how and where and when - during installation - the size of tray icons could or should be modified, since the '1' in .../contents/config/main.xml seems to be part of the files under '/usr/. Therefore, I assume that this '1' is a fixed value, possibly irrespective of HiDPI. And not 'variable' as indicated in the comment in that file.

And then this behaviour would contradict the essence of Plasma 5: better adjust to the varieties of screen sizes and formats. Rather, it should scale to a certain percentage of physical screen width. 
I can't install KDE it into my Huawei 8" 1920 pixel tablet; though I wonder how tiny it would look there.

My suggestion is a configuration of icon size (user override of the parameter mentioned) through the (existing) context menu of the systray.
Comment 35 m.h.vankerkwijk 2017-12-30 22:45:13 UTC
The small icons in the panel were an oddity for me to on my Lenovo X-1 Yoga. I thought I would at least mention an oddity when applying the work-around from above (setting IconSize to 2) -- once that is done, if I resize my panel, the task bar icons do change in size, while before they stayed fixed. Is the default behaviour of them staying put a bug?
Comment 36 Alexander Potashev 2018-02-13 10:37:00 UTC
related patch: https://phabricator.kde.org/D7849
Comment 37 pgkos.bugzilla 2018-02-13 19:45:05 UTC
Patch which fixes this issue: https://phabricator.kde.org/D10487
Comment 38 Nate Graham 2018-03-11 20:11:19 UTC
*** Bug 370525 has been marked as a duplicate of this bug. ***
Comment 39 Nate Graham 2018-03-11 20:11:45 UTC
*** Bug 381794 has been marked as a duplicate of this bug. ***
Comment 40 Nate Graham 2020-01-15 19:13:56 UTC
*** Bug 363562 has been marked as a duplicate of this bug. ***
Comment 41 Nate Graham 2020-03-06 15:54:22 UTC
Manual workaround for now:

Add `iconSize=2` to ~/.config/plasma-org.kde.plasma.desktop-appletsrc in the section that has `extraItems=` in it

I'll look into fixing this properly for Plasma 5.19.
Comment 42 Lonnie 2020-03-28 15:10:35 UTC
Increase System Tray Icon Size in KDE:
https://unix.stackexchange.com/questions/568793/

In Kubuntu 19.10, the work-around above works great for increasing the icon size in the KDE System Tray widget.

However, please read the comments made under the question linked above. I'm told that this work-around no longer work starting in Kubuntu 20.04.

Ideally, you should be able to configure the icon-size of system-tray icons using the System-Tray's configuration GUI and not by editing some file.

Considering that these file-editing work-arounds are beginning to not work, I really love to see gui-level-support (for modifying system-tray-icon-size) in Kubuntu 20.04, but I'm worried its too late (Kubuntu 20.04 will be released next month).
Comment 43 Konrad Materka 2020-05-24 17:15:58 UTC
Changing "iconSize" property is a valid way to change System Tray icon size - it simply does not have an User Interface (yet). It should work the same in Kubuntu 20.04, I'm using larger icons as well and it still work in Plasma 5.19 beta.
Comment 44 Konrad Materka 2020-05-29 14:36:26 UTC
Git commit 161309cdf5904bca3db5a64da3706bb808efe67c by Konrad Materka.
Committed on 29/05/2020 at 14:35.
Pushed by kmaterka into branch 'master'.

[applets/systemtray] Configurable maximum icon size

Add configuration UI for setting maximum icon size. This utilizes existing configuration parameter. It is a maximum allowed icon size, if panel is smaller, icon will fit to closest smaller size.
Related: bug 355587

FIXED-IN: 5.20.0

M  +5    -0    applets/systemtray/package/contents/config/config.qml
C  +16   -8    applets/systemtray/package/contents/ui/ConfigGeneral.qml [from: applets/systemtray/package/contents/config/config.qml - 070% similarity]
M  +1    -1    applets/systemtray/package/contents/ui/items/AbstractItem.qml
M  +2    -2    applets/systemtray/package/contents/ui/main.qml

https://invent.kde.org/plasma/plasma-workspace/commit/161309cdf5904bca3db5a64da3706bb808efe67c