New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tray icon in KDE5 doesn't have colorful border #2042

Open
marmarek opened this Issue May 30, 2016 · 32 comments

Comments

Projects
None yet
5 participants
@marmarek
Member

marmarek commented May 30, 2016

In KDE5, tray icon (especially NetworkManger Applet) doesn't have colorful border. It looks like KDE is trying to blend the icon into panel.
It is critical to have a way to distinguish icons from VMs.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek May 30, 2016

Member

Screenshot:
nm-applet-no-border

Member

marmarek commented May 30, 2016

Screenshot:
nm-applet-no-border

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek May 30, 2016

Member

One idea is to abandon borders and color the whole icon, similar to icons used in the menu. Algorithm used for this coloring requires converting RGB to HSL, which seems to be not an easy task in C, but much easier in python (as it's done with app icons). And it looks to be quite easy to call python function from C.

Member

marmarek commented May 30, 2016

One idea is to abandon borders and color the whole icon, similar to icons used in the menu. Algorithm used for this coloring requires converting RGB to HSL, which seems to be not an easy task in C, but much easier in python (as it's done with app icons). And it looks to be quite easy to call python function from C.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jun 6, 2016

Member

After hours of debugging with @woju finally got it working :) IMHO looks nice, much better than unnoticeable border:
colorful-nm colorful-nm-connecting

Transparency is introduced by KDE - this is probably the same mechanism that stripped the border...
Should we enable it by default for every WM? Or only KDE? @rootkovska

Member

marmarek commented Jun 6, 2016

After hours of debugging with @woju finally got it working :) IMHO looks nice, much better than unnoticeable border:
colorful-nm colorful-nm-connecting

Transparency is introduced by KDE - this is probably the same mechanism that stripped the border...
Should we enable it by default for every WM? Or only KDE? @rootkovska

@rootkovska

This comment has been minimized.

Show comment
Hide comment
@rootkovska

rootkovska Jun 6, 2016

Member

Can you disable it for KDE and paste here a screenshot?

Member

rootkovska commented Jun 6, 2016

Can you disable it for KDE and paste here a screenshot?

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jun 6, 2016

Member

Take a look above - there is nm-applet icon from sys-net (yes, should have red border, but it's stripped by KDE).

Member

marmarek commented Jun 6, 2016

Take a look above - there is nm-applet icon from sys-net (yes, should have red border, but it's stripped by KDE).

@rootkovska

This comment has been minimized.

Show comment
Hide comment
@rootkovska

rootkovska Jun 6, 2016

Member

No, I would like to see the icon with a white bg.

Member

rootkovska commented Jun 6, 2016

No, I would like to see the icon with a white bg.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jun 6, 2016

Member

There is no white bg in KDE5 - it strips it out. Yes, what is actually visible in the tray in KDE5 is something preprocessed by KDE, not directly mapped VM icon.

Member

marmarek commented Jun 6, 2016

There is no white bg in KDE5 - it strips it out. Yes, what is actually visible in the tray in KDE5 is something preprocessed by KDE, not directly mapped VM icon.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jun 6, 2016

Member

And I can't see any configuration to disable this feature. Actually there is even no configuration for icon size (which is really annoying on HiDPI...)

Member

marmarek commented Jun 6, 2016

And I can't see any configuration to disable this feature. Actually there is even no configuration for icon size (which is really annoying on HiDPI...)

@rootkovska

This comment has been minimized.

Show comment
Hide comment
@rootkovska

rootkovska Jun 6, 2016

Member

What if our magic HSL-based color converter also converted any of the white pixels into... sightly less white pixels, say RGB(254,254,254)?

Member

rootkovska commented Jun 6, 2016

What if our magic HSL-based color converter also converted any of the white pixels into... sightly less white pixels, say RGB(254,254,254)?

@rootkovska

This comment has been minimized.

Show comment
Hide comment
@rootkovska

rootkovska Jun 6, 2016

Member

Currently it looks pretty ugly IMHO...

Member

rootkovska commented Jun 6, 2016

Currently it looks pretty ugly IMHO...

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jun 6, 2016

Member

RGB(254, 254, 254) trick worked:
colorful-nm-white-bg

Member

marmarek commented Jun 6, 2016

RGB(254, 254, 254) trick worked:
colorful-nm-white-bg

@rootkovska

This comment has been minimized.

Show comment
Hide comment
@rootkovska

rootkovska Jun 6, 2016

Member

... and if we also add back the frame in the VM color? :)

Member

rootkovska commented Jun 6, 2016

... and if we also add back the frame in the VM color? :)

@rootkovska

This comment has been minimized.

Show comment
Hide comment
@rootkovska

rootkovska Jun 6, 2016

Member

Also adding @bnvk to get his opinion.

Member

rootkovska commented Jun 6, 2016

Also adding @bnvk to get his opinion.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jun 6, 2016

Member

KDE strips the border, even if I made it thicker (2px).

Member

marmarek commented Jun 6, 2016

KDE strips the border, even if I made it thicker (2px).

@rootkovska

This comment has been minimized.

Show comment
Hide comment
@rootkovska

rootkovska Jun 6, 2016

Member

I see... Ok, let's try this:

  1. Revert back to the transparent bg,
  2. Tone down the Saturation (the S in HSL) at least by 50% (S /=2)
    ?
Member

rootkovska commented Jun 6, 2016

I see... Ok, let's try this:

  1. Revert back to the transparent bg,
  2. Tone down the Saturation (the S in HSL) at least by 50% (S /=2)
    ?
@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jun 6, 2016

Member

But when I made the frame separated 1px from actual border, it worked:
colorful-nm-white-bg-border
Now we've lost 2px from each side - one removed by KDE, the other one overwritten by our border.

Member

marmarek commented Jun 6, 2016

But when I made the frame separated 1px from actual border, it worked:
colorful-nm-white-bg-border
Now we've lost 2px from each side - one removed by KDE, the other one overwritten by our border.

@rootkovska

This comment has been minimized.

Show comment
Hide comment
@rootkovska

rootkovska Jun 6, 2016

Member

Looks better though :)

Member

rootkovska commented Jun 6, 2016

Looks better though :)

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jun 6, 2016

Member

Transparent BG, reduced saturation:
colorful-nm-reduced-stauration1

Member

marmarek commented Jun 6, 2016

Transparent BG, reduced saturation:
colorful-nm-reduced-stauration1

@rootkovska

This comment has been minimized.

Show comment
Hide comment
@rootkovska

rootkovska Jun 6, 2016

Member

Not bad either :) IMHO

Member

rootkovska commented Jun 6, 2016

Not bad either :) IMHO

@rootkovska

This comment has been minimized.

Show comment
Hide comment
@rootkovska

rootkovska Jun 6, 2016

Member

And can you paste the screen with the nm-appet in a "connecting" state -- that looked worst on the screens above...

Member

rootkovska commented Jun 6, 2016

And can you paste the screen with the nm-appet in a "connecting" state -- that looked worst on the screens above...

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jun 6, 2016

Member

No idea why, but when I've restarted nm-applet, KDE cut off another pixel or two from each side of the icon... Maybe something about icon size - now icon window (somewhere hidden by KDE) is 16x16, but embedded in 32x32 KDE container. After restarting gui daemon, icon is back at the right size (32x32), but is not updating anymore... Anyway probably unrelated to the whole coloring stuff.
Here is a screenshot you've requested:
colorful-nm-connecting-reduced-stauration1
And the one in disconnected state (the red one is in problematic state of 16x16 size):
colorful-nm-reduced-stauration2

Member

marmarek commented Jun 6, 2016

No idea why, but when I've restarted nm-applet, KDE cut off another pixel or two from each side of the icon... Maybe something about icon size - now icon window (somewhere hidden by KDE) is 16x16, but embedded in 32x32 KDE container. After restarting gui daemon, icon is back at the right size (32x32), but is not updating anymore... Anyway probably unrelated to the whole coloring stuff.
Here is a screenshot you've requested:
colorful-nm-connecting-reduced-stauration1
And the one in disconnected state (the red one is in problematic state of 16x16 size):
colorful-nm-reduced-stauration2

@rootkovska

This comment has been minimized.

Show comment
Hide comment
@rootkovska

rootkovska Jun 6, 2016

Member

I'm inclined towards the reduced-sat-on-transparent-bg version. Can you show how other icons would look this way? E.g. Electrum?

Member

rootkovska commented Jun 6, 2016

I'm inclined towards the reduced-sat-on-transparent-bg version. Can you show how other icons would look this way? E.g. Electrum?

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jun 6, 2016

Member

Electrum in blue VM:
colorful-electrum-blue
And red:
colorful-electrum-red

And the same with restored original saturation (and also added keepassx):
colorful-electrum-keepassx
Still - I see Electrum being indistinguishable.

Member

marmarek commented Jun 6, 2016

Electrum in blue VM:
colorful-electrum-blue
And red:
colorful-electrum-red

And the same with restored original saturation (and also added keepassx):
colorful-electrum-keepassx
Still - I see Electrum being indistinguishable.

@rootkovska

This comment has been minimized.

Show comment
Hide comment
@rootkovska

rootkovska Jun 6, 2016

Member

Not so good :/
And the version with "white-1" bg and frame around?

Member

rootkovska commented Jun 6, 2016

Not so good :/
And the version with "white-1" bg and frame around?

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jun 6, 2016

Member

colorful-electrum-keepassx-white frame
Would you like reduced saturation too? IMHO this makes some icons harder to distinguish.

Member

marmarek commented Jun 6, 2016

colorful-electrum-keepassx-white frame
Would you like reduced saturation too? IMHO this makes some icons harder to distinguish.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jun 6, 2016

Member

Cutting 2px from each side is especially visible on keepassx.

Member

marmarek commented Jun 6, 2016

Cutting 2px from each side is especially visible on keepassx.

@rootkovska

This comment has been minimized.

Show comment
Hide comment
@rootkovska

rootkovska Jun 6, 2016

Member

palmface

@bnvk, help?

Member

rootkovska commented Jun 6, 2016

palmface

@bnvk, help?

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jun 6, 2016

Member

I've already introduced configuration parameter for this. We can make it all configurable and decide on the final version later.

There is still an option for bordered but not colored icon (useful for other WMs).

Member

marmarek commented Jun 6, 2016

I've already introduced configuration parameter for this. We can make it all configurable and decide on the final version later.

There is still an option for bordered but not colored icon (useful for other WMs).

marmarek added a commit to marmarek/old-qubes-gui-daemon that referenced this issue Jun 7, 2016

marmarek added a commit to marmarek/old-qubes-gui-daemon that referenced this issue Jun 7, 2016

xside: configurable trayicon coloring
Restore "background" trayicon coloring and add an option to set the
mode.

QubesOS/qubes-issues#2042

marmarek added a commit to marmarek/old-qubes-gui-daemon that referenced this issue Jun 7, 2016

marmarek added a commit to marmarek/old-qubes-gui-daemon that referenced this issue Jun 7, 2016

marmarek added a commit to marmarek/old-qubes-gui-daemon that referenced this issue Jun 7, 2016

marmarek added a commit to marmarek/old-qubes-gui-daemon that referenced this issue Jun 7, 2016

xside: change default trayicon mode to tint
Have it at least somehow working on KDE5 (where border1 is not
functional at all). Subject to a change in near future.

QubesOS/qubes-issues#2042

@marmarek marmarek reopened this Jun 7, 2016

@timcollinsal1

This comment has been minimized.

Show comment
Hide comment
@timcollinsal1

timcollinsal1 Jun 9, 2016

Might be just dumb newbie uestion here (ill be that idiot guy who cant read documentation) - Using 3.2 test iso, after launch I have no border or tray or anything outside of top left hidden icon for network config. Im sure theres a command to open the GUI, but what might that be? Im running everything through terminal now ( I know the version Im using is test/pre=release) just curious how I might activate to ease user expereince visually and for thos of us not as familiar with console.

Might be just dumb newbie uestion here (ill be that idiot guy who cant read documentation) - Using 3.2 test iso, after launch I have no border or tray or anything outside of top left hidden icon for network config. Im sure theres a command to open the GUI, but what might that be? Im running everything through terminal now ( I know the version Im using is test/pre=release) just curious how I might activate to ease user expereince visually and for thos of us not as familiar with console.

@zander

This comment has been minimized.

Show comment
Hide comment
@zander

zander Jan 11, 2018

For what its worth;
the icon size is configurable and it is an "enum" to avoid HiDPI displays showing a 16 pixels icon.

The default is 16-pixels, scaled (looks just fine on a 230DPI screen I own, def not actually 16px).

You can change the default in a package quite trivially by patching (in dom0);
/usr/share/plasma/plasmoids/org.kde.plasma.private.systemtray/contents/config/main.xml
under iconSize change the default to 2, for instance.

About the border, the simplest solution is to work with the KDE team, or at least the sources. KDEs plasma is mostly implemented using javascript (in qml style) which means you have the sources in dom0. Many useful things can be done without recompiling.

For instance the actual icon behaviour etc is defined in;
/usr/share/plasma/plasmoids/org.kde.plasma.private.systemtray/contents/ui/items/StatusNotifierItem.qml

Either way, I'd be interested in reopening the investigation towards a coloured outline as the current solution of colourising is not my favourite, I got the impression you guys didn't prefer that either ;)

zander commented Jan 11, 2018

For what its worth;
the icon size is configurable and it is an "enum" to avoid HiDPI displays showing a 16 pixels icon.

The default is 16-pixels, scaled (looks just fine on a 230DPI screen I own, def not actually 16px).

You can change the default in a package quite trivially by patching (in dom0);
/usr/share/plasma/plasmoids/org.kde.plasma.private.systemtray/contents/config/main.xml
under iconSize change the default to 2, for instance.

About the border, the simplest solution is to work with the KDE team, or at least the sources. KDEs plasma is mostly implemented using javascript (in qml style) which means you have the sources in dom0. Many useful things can be done without recompiling.

For instance the actual icon behaviour etc is defined in;
/usr/share/plasma/plasmoids/org.kde.plasma.private.systemtray/contents/ui/items/StatusNotifierItem.qml

Either way, I'd be interested in reopening the investigation towards a coloured outline as the current solution of colourising is not my favourite, I got the impression you guys didn't prefer that either ;)

@zander

This comment has been minimized.

Show comment
Hide comment
@zander

zander Jan 19, 2018

Interesting observation;

Adding a border to my applications icon, and showing it in my kde5 desktop had the following effect;

a) when running the app in dom0. This shows the border just fine.

b) When running in an appVM, this shows the colored image, without border.

I conclude that KDE does not remove any border added by Qubes, I don't know the full pipeline from appVM to kde-systemtray, would it be possible that the issue lies in one of the other components?

zander commented Jan 19, 2018

Interesting observation;

Adding a border to my applications icon, and showing it in my kde5 desktop had the following effect;

a) when running the app in dom0. This shows the border just fine.

b) When running in an appVM, this shows the colored image, without border.

I conclude that KDE does not remove any border added by Qubes, I don't know the full pipeline from appVM to kde-systemtray, would it be possible that the issue lies in one of the other components?

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jan 20, 2018

Member

Icon handling is configured in /etc/qubes/guid.conf. Default is to color it, instead of adding border. Available options are in man qubes-guid, for reference:

   Available trayicon modes:
       bg:    color full icon background to the VM color

       border1:
              add 1px border at the icon edges

       border2:
              add 1px border 1px from the icon edges

       tint : tint icon to the VM color,

              can be used with additional modifiers (you can enable multiple of them)

       tint+border1,tint+border2:
              same as tint, but also add a border

       tint+saturation50:
              same as tint, but reduce icon saturation by 50%

       tint+whitehack:
              same as tint, but change white pixels (0xffffff) to almost-white (0xfefefe)

Member

marmarek commented Jan 20, 2018

Icon handling is configured in /etc/qubes/guid.conf. Default is to color it, instead of adding border. Available options are in man qubes-guid, for reference:

   Available trayicon modes:
       bg:    color full icon background to the VM color

       border1:
              add 1px border at the icon edges

       border2:
              add 1px border 1px from the icon edges

       tint : tint icon to the VM color,

              can be used with additional modifiers (you can enable multiple of them)

       tint+border1,tint+border2:
              same as tint, but also add a border

       tint+saturation50:
              same as tint, but reduce icon saturation by 50%

       tint+whitehack:
              same as tint, but change white pixels (0xffffff) to almost-white (0xfefefe)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment