qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.32k stars 2.97k forks source link

Unreadable text in dark theme #47065

Closed timlinux closed 1 year ago

timlinux commented 2 years ago

What is the bug or the crash?

image

There are various places in QGIS where the text is not switched to a light colour resulting in unreable text in the UI, Maybe we should gather up all the dark theme issues to make it a more usable experince.

image

See also #33079

Steps to reproduce the issue

Open style manager for single symbol renderer - though the problem is all over the show in QGIS.

Versions

QGIS Master and backwards

Supported QGIS version

New profile

Additional context

No response

timlinux commented 2 years ago

Maybe we could take something like this and use some well worked out themes to deal with darkness...

https://github.com/Alexhuszagh/BreezeStyleSheets

nirvn commented 2 years ago

@timlinux , I'd use night mapping theme as a starting point. It's now pretty solid and has QGIS specific rules.

It'd then be a matter of changing the color variable definition and some css properties to match desired outcome.

timlinux commented 2 years ago

@nirvn I'm a little confused why we have src/app/qgisappstylesheet.cpp, since by the look of that logic we need to override not only the stylesheets but change theme specific code. Would you suggest adding another if clause in appstylesheet.cpp to provide dark theme defaults. Also confusing to me is that my QGIS3.ini is still set to default since the darkness hint comes from my gnome theme rather than an explicit choice to use night mapping - so I am not even sure if I am using night mapping or dedault at run time (guess I will go and poke around in the pythin console to check on that).

[UI]
UITheme=default
allWidgetsVisible=false
annotationTool=3
nirvn commented 2 years ago

Are you on Linux or OSX?

timlinux commented 2 years ago

Linux @nirvn

nirvn commented 2 years ago

@timlinux , and what's your Qt style? Fusion? I didn't know that had dark theme awareness.

In any case, you're definitely not on a non default theme. I suspect you're using a Qt style that's badly emulating gnome adwaita's dark mode or something.

You can switch to the night mapping theme, that'll hardcode Qt style to fusion.

timlinux commented 2 years ago

hi @nirvn yes it is already on fusion and the UI theme at the moment is default. I can switch to Night Mapping (see below) but I think that kinda bypasses the problem: When users have a dark theme active on their desktop parts of QGIS are unreadable / very poorly readable.

When I switch to night mapping, it does indeed provide readable labels in the list widget. I wonder if we could somehow detect that a user is in dark mode and enable dark mapping? Though I guess that will break other cases where they have a custom Qt theme active....

image

timlinux commented 2 years ago

image

Here is another issue (using night mapping), any black icons are not visible in the list. I guess this might be the same problem in the regular theme when colours are inverted.......

nyalldawson commented 2 years ago

@timlinux

Here is another issue (using night mapping), any black icons are not visible in the list. I guess this might be the same problem in the regular theme when colours are inverted.......

Right. I think we need a generic approach to handle this, as I also get frustrated with "invisible" white symbols in the list on light themes!

timlinux commented 2 years ago

image

Thanks for the fixes @nyalldawson, I am reopening because I found another one! (referring to the buttons above).

timlinux commented 2 years ago

imagem

Found another one!

nyalldawson commented 2 years ago

@timlinux are you sure there's actually text there?

Urf, I am a dummy!

timlinux commented 2 years ago

imagem

timlinux commented 2 years ago

Here is another, maybe more tricky one, @nyalldawson, @nirvn

When a layer is not selected:

image

When a layer is selected:

image

The colour for the symbol swatch changes which makes it pretty misleading. Not sure if this happens in light mode...

timlinux commented 2 years ago

Ohh I am running out of dark theme issues now @nyalldawson thanks for all the little tweaks! Once the Expressions icon is updated I think things are generally pretty usable in dark mode. I will reopen if I find more little gotchas. Will comment on the icon theme over on the PR.

timlinux commented 2 years ago

image

Just when we thought dark theme was usable eh? Tooltips everywhere are unreadable in dark mode....

nirvn commented 2 years ago

@timlinux , I'm on it.

timlinux commented 2 years ago

image

There is always one more thing eh? This time I noticed the indicator icons are unreable...

nirvn commented 2 years ago

I'm a tiny bit on the edge with this one. I think we have to make sure we respect the spirit of a dark theme (vs. high contrast). We can probably add halos like what you see on the playback button here. I just want to keep sure we consciously think of a dark themed look vs. a high contrast black on white look :)

nyalldawson commented 2 years ago

@nirvn I think that one can ONLY be solved by doing a symbolic color replacement. It's actually the most straightforward of them, since those icons are already monochrome...

rbovard commented 2 years ago

There are also readability issues on some widgets (calendar, drop down, numeric, etc.) in the forms in read-only:

image

With the editing mode activated, it's all good:

image

edurojasr commented 1 year ago

for me the the dark text is in the drop down menu

Screenshot from 2022-10-24 17-57-57

Geojim commented 1 year ago

Ditto, drop downs went dark for me from 3.22.10 to 3.22.12

nirvn commented 1 year ago

The night mapping dark menu text has been fixed, will be available in the next point release.

WhitespaceQ commented 1 year ago

Ditto, I can confirm regression on 3.22.12.

pesilva93 commented 1 year ago

Ditto, menu text has been dark and unreadable for me on 3.22.12 and 3.28.0

gubuntu commented 1 year ago

This has been an issue for me through several QGIS versions (this example from 3.28) on Mac. The Mac is set to switch to Night Shift at sunset. QGIS is set to Fusion style, default theme.

If QGIS is open when the Mac switches to NightShift, it tries unsuccessfully to go into NightMapping: Screenshot 2022-11-15 at 19 48 20

The above is unusable so I have to restart QGIS after which it looks great: Screenshot 2022-11-15 at 19 56 01

soraimperial commented 1 year ago

I had never had any issue with night mapping on other versions of QGIS (using since 3.14, I think), and after updating from 3.26 to 3.28 last week, now I have this issue:

image

I'm on Win10 with dark mode, but it had never been an issue so far, everything always readable. I've tried restarting QGIS and even changing the style and ui theme and doesn't solve it.

image

VWO97 commented 1 year ago

Here is a fix/workaround that worked for me to fix the drop down menus having black text. explorer_KvYcloDCh9 Code_oGBqtsgGS8

nicogodet commented 1 year ago

The night mapping dark menu text has been fixed, will be available in the next point release.

@nirvn Should this issue be closed ?

rbovard commented 1 year ago

Does it also fix the widget rendering, as described here https://github.com/qgis/QGIS/issues/47065#issuecomment-1070834934 ?

nicogodet commented 1 year ago

@rbovard If you can, could you try a nightly build ?

rbovard commented 1 year ago

@rbovard If you can, could you try a nightly build ?

I can try ~next week~, I'll keep you posted.

AlisterH commented 1 year ago

If this ticket is being left open for any similar problems to be reported: Elevation Profile axis labels are unreadable using night mapping: image EDIT: there are various other places in QGIS with the same problem of illegible black text on the dark background: image

AlisterH commented 1 year ago

Also see #49775

AlisterH commented 1 year ago

Another issue with night mapping is that spinboxes or whatever these things are have some sort of internal border, which cuts off the bottom of the text: image

AlisterH commented 1 year ago

In night mapping there also isn't enough contrast in the Processing Model Designer - all the linkages and in/out information aren't legible enough: image EDIT: perhaps this is really the same issue as rbovard pointed out; there are various places in QGIS with text in that colour on the dark background.

rbovard commented 1 year ago

@rbovard If you can, could you try a nightly build ?

@nicogodet I just tried 3.29.0-Master and the issue on read-only widgets (calendar, drop down, numeric, etc.) is still here.

AlisterH commented 1 year ago

... EDIT: there are various other places in QGIS with the same problem of illegible black text on the dark background ...

One place is progress bars: image

nirvn commented 1 year ago

Any objections for me to close this issue in favor of people re-opening issues to cover individual incompatibilities?

This PR (https://github.com/qgis/QGIS/pull/54078) as well as other commits pushed in the last week have fixed the majority of issues raised here.

nyalldawson commented 1 year ago

@nirvn I think that makes sense!

AlisterH commented 1 year ago

I know it's currently closed, but is there any chance someone could look at pull request #52971, which addresses #49775? Or do I need to open a new one?