Skip to content
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

Make text on taskbar readable on light color scheme #2128

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pbabinca
Copy link

Gnome 42+ supports setting color preferences: light (default) and dark1.

When I set preferred color scheme to default or prefer light - either in the Settings or with gsettings set org.gnome.desktop.interface color-scheme default or gsettings set org.gnome.desktop.interface color-scheme prefer-light, text on the taskbar stays slightly dark grey on light grey background which makes text unreadable:

Screenshot from 2024-06-21 15-20-54

I'm running Fedora 40, Gnome Shell 46, using the default Adwaita theme.

After this pull request, there are two new settings to set font color of the application titles on light color scheme for minimized and not minimized applications in Dash to panel settings -> Behavior -> Ungroup applications -> settings icon:

Screenshot from 2024-06-21 15-50-18

By default this color is #282828 which is Gnome Shell's dark text on light color scheme2 for .panel-button:
Screenshot from 2024-06-21 15-51-25

Footnotes

  1. Some information can be found on Gnome Initiatives Wiki: Dark Style Preference.

  2. Since Gnome shell uses Sass to build up css and then gresource, the easiest is to query it like this:

    gresource extract \
    /usr/share/gnome-shell/gnome-shell-theme.gresource \
    /org/gnome/shell/theme/gnome-shell-light.css \
    | awk '/#panel \.panel-button \{/,/\}/ { if ($0 ~ /color:/ && $0 !~ /background-color:/) print }'
    

Automatically uses text with dark color when theme prefers light color,
or user uses light-style extension. Both light and dark color of text
are user configurable.

Resolves: home-sweet-gnome#1978
@julienfalque
Copy link

Instead of setting it, can't the color be automatically inherited from the shell somehow? This already works for e.g. the clock or the battery percentage.

Note: this relates to #1978.

@pbabinca
Copy link
Author

Instead of setting it, can't the color be automatically inherited from the shell somehow? This already works for e.g. the clock or the battery percentage.

I don't know if it is possible to automatically inherit the color as you are suggesting.

Dash to panel does not use CSS classes but rather sets styles directly based on other settings. See e.g. here:

dash-to-panel/appIcons.js

Lines 587 to 590 in 77ce087

this._windowTitle.set_style('font-size: ' + SETTINGS.get_int('group-apps-label-font-size') * fontScale + 'px;' +
'font-weight: ' + fontWeight + ';' +
(useFixedWidth ? '' : 'max-width: ' + maxLabelWidth + 'px;') +
'color: ' + fontColor);

With my approach in this PR I ended up with a fairly small change in the code base and environment that I'm not familiar with. I'm using this for some time now, it does not causes me any issues and I'm fine with this solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants