Bug 411051 - Invisible Icons and Strange Behaviour in Energy Information
Summary: Invisible Icons and Strange Behaviour in Energy Information
Status: RESOLVED FIXED
Alias: None
Product: kinfocenter
Classification: Applications
Component: Energy Information (show other bugs)
Version: 5.16.4
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Nate Graham
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-19 01:40 UTC by Ruben
Modified: 2019-09-01 03:09 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.17.0


Attachments
Icons on unselected buttons under Breeze (87.39 KB, image/png)
2019-08-21 23:34 UTC, Ruben
Details
Icons on unselected buttons under Breeze Dark (89.12 KB, image/png)
2019-08-21 23:35 UTC, Ruben
Details
Energy Info with Breeze Plasma Thema and Breeze Color Theme (87.75 KB, image/png)
2019-08-22 21:32 UTC, Ruben
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ruben 2019-08-19 01:40:43 UTC
SUMMARY
Energy Information has battery/mouse Icons that are invisible under the default "Breeze" setting. If I switch to a dark theme, they are visible as normal. It looks like the icons are in "Dark Theme" mode all the time.

In addition, if I click to change the time window, I have to double click on the icon again to change it to something else. Otherwise it is a single click action (after doing something else). Conversely, if I change the battery, I have to double/triple click it to change device if I did something else, but once I start switching battery devices it is only a single click action.

STEPS TO REPRODUCE
1. Select default breeze theme
2. Navigate to Energy Information
3. Repeat with dark theme

OBSERVED RESULT:
Battery icons on unselected items are invisible (except when using dark themes).
A consistent number of clicks are required for interacting with UI components.


EXPECTED RESULT
Battery icons should be visible using all themes.
A consisten number of clicks are required when interacting with the GUI


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 15.4
KDE Frameworks Version: 5.61.0
Qt Version: 5.12.3

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2019-08-19 15:47:23 UTC
Please attach a screenshot showing the icon issue.
Comment 2 Ruben 2019-08-21 23:34:46 UTC
Created attachment 122287 [details]
Icons on unselected buttons under Breeze
Comment 3 Ruben 2019-08-21 23:35:46 UTC
Created attachment 122288 [details]
Icons on unselected buttons under Breeze Dark
Comment 4 Ruben 2019-08-21 23:37:20 UTC
Added attachments. I didn't know I could do this actually (new to this bug reporting procedure). Is this not happening to you?
Comment 5 Nate Graham 2019-08-21 23:46:02 UTC
Thanks, that's very helpful.
Comment 6 Ruben 2019-08-22 00:32:08 UTC
Okay, good. It just looks like the same icon set (which just happens to have all white outlines) is being used on all themes. Since the buttons are also white in Breeze, they just don't show up.
Comment 7 Nate Graham 2019-08-22 18:39:10 UTC
The icons in question are generated by plasma-workspace/components/workspace/BatteryIcon.qml, which uses SVGs that come from the Plasma theme.

The bug is one of the following:
1. The relevant Plasma theme SVG files are not changing their colors according to the color scheme, but should
2. BatteryIcon.qml should use icons from the icon theme instead of SVGs from the Plasma theme
3. KInfoCenter itself should use icons directly from the icon theme instead of BatteryIcon.qml, which is inappropriate since it's for Plasma stuff, not KCMs


Out of curiosity, are you using the "Breeze" Plasma theme (not the color scheme, the Plasma theme)? Not the "Breeze Light" or "Breeze dark" Plasma theme, but just the "Breeze" Plasma theme. If not, please try that and see if that fixes it. This will help us narrow down condition 1.
Comment 8 Ruben 2019-08-22 21:31:30 UTC
Right! I switched my "Plasma theme" to Breeze (I had my Plasma theme on Breeze Dark, but my color scheme on normal Breeze, this is the color scheme they had on Kubuntu, which I tweaked to mimic on Neon). Switching my Plasma theme to Breeze solved everything! (See figure attached). The icons are definitely following the Plasma Theme instead of the Color Theme! You are a genius!
Comment 9 Ruben 2019-08-22 21:32:11 UTC
Created attachment 122298 [details]
Energy Info with Breeze Plasma Thema and Breeze Color Theme
Comment 10 Nate Graham 2019-08-22 21:38:15 UTC
Heh, thanks!

This is a general problem when you use a dark Plasma theme and a light apps theme, or vice versa. What's going on is that the "Breeze" Plasma theme uses icons that follow the color scheme colors so this problem never happens. But the "Breeze Dark" Plasma theme has hardcoded dark colors and hardcoded light icons, and "Breeze Light" plasma theme has hardcoded light colors and hardcoded dark icons. This is fine as long as apps don't use any Plasma components. But in this case, KInfoCenter is using a Plasma component, which is capable of having hardcoded icon colors that are guaranteed to be invisible with certain app color schemes.

The solution appears to be to fix KInfoCenter to not use a Plasma component for the icons here. Then the default Kubuntu dark Plasma/light apps style won't cause any problems.
Comment 11 Nate Graham 2019-08-22 21:59:46 UTC
Working on it.

To fully port, a few icons from the plasma theme will need to be added to the Breeze icon theme (ups, monitor). I'll do that too.
Comment 12 Nate Graham 2019-08-22 22:59:15 UTC
Git commit 69fd363b6412665554b838f9a699bd1db5434e1f by Nate Graham.
Committed on 22/08/2019 at 22:59.
Pushed by ngraham into branch 'master'.

Add battery-ups icons

Summary:
This icon is currently only in the Plasma theme, but a version for the icon theme is
needed to fix https://bugs.kde.org/show_bug.cgi?id=411051 by porting KInfoCenter's
energy page away from `WorkspaceComponents.batteryIcon`.

Test Plan:
{F7271738, size=full}
{F7271744, size=full}

Reviewers: #vdg, ndavis

Reviewed By: #vdg, ndavis

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D23365

A  +10   -0    icons-dark/devices/16/battery-ups.svg
A  +13   -0    icons-dark/devices/22/battery-ups.svg
A  +10   -0    icons/devices/16/battery-ups.svg
A  +13   -0    icons/devices/22/battery-ups.svg

https://commits.kde.org/breeze-icons/69fd363b6412665554b838f9a699bd1db5434e1f
Comment 13 Nate Graham 2019-08-22 23:00:06 UTC
The icons are in; here's the patch that fixes the rest: https://phabricator.kde.org/D23368
Comment 14 Nate Graham 2019-09-01 03:09:55 UTC
Git commit d6da69a584ae46cf0e169b14145fdfd23911bd5b by Nate Graham.
Committed on 01/09/2019 at 03:09.
Pushed by ngraham into branch 'master'.

[Energy KCM] Port away from WorkspaceComponents.BatteryIcon and improve presentation

Summary:
Using this Plasma component in an app causes the icons to disappear when using a dark
Plasma theme and a light color scheme, or vice versa. This patch fixes that by porting
away from the Plasma component and instead using a Kirigami icon to show the icons.

The patch also spruces up the visual presentation a bit.
FIXED-IN: 5.17.0

Depends on D23365

Test Plan: {F7273745, size=full}

Reviewers: #plasma, broulik, meven, filipf

Reviewed By: meven

Subscribers: filipf, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D23368

M  +50   -27   Modules/energy/package/contents/ui/main.qml

https://commits.kde.org/kinfocenter/d6da69a584ae46cf0e169b14145fdfd23911bd5b