Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years 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 years ago.
Screenshot from 2020-05-24 21-41-42.png (84.5 KB ) - added by hiddewie 4 years 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 years ago.
With patch: configured look and feel

Download all attachments as: .zip

Change History (12)

by hiddewie, 4 years ago

Before: splash screen has Java look and feel

by hiddewie, 4 years ago

With patch: configured look and feel

comment:1 by hiddewie, 4 years ago

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

comment:2 by simon04, 4 years ago

Resolution: fixed
Status: newclosed

In 16498/josm:

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

comment:3 by simon04, 4 years ago

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 by hiddewie, 4 years ago

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

comment:5 by simon04, 4 years ago

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 by hiddewie, 4 years ago

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 by simon04, 4 years ago

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 by hiddewie, 4 years ago

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 by simon04, 4 years ago

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. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.