Modify

Opened 4 months ago

Closed 4 months ago

Last modified 4 weeks ago

#19290 closed defect (fixed)

[PATCH] Look and feel is not loaded before showing splash screen

Reported by: hiddewie Owned by: team
Priority: minor Milestone: 20.05
Component: Core Version:
Keywords: laf, look an feel, splash screen, initialization Cc:

Description

The splash screen shows the default system Java look and feel, not the configured look and feel. The configured look and feel is set during startup in MainApplication#setupUIManager, which happens before the application starts but after the splash screen is shown.

This patch sets up the UI manager before the splash screen is shown, such that the splash screen gets the configured look and feel. The configuration has already been loaded at that point.

Attachments (3)

#19290_--_Splash_screen_with_look_and_feel.patch (1008 bytes) - added by hiddewie 4 months ago.
Screenshot from 2020-05-24 21-41-42.png (84.5 KB) - added by hiddewie 4 months ago.
Before: splash screen has Java look and feel
Screenshot from 2020-05-24 21-40-57.png (90.6 KB) - added by hiddewie 4 months ago.
With patch: configured look and feel

Download all attachments as: .zip

Change History (12)

Changed 4 months ago by hiddewie

Before: splash screen has Java look and feel

Changed 4 months ago by hiddewie

With patch: configured look and feel

comment:1 Changed 4 months ago by hiddewie

Summary: Look and feel is not loaded before showing splash screen[PATCH] Look and feel is not loaded before showing splash screen

comment:2 Changed 4 months ago by simon04

Resolution: fixed
Status: newclosed

In 16498/josm:

fix #19290 - Configure Look and feel before showing splash screen (patch by hiddewie)

comment:3 Changed 4 months ago by simon04

Keywords: laf look an feel splash screen initialization added
Milestone: 20.05

Nice catch, thank you!

Which LaF are you using in the screenshot?

comment:4 Changed 4 months ago by hiddewie

I am using the GTK+ look and feel in Ubuntu 20.04 with dark mode enabled.

comment:5 Changed 4 months ago by simon04

This patch broke plugins providing a Look and Feel, see ticket:19027#comment:5. At the time of applying this patch, we haven't had any LaF plugins. The flatlaf is a plugin candidate now.

comment:6 Changed 4 months ago by hiddewie

Would leveraging a ServiceProvider be an option for plugins providing a Look and Feel?

The UI manager could call the ServiceLoader which could preload classes which implement a look and feel provider interface, before calling plugins on the module path that interact with the actual application.

comment:7 Changed 4 months ago by simon04

Using a ServiceLoader could work. However, this would open a completely separate way of defining/loading plugins (which is currently done via org.openstreetmap.josm.plugins.PluginHandler#loadPlugins and various entries in plugin's META-INF/MANIFEST.MF).

We could use negative Plugin-Stage values for plugins which need to be loaded before setupUIManager

comment:8 Changed 4 months ago by hiddewie

That is definitely an option which fits in the current plugin strategy.

Leveraging the ServiceLoader mechanism could provide a modern way to develop plugins against a JOSM defined interface (and even multiple interfaces providing plugins/configuration for multiple 'things'). Maybe the ServiceLoader method could be provided along the current method of providing plugins. The advantage is that the plugin developer would implement an (JOSM defined) interface that loads/configures the plugin. This might also be a disadvantage because backwards compatibility with the Plugin interface could be broken in the future, while the manifest text file is always parsable in some form. On the other hand, it is also an extra method to do the same thing (loading/configuring a plugin) which has to be maintained.

comment:9 Changed 4 weeks ago by simon04

In 16974/josm:

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
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.