Modify

Opened 5 weeks ago

Last modified 11 days ago

#19819 reopened defect

[patch] Issues with dark modes

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.

Attachments (10)

check_boxes_dark_mode.png (93.1 KB) - added by Klumbumbus 5 weeks ago.
upload_dark_mode.png (28.7 KB) - added by Klumbumbus 5 weeks ago.
josm_new_mail_info.png (8.2 KB) - added by skyper 5 weeks ago.
screenshot of info box
josm_history_dark_mode.png (86.0 KB) - added by skyper 5 weeks ago.
screenshot of history viewer in dark mode
JOSM-statusbar-foreground-fix.diff (2.2 KB) - added by DevCharly 5 weeks ago.
fix text color in status bar
JOSM-FlatLaf-blue-links-fix (3.5 KB) - added by DevCharly 5 weeks ago.
fix blue links
JOSM-FlatLaf-blue-links-fix.diff (3.8 KB) - added by DevCharly 4 weeks ago.
fix blue links (updated to use ColorHelper.color2html())
JOSM-NamedColor-from-Laf.diff (1.5 KB) - added by DevCharly 4 weeks ago.
allow class NamedColorProperty to get a default color from the current look and feel
OSM-FlatLaf-plugin-NamedColors.diff (2.7 KB) - added by DevCharly 4 weeks ago.
FlatLaf plugin: define some named colors for validation, status bar, etc
upload_dark_mode_fixed.png (57.5 KB) - added by DevCharly 4 weeks ago.

Download all attachments as: .zip

Change History (31)

Changed 5 weeks ago by Klumbumbus

Attachment: check_boxes_dark_mode.png added

Changed 5 weeks ago by Klumbumbus

Attachment: upload_dark_mode.png added

comment:1 Changed 5 weeks ago by Klumbumbus

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

comment:2 Changed 5 weeks ago by Klumbumbus

Keywords: dark mode added

Changed 5 weeks ago by skyper

Attachment: josm_new_mail_info.png added

screenshot of info box

Changed 5 weeks ago by skyper

Attachment: josm_history_dark_mode.png added

screenshot of history viewer in dark mode

comment:3 Changed 5 weeks ago by skyper

Description: modified (diff)

add more color issues

comment:4 Changed 5 weeks ago by skyper

Keywords: color added

comment:5 Changed 5 weeks ago by Klumbumbus

In 17043/josm:

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

Changed 5 weeks ago by DevCharly

fix text color in status bar

comment:6 Changed 5 weeks ago by DevCharly

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 4 weeks ago by DevCharly (previous) (diff)

comment:7 Changed 5 weeks ago by DevCharly

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 4 weeks ago by DevCharly (previous) (diff)

Changed 5 weeks ago by DevCharly

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

fix blue links

Changed 4 weeks ago by DevCharly

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

Changed 4 weeks ago by DevCharly

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

Changed 4 weeks ago by DevCharly

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

Changed 4 weeks ago by DevCharly

Attachment: upload_dark_mode_fixed.png added

comment:8 Changed 4 weeks ago by DevCharly

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 Changed 4 weeks ago by Klumbumbus

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

Thx for the patches.

comment:10 in reply to:  9 Changed 2 weeks ago by skyper

Replying to Klumbumbus:

Thx for the patches.

Any problems? Can the patches be applied?

comment:11 Changed 13 days ago by simon04

In 17116/josm:

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

comment:12 Changed 13 days ago by simon04

In 17117/josm:

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

comment:13 Changed 13 days ago by simon04

In 17118/josm:

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

comment:14 Changed 13 days ago by simon04

In 17119/josm:

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

comment:15 Changed 13 days ago by simon04

Resolution: fixed
Status: newclosed

In 35572/osm:

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

comment:16 Changed 13 days ago by simon04

DevCharly, thank you for the patches – highly appreciated!

comment:17 Changed 13 days ago by Klumbumbus

Description: modified (diff)

comment:18 in reply to:  8 Changed 13 days ago by skyper

Resolution: fixed
Status: closedreopened

Replying to DevCharly:


I'll provide a patch for the double borders on some combo boxes soon...

Not all issues are fixed, yet.

comment:19 Changed 11 days ago by skyper

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)
Last edited 11 days ago by skyper (previous) (diff)

comment:20 in reply to:  19 ; Changed 11 days ago by 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.

comment:21 in reply to:  20 Changed 11 days ago by skyper

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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as reopened The owner will remain simon04.
as The resolution will be set.
to The owner will be changed from simon04 to the specified user.
The owner will change to Klumbumbus
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.