Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#19819 new defect (fixed)

[patch] Issues with dark modes — at Version 17

Reported by: Klumbumbus Owned by: simon04
Priority: normal Milestone:
Component: Plugin flatlaf Version:
Keywords: dark mode color Cc: DevCharly

Description (last modified by Klumbumbus)

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.

Change History (27)

by Klumbumbus, 5 years ago

Attachment: check_boxes_dark_mode.png added

by Klumbumbus, 5 years ago

Attachment: upload_dark_mode.png added

comment:1 by Klumbumbus, 5 years ago

Ticket #19785 has been marked as a duplicate of this ticket.

comment:2 by Klumbumbus, 5 years ago

Keywords: dark mode added

by skyper, 5 years ago

Attachment: josm_new_mail_info.png added

screenshot of info box

by skyper, 5 years ago

Attachment: josm_history_dark_mode.png added

screenshot of history viewer in dark mode

comment:3 by skyper, 5 years ago

Description: modified (diff)

add more color issues

comment:4 by skyper, 5 years ago

Keywords: color added

comment:5 by Klumbumbus, 5 years ago

In 17043/josm:

see #19819 - Make the toolbar preferences icon work better for different look and feels

by DevCharly, 5 years ago

fix text color in status bar

comment:6 by DevCharly, 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:

  1. there are background and foreground colors for status bar defined in "Preferences > Display settings > Colors", but only background color is used
  2. when changing those colors in Preferences dialog, the status bar colors are not updated because checking for a wrong key prefix
Last edited 5 years ago by DevCharly (previous) (diff)

comment:7 by DevCharly, 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).

Last edited 5 years ago by DevCharly (previous) (diff)

by DevCharly, 5 years ago

Attachment: JOSM-FlatLaf-blue-links-fix added

fix blue links

by DevCharly, 5 years ago

fix blue links (updated to use ColorHelper.color2html())

by DevCharly, 5 years ago

allow class NamedColorProperty to get a default color from the current look and feel

by DevCharly, 5 years ago

FlatLaf plugin: define some named colors for validation, status bar, etc

by DevCharly, 5 years ago

Attachment: upload_dark_mode_fixed.png added

comment:8 by DevCharly, 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...

comment:9 by Klumbumbus, 5 years ago

Summary: Issues with dark modes[patch] Issues with dark modes

Thx for the patches.

in reply to:  9 comment:10 by skyper, 5 years ago

Replying to Klumbumbus:

Thx for the patches.

Any problems? Can the patches be applied?

comment:11 by simon04, 5 years ago

In 17116/josm:

see #19819 - MapStatus: make color preferences work (patch by DevCharly)

comment:12 by simon04, 5 years ago

In 17117/josm:

see #19819 - Obtain link color using UIManager (patch by DevCharly)

comment:13 by simon04, 5 years ago

In 17118/josm:

see #19819 - NamedColorProperty: obtain fallback color using UIManager (patch by DevCharly)

comment:14 by simon04, 5 years ago

In 17119/josm:

see #19819 - NamedColorProperty: update Javadoc, add unit test

comment:15 by simon04, 5 years ago

Resolution: fixed
Status: newclosed

In 35572/osm:

fix #19819 - FlatLaf: specify/override colors (patch by DevCharly)

comment:16 by simon04, 5 years ago

DevCharly, thank you for the patches – highly appreciated!

comment:17 by Klumbumbus, 5 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.