Modify

Opened 6 months ago

Closed 3 weeks ago

Last modified 24 hours ago

#19027 closed enhancement (fixed)

FlatLaf dark and light look and feels

Reported by: DevCharly Owned by: simon04
Priority: normal Milestone:
Component: Plugin flatlaf Version:
Keywords: Cc:

Description

(crosspost of https://forum.openstreetmap.org/viewtopic.php?id=69029)

Hello,

I'm the author of the FlatLaf look and feel (https://github.com/JFormDesigner/FlatLaf)
and wanted to ask whether the JOSM community is interested in using FlatLaf in JOSM.

FlatLaf is a new modern open-source L&F that looks similar to Darcula/IntelliJ
themes you maybe know from IntelliJ IDEA. It comes with dark and light themes,
supports 3rd party IntelliJ themes, scales on HiDPI displays, runs on all
platforms (Windows, Linux and macOS), uses Mac platform specific key bindings on
macOS and is easy to integrate into existing Swing applications.

While FlatLaf is still young, there are already a lot of applications using it.
Most prominent is NetBeans 11.3.

Here are some screenshots of JOSM running with FlatLaf:

https://i.ibb.co/MPTmLcp/Snag-276259f8.png

https://i.ibb.co/gRRkTWh/Snag-27628415.png

https://i.ibb.co/crH9GbP/Snag-27625a08.png

https://i.ibb.co/KhNq7g0/Snag-276283c7.png

https://i.ibb.co/9gjPcTL/Snag-276283f6.png

https://i.ibb.co/93Sth5Y/Snag-27625a36.png

If there is interest in using FlatLaf in JOSM, I'm willing to integrate it,
fix FlatLaf related issues and submit SVN patches.

JOSM with FlafLaf Dark requires some minor color adjustments where hardcoded
colors are used in JOSM UI components.

I'll attach the patch used to create the screenshots to this ticket.

Thanks,
Karl

Attachments (2)

JOSM FlatLaf patch 1.diff (2.1 KB) - added by DevCharly 6 months ago.
JOSM-Hilfeanzeiger.png (79.4 KB) - added by Klumbumbus 2 weeks ago.

Download all attachments as: .zip

Change History (29)

Changed 6 months ago by DevCharly

Attachment: JOSM FlatLaf patch 1.diff added

comment:1 Changed 6 months ago by simon04

The JAR file is 290 kB -- https://mvnrepository.com/artifact/com.formdev/flatlaf/0.28

It might be a good candidate for a plugin.

comment:2 Changed 6 months ago by stoecker

Component: CorePlugin

Long years we had the plastic_laf, maybe that can be used as base for a new plugin. I also think this is good as plugin. It's nothing for the core.

comment:4 Changed 6 months ago by DevCharly

OK, then I'll create a plugin.
Thanks for the link to the plastic_laf plugin.

comment:5 Changed 4 months ago by simon04

[o35482] - see #josm19027 - Add flatlaf plugin

However, due to r16498, even the early plugins are loaded too late (since setupUIManager is called before). I'm unsure when to load LaF plugins – ideally those would be loaded even early (before setupUIManager)…

comment:6 Changed 4 months ago by skyper

Plugin does not show up under Plugins, yet.

Last edited 4 months ago by skyper (previous) (diff)

comment:7 Changed 3 months ago by skyper

I`d like to test the plugin but it is not listed under Plugins and therefore not available under preferences.

Is there something missing ?

comment:8 Changed 3 months ago by simon04

Due to the problem mentioned in comment:5 (see also: ticket:19290#comment:5 et seq.), I haven't build a flatlaf.jar yet.

comment:9 Changed 3 weeks ago by simon04

In 16974/josm:

see #19027, see #19290 - PluginHandler.loadVeryEarlyPlugins for plugins providing a LookAndFeel

comment:10 Changed 3 weeks ago by simon04

Owner: changed from team to simon04
Status: newassigned

comment:11 Changed 3 weeks ago by simon04

In 35535/osm:

see #19027 - Update to flatlaf 0.40

comment:12 Changed 3 weeks ago by simon04

In 35536/osm:

see #19027 - Specify negative plugin.stage for very early loading

comment:13 Changed 3 weeks ago by simon04

comment:14 Changed 3 weeks ago by simon04

Resolution: fixed
Status: assignedclosed

In 35538/osm:

fix #19027 - dist flatlaf.jar

comment:15 Changed 3 weeks ago by Klumbumbus

How do I set the look and feel after installing the plugin? I can't find anything new in the preferences under wiki:/Help/Preferences/Display#LookAndFeel or somewhere else.

comment:16 in reply to:  15 ; Changed 3 weeks ago by skyper

Replying to Klumbumbus:

How do I set the look and feel after installing the plugin? I can't find anything new in the preferences under wiki:/Help/Preferences/Display#LookAndFeel or somewhere else.

I got it working by setting the proper value in advanced preferences for laf. Values are described here.

Guess a proper Gui integration to have the four values listed together with the default ones under Display Settings -> Look and Feel is needed.

Last edited 3 weeks ago by skyper (previous) (diff)

comment:17 in reply to:  16 Changed 3 weeks ago by Klumbumbus

Replying to skyper:

I got it working by setting the proper value in advanced preferences for laf. Values are described here.

Thx, that worked.

Guess a proper Gui integration to have the four values listed together with the default ones under Display Settings -> Look and Feel is needed.

Yes that would be useful. Can you add that Simon?

comment:18 Changed 3 weeks ago by DevCharly

Have not tried it, but I think the recent change in [35535/osm]
is responsible for not showing FlatLaf in the UI.

Those FlatLaf.install() methods invoke UIManager.setLookAndFeel(),
but invocation of UIManager.installLookAndFeel() is needed to show FlatLaf in the list of available LaFs in the UI.

comment:19 Changed 3 weeks ago by simon04

In 35541/osm:

see #19027 - Use UIManager.installLookAndFeel

comment:20 Changed 3 weeks ago by simon04

In 35542/osm:

see #19027 - dist flatlaf.jar

comment:21 Changed 3 weeks ago by simon04

@DevCharly, thanks for your invesitations. Should be fixed now (after updating the plugin).

JOSM running with GDK_SCALE=3 (HiDPI w/ 300%) and FlatLaf Light is a piece of art. :-)

comment:22 Changed 2 weeks ago by Klumbumbus

The dark mode is great!

One thing I noticed: The text in the status bar is nearly unreadable which can be seen in the third screenshot of the ticket description.

Last edited 2 weeks ago by Klumbumbus (previous) (diff)

comment:23 in reply to:  22 Changed 2 weeks ago by skyper

Replying to Klumbumbus:

The dark mode is great!

+1
Yes, thanks for this plugin.

One thing I noticed: The text in the status bar is nearly unreadable which can be seen in the third screenshot of the ticket description.

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.

comment:24 Changed 2 weeks ago by Klumbumbus

The blue links are hard to read too, imho. See preferences -> plugins or the help browser.


URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2020-09-03 22:12:24 +0200 (Thu, 03 Sep 2020)
Build-Date:2020-09-04 01:30:50
Revision:17007
Relative:URL: ^/trunk

Identification: JOSM/1.5 (17007 de) Windows 10 64-Bit
OS Build number: Windows 10 Pro 1909 (18363)
Memory Usage: 820 MB / 1820 MB (536 MB allocated, but free)
Java version: 1.8.0_261-b12, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Look and Feel: com.formdev.flatlaf.FlatDarkLaf
Screen: \Display0 1680x1050 (scaling 1.0x1.0)
Maximum Screen Size: 1680x1050
Best cursor sizes: 16x16 -> 32x32, 32x32 -> 32x32
VM arguments: [-Djava.security.manager, -Djava.security.policy=file:<java.home>\lib\security\javaws.policy, -DtrustProxy=true, -Djnlpx.home=<java.home>\bin, -Djnlpx.origFilenameArg=C:\Program Files (x86)\josm-latest.jnlp, -Djnlpx.remove=false, -Djava.util.Arrays.useLegacyMergeSort=true, -Djnlpx.heapsize=NULL,2048m, -Djnlpx.splashport=60157, -Djnlpx.jvm=<java.home>\bin\javaw.exe]
Last edited 2 weeks ago by Klumbumbus (previous) (diff)

Changed 2 weeks ago by Klumbumbus

Attachment: JOSM-Hilfeanzeiger.png added

comment:26 Changed 25 hours ago by Klumbumbus

Component: PluginPlugin flatlaf

comment:27 Changed 24 hours ago by Klumbumbus

follow up in #19819

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain simon04.
as The resolution will be set.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.