Opened 5 years ago
Last modified 4 years ago
#19819 new defect
Issues with dark modes
Reported by: | Klumbumbus | Owned by: | DevCharly |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Plugin flatlaf | Version: | |
Keywords: | dark mode color | Cc: | DevCharly |
Description (last modified by )
This is a collection of issues with dark mode, especially with FlatLaf Dark, reported before on different places. The reason might be in JOSM core, the FlatLaf plugin or the FlatLaf Laf itself.
- The text in the status bar is nearly unreadable --> see 3rd screenshot in #19027 (https://i.ibb.co/crH9GbP/Snag-27625a08.png)
- Similar issue with info box message about new mails in the bottom left corner screenshot.
- Blue links are hard to read --> ticket:19027#comment:24
- Boolean values with icons in menus are hard to see if checked or unchecked --> attachment:check_boxes_dark_mode.png (Windows LaF for comparison on the right, original reported in #19785)
- The warning message in the upload dialog looks not good (light orange background color) --> attachment:upload_dark_mode.png (original reported as facebook comment)
- General issue with too light background colors (done: [35704/osm])
- skyper on #19027 comment 23:
Think all background colors, except blue, of boxes like in relation manager and history viewer could be darker at least two of the three colors. Would prefer a darker red and yellow/orange leaving the green lighter for color-bind users (screenshot).
- skyper on #19027 comment 23:
Attachments (13)
Change History (59)
by , 5 years ago
Attachment: | check_boxes_dark_mode.png added |
---|
by , 5 years ago
Attachment: | upload_dark_mode.png added |
---|
comment:1 by , 5 years ago
comment:2 by , 5 years ago
Keywords: | dark mode added |
---|
by , 5 years ago
Attachment: | josm_history_dark_mode.png added |
---|
screenshot of history viewer in dark mode
comment:4 by , 5 years ago
Keywords: | color added |
---|
comment:6 by , 5 years ago
I've attached a patch to fix the text color in the status bar: attachment:JOSM-statusbar-foreground-fix.diff
There are actually two issues:
- there are background and foreground colors for status bar defined in "Preferences > Display settings > Colors", but only background color is used
- when changing those colors in Preferences dialog, the status bar colors are not updated because checking for a wrong key prefix
comment:7 by , 5 years ago
I've attached a patch that fixes the blue links in various dialogs and in help browser.
attachment:JOSM-FlatLaf-blue-links-fix.diff
The solution is to use UIManager.getColor("Component.linkColor")
to get a link color from the current look and feel.
If not available, use the default color (blue).
by , 5 years ago
Attachment: | JOSM-FlatLaf-blue-links-fix.diff added |
---|
fix blue links (updated to use ColorHelper.color2html())
by , 5 years ago
Attachment: | JOSM-NamedColor-from-Laf.diff added |
---|
allow class NamedColorProperty to get a default color from the current look and feel
by , 5 years ago
Attachment: | OSM-FlatLaf-plugin-NamedColors.diff added |
---|
FlatLaf plugin: define some named colors for validation, status bar, etc
by , 5 years ago
Attachment: | upload_dark_mode_fixed.png added |
---|
follow-up: 18 comment:8 by , 5 years ago
I've attached two patches that support dark (LaF provided) default colors for named colors.
attachment:JOSM-NamedColor-from-Laf.diff
attachment:OSM-FlatLaf-plugin-NamedColors.diff
JOSM "named colors" use class NamedColorProperty
and have hard coded default color for light LaFs.
They can be changed in "Preferences > Display settings > Colors".
There is no way to have different colors for light and dark LaFs in class NamedColorProperty
.
So the idea to solve this simply is to first ask the Laf (with UIManager.getColor(key)
) for a default color.
If the Laf does not provide on, use the hard coded default color.
This is what attachment:JOSM-NamedColor-from-Laf.diff does.
Second part it to define dark colors in FlatLaf plugin: attachment:OSM-FlatLaf-plugin-NamedColors.diff
It works good, but maybe you core developers have a better idea/solution?
I've added a few colors for validation, status bar and imagery. This fixes the "Upload" dialog, makes the status bar darker and fixes the too bright green in tables in "Preferences > Imagery preferences > Imagery providers" dialog.
The screenshot shows also fixed link colors from patch attachment:JOSM-FlatLaf-blue-links-fix.diff
I'll provide a patch for the double borders on some combo boxes soon...
follow-up: 10 comment:9 by , 4 years ago
Summary: | Issues with dark modes → [patch] Issues with dark modes |
---|
Thx for the patches.
comment:10 by , 4 years ago
comment:17 by , 4 years ago
Description: | modified (diff) |
---|
comment:18 by , 4 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Replying to DevCharly:
…
I'll provide a patch for the double borders on some combo boxes soon...
Not all issues are fixed, yet.
follow-up: 20 comment:19 by , 4 years ago
I had to disable and then reenable the plugin to get the status bar correct. The upload dialog still did not change at all for me. Do I have to set the correct colors manually?
Relative:URL: ^/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2020-10-09 18:53:24 +0200 (Fri, 09 Oct 2020) Revision:17137 Build-Date:2020-10-10 01:30:48 URL:https://josm.openstreetmap.de/svn/trunk Identification: JOSM/1.5 (17137 en) Linux Debian GNU/Linux 10 (buster) Java version: 11.0.8+10-post-Debian-1deb10u1, Debian, OpenJDK 64-Bit Server VM Look and Feel: com.formdev.flatlaf.FlatDarculaLaf Screen: :0.0 1366x768 (scaling 1.0x1.0) Desktop environment: GNOME Java package: openjdk-11-jre:amd64-11.0.8+10-1~deb10u1 Plugins: + flatlaf (35572)
follow-up: 21 comment:20 by , 4 years ago
Replying to skyper:
The upload dialog still did not change at all for me. Do I have to set the correct colors manually?
No, but maybe reset them.
The update dialog uses named colors that you can change in "Preferences > Display Settings > Colors".
Search for "input validation".
If you have changed one of the 5 colors, then reset them.
A restart seems to be necessary too.
comment:21 by , 4 years ago
Replying to DevCharly:
Replying to skyper:
The upload dialog still did not change at all for me. Do I have to set the correct colors manually?
No, but maybe reset them.
The update dialog uses named colors that you can change in "Preferences > Display Settings > Colors".
Search for "input validation".
If you have changed one of the 5 colors, then reset them.
A restart seems to be necessary too.
I had not changed the preferences.
I played around with the settings and the change of Input validation: warning
does not do anything. Input validation: warning background
and Input validation:valid
work.
It would be nice to get the dialog about "needed restart" if you change the colors.
by , 4 years ago
Attachment: | JOSM-FlatLaf-validation-border.diff added |
---|
fix combobox validation borders
by , 4 years ago
Attachment: | FlatLaf-validation-border.png added |
---|
comment:23 by , 4 years ago
I've attached another patch that fixes the double combobox borders and missing background when using validation:
attachment:JOSM-FlatLaf-validation-border.diff
The reason for the double border was that the combobox has a border and additionally JOSM assigns another line border to the text field within the combobox.
FlatLaf supports border coloring out-of-the-box via client property. Setting text field border is not necessary.
See https://github.com/JFormDesigner/FlatLaf/releases/tag/0.35
The validation background assigned by JOSM to the text field was not painted because the field is not opaque.
Solution is to assign the background color to the combobox.
comment:24 by , 4 years ago
That's no proper patch. JOSM code must not be modified for specific plugins. Find a generic solution instead.
by , 4 years ago
Attachment: | OSM-FlatLaf-plugin-outline.diff added |
---|
comment:25 by , 4 years ago
That's no proper patch. JOSM code must not be modified for specific plugins. Find a generic solution instead.
Yes, I understand that.
I've attached a new patch that only changes the flatlaf plugin: attachment:OSM-FlatLaf-plugin-outline.diff
follow-up: 27 comment:26 by , 4 years ago
Anything wrong with the patch or just forgotten?
@DevCharly
Thanks for your improvements.
I still have to fiddle around with all the background colors for relation manager, history viewer and conflict manager. Are there any chances to ship better default colors for FlatDarkLaf
? Many thanks in advance.
follow-up: 28 comment:27 by , 4 years ago
Replying to skyper:
Anything wrong with the patch or just forgotten?
Don't know.
Would it be possible to give me SVN commit access
so that I can update the flatlaf plugin myself?
@DevCharly
I still have to fiddle around with all the background colors for relation manager, history viewer and conflict manager. Are there any chances to ship better default colors forFlatDarkLaf
?
I'll have a look...
follow-up: 29 comment:28 by , 4 years ago
Dirk?
Replying to DevCharly:
Would it be possible to give me SVN commit access
so that I can update the flatlaf plugin myself?
comment:29 by , 4 years ago
Replying to DevCharly:
Would it be possible to give me SVN commit access
so that I can update the flatlaf plugin myself?
Done. Please try.
comment:31 by , 4 years ago
@DevCharly:
I think, you need to add the new plugin .jar file, manually. There is no automatism for the task, so far. ATM, [35679/osm] with [35680/osm] is the latest available version.
comment:32 by , 4 years ago
@skyper
Thanks for the reminder.
I know.
Just wanted to fix some more colors before building the jar.
Will work on this later today...
comment:38 by , 4 years ago
@skyper I've checked in a new build of the flatlaf plugin jar.
It works fine in my development environment (Eclipse)
but not when running pre-built JOSM.
There is a problem with classloaders.
JOSM uses two different classloaders
- for load plugin and
- for look and feel initialization
This prevents that FlatLaf finds the .properties files in the plugin.
Tried to workaround this without success.
I'll open a ticket...
comment:42 by , 4 years ago
Summary: | [patch] Issues with dark modes → Issues with dark modes |
---|
comment:43 by , 4 years ago
Description: | modified (diff) |
---|
comment:44 by , 4 years ago
Description: | modified (diff) |
---|
comment:45 by , 4 years ago
Description: | modified (diff) |
---|
comment:46 by , 4 years ago
Owner: | changed from | to
---|---|
Status: | reopened → new |
Ticket #19785 has been marked as a duplicate of this ticket.