Bug 431361 - Layout labels in the Keyboard KCM use colors from the Plasma theme rather than the color scheme
Summary: Layout labels in the Keyboard KCM use colors from the Plasma theme rather tha...
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_keyboard (show other bugs)
Version: 5.20.5
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-09 17:16 UTC by Ilya Bizyaev
Modified: 2021-01-16 19:23 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.21


Attachments
Screenshot of the bug (91.66 KB, image/png)
2021-01-09 17:16 UTC, Ilya Bizyaev
Details
Looks good to me (204.52 KB, image/jpeg)
2021-01-12 00:07 UTC, Nate Graham
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ilya Bizyaev 2021-01-09 17:16:30 UTC
Created attachment 134685 [details]
Screenshot of the bug

SUMMARY
I just discovered that the Labels column in the Layouts tab of the Keyboard KCM is not empty, but shows layout labels colored in almost white, which makes them barely visible.


STEPS TO REPRODUCE
1. Open the Keyboard KCM
2. Go to the Layouts tab
3. Configure layouts to show labels without flags

OBSERVED RESULT
Label demos are barely visible

EXPECTED RESULT
Label demos are black


SOFTWARE/OS VERSIONS
Operating System: openSUSE Leap 15.2
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2
Comment 1 Nate Graham 2021-01-12 00:07:40 UTC
Created attachment 134756 [details]
Looks good to me

Weird, it looks fine to me (see attached screenshot).

Are you using a non-default or customized color scheme?
Comment 2 Ilya Bizyaev 2021-01-12 05:54:02 UTC
I use what is now called Breeze Twilight: Breeze for apps, Breeze Dark for Plasma.
Comment 3 Nate Graham 2021-01-12 17:42:03 UTC
Can confirm now. The KCM must be using the text color from the Plasma theme, somehow. Will see if I can fix it.
Comment 4 Nate Graham 2021-01-12 17:46:53 UTC
Found it. The problem is in Flags::drawLabel(), in plasma-desktop/kcms/keyboard/flags.cpp

    const QColor textColor = flagShown ? Qt::black : Plasma::Theme().color(Plasma::Theme::TextColor);

This is appropriate when the label is being drawn on a Plasma widget, but this code is re-used for drawing the flag or text in the KCM too, which is not appropriate.
Comment 5 Nate Graham 2021-01-12 17:49:06 UTC
Will fix.
Comment 6 Bug Janitor Service 2021-01-12 18:20:20 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/294
Comment 7 Nate Graham 2021-01-15 19:57:04 UTC
Git commit e6e11758d255afa78cc0e11ecb1e044d30a25c86 by Nate Graham.
Committed on 15/01/2021 at 19:56.
Pushed by ngraham into branch 'master'.

[kcms/keyboard] Use correct color for layout label in KCM

The label was always using the text color from the Plasma theme, which
just happened to work fine as long you were using the same colors for
both your Plasma and Apps colors (e.g. both dark or both light). But
when using one dark and the other light, the text would become
invisible.

This is resolved by adding a paremeter to the function that allows it to
specify whether it should get its text color from the Plasma theme or
apps color scheme. Then the function invocation for the tray item asks
for the Plasma theme color and the invocation in the KCM asks for the
apps color scheme color.
FIXED-IN: 5.21

M  +12   -4    kcms/keyboard/flags.cpp
M  +7    -2    kcms/keyboard/flags.h
M  +1    -1    kcms/keyboard/kcm_view_models.cpp
M  +1    -1    kcms/keyboard/layout_tray_icon.cpp

https://invent.kde.org/plasma/plasma-desktop/commit/e6e11758d255afa78cc0e11ecb1e044d30a25c86
Comment 8 Patrick Silva 2021-01-16 11:27:51 UTC
Same bug in system tray settings, see bug 401012