Bug 353819

Summary: Certain combination of color schemes/plasma themes and note colors yield poor contrast between note and UI controls (buttons, scrollbar)
Product: [Plasma] kdeplasma-addons Reporter: andreas_k <andreas_k>
Component: notesAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: 2m.fcih, bhush94, bugseforuns, epost.kde, i, kde.podagric, kde, luca.pedrielli, nate, notmart, plasma-bugs, postix, rapiteanu.catalin, rockonthemoonfm, tusharkant15
Priority: HI Keywords: usability
Version: 5.12.5   
Target Milestone: ---   
Platform: Other   
OS: Other   
Latest Commit: Version Fixed In: 6.0
Attachments: Yellow notes under Breeze Dark
KDE plasma 5.22.5 notes widget

Description andreas_k 2015-10-12 09:56:09 UTC
when you use plasma-breeze-dark the icons are white. In Notes the Background is Yellow so you can't see the white icons.

Reproducible: Always
Comment 1 Kai Uwe Broulik 2015-10-15 21:51:28 UTC
Marco, is there any way to force a dark color on the icons, through ColorScope or some other means?
Comment 2 Kai Uwe Broulik 2016-08-31 14:25:47 UTC
I could set a ColorScope around it which the Buttons honor but I don't want to randomly just assign ComplementaryColorGroup to them in hopes of picking the right color. The textColor and what not in there are read-only, though.
Comment 3 Kai Uwe Broulik 2017-01-02 00:35:12 UTC
*** Bug 374255 has been marked as a duplicate of this bug. ***
Comment 4 Kai Uwe Broulik 2017-12-25 15:07:24 UTC
*** Bug 388216 has been marked as a duplicate of this bug. ***
Comment 5 Øystein Steffensen-Alværvik 2018-04-06 07:27:24 UTC
Can reproduce on KDE Neon 5.12.4. Having Breeze Dark as *desktop* theme is enough to trigger this bug.
Comment 6 Øystein Steffensen-Alværvik 2018-05-09 14:02:05 UTC
Created attachment 112532 [details]
Yellow notes under Breeze Dark
Comment 7 Patrick Silva 2018-09-17 03:53:19 UTC
Still valid for plasma 5.14 beta.
Comment 8 Kai Uwe Broulik 2018-11-30 13:42:44 UTC
*** Bug 401574 has been marked as a duplicate of this bug. ***
Comment 9 Kai Uwe Broulik 2019-01-21 12:40:52 UTC
*** Bug 403457 has been marked as a duplicate of this bug. ***
Comment 10 Tushar Kant 2019-03-12 12:04:14 UTC
Hi! Just chiming in to say it's still here in 5.15.2
Comment 11 Filip Fila 2019-06-21 09:38:30 UTC
Git commit 84742d8965bdcc06fb08601cc11707de1b84e488 by Filip Fila.
Committed on 21/06/2019 at 09:38.
Pushed by filipf into branch 'master'.

[Notes] Fix icons being almost invisible with light backgrounds when using dark themes

Summary:
Old code had no way to adapt icon colors based on background so this patch uses different components to color the icons black with light backgrounds, and white with dark backgrounds.

Because Plasma Components 2.0 ToolButton doesn't support icon colors and because with 3.0 the code doesn't work, we have to port the affected buttons to QQC2 ToolButton.
FIXED-IN: 5.17

Test Plan:
Before:
{F6808620}

After:
{F6808621}

NOTE: The buttons stay highlighted after being pressed, but I'm trying to solve that in D21026

Reviewers: #plasma, #vdg, ngraham, davidedmundson

Reviewed By: #plasma, #vdg, ngraham, davidedmundson

Subscribers: broulik, davidedmundson, plasma-devel

Tags: #plasma

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

M  +67   -29   applets/notes/package/contents/ui/main.qml

https://commits.kde.org/kdeplasma-addons/84742d8965bdcc06fb08601cc11707de1b84e488
Comment 12 postix 2019-10-09 15:12:28 UTC
*** Bug 412770 has been marked as a duplicate of this bug. ***
Comment 13 ahmed m. 2021-10-09 16:04:52 UTC
I think this is happening again or is it a theme issue on my end?
Comment 14 Nate Graham 2021-10-11 15:43:19 UTC
Please attach a screenshot that shows the issue and mention which Plasma version you're using.
Comment 15 Nate Graham 2021-10-11 15:43:50 UTC
Beyond the fix here, there is a general remaining issue: Bug 437101.
Comment 16 ahmed m. 2021-10-12 11:14:28 UTC
Created attachment 142364 [details]
KDE plasma 5.22.5 notes widget

This is with KDE plasma 5.22.5 on Breeze Dark theme (I don't think theme matters because the colors are hardcoded in the applet, but I ran the applet in appletviewer and got the same barely visible ui
Comment 17 Nate Graham 2021-10-12 15:45:47 UTC
Yup, you are running into the remaining edge case in Bug 437101.

*** This bug has been marked as a duplicate of bug 437101 ***
Comment 18 Nate Graham 2021-10-12 15:46:52 UTC
Actually, let's just re-open this since Bug 437101 is pretty much the same thing.
Comment 19 Nate Graham 2021-10-12 15:47:09 UTC
*** Bug 437101 has been marked as a duplicate of this bug. ***
Comment 20 Nate Graham 2021-10-12 15:47:22 UTC
*** Bug 441950 has been marked as a duplicate of this bug. ***
Comment 21 ahmed m. 2021-10-14 20:32:44 UTC
I thought that this was a small bug in the applet code and was hoping to fix it but it seems bigger, something in the theme/color scheme is causing this override. 

Is it too big of a bug to have as a first contribution? I have no idea where to look as a start for this bug, is it "breeze/kstyle/breezestyle.cpp", something plasma related, no idea! 
I'm just wondering, where in the KDE world does it render "QQC2.ToolButton" or "QQC2.ScrollView" and decides whether to paint the theme palette or the provided color. I saw something like this in the aforementioned breezestyle.cpp but that seems odd because it means it'd only apply to breeze themes, what about the other 3rd party themes?
Comment 22 Nate Graham 2021-10-14 22:17:10 UTC
There is no override; the issue here is the *lack* of an override. :) Right now the icon colors take into account only Plasma's own color scheme and therefore when using a light theme you get black icons, and when using a dark theme you get white icons. However it doesn't take into account the background color of the note itself. The UI elements of the note would have to be taught about that.

The way this works is that the icons' colors are hardcoded into the SVG, but can be re-colored at runtime by code in Plasma that reads some CSS inside the icons. However it only exposes the ability to choose which color set the color comes from; you can't just shim in an arbitrary color. So you can say "give me the text color from the View color set", or from the window color set, or from the header color set, or whatever. But that won't help much in this case because the available color sets don't map to the note's available background colors.

An easy fix for this would simply to put a window-colored rectangle under the controls, so they get drawn on top of a background whose color they expect. However this might be considered ugly. And it couldn't help the scrollbar unless you did it for that too, which would be even more like to be ugly.

It's a bit of a tricky problem to solve for the icons. For text, it's easier since you can actually force a specific color. So we could simply store a mapping of appropriate colors for each note color and use those for the text. But you can't currently do this for the icons, which is the problem.
Comment 23 Nate Graham 2024-02-07 02:52:55 UTC
Testing this again, it appears to be fixed now in Plasma 6. Tested with black and white note colors with both Breeze Light and Breeze Dark global themes. It looks like I accidentally fixed it with https://invent.kde.org/plasma/kdeplasma-addons/-/commit/daef6107bf40b791ab2860d9cd2c3fd317d5d3c3!