Modify

Opened 14 months ago

Closed 13 months ago

Last modified 13 months ago

#20771 closed defect (fixed)

[Patch] MainFrame created before setting look and feel and not updated

Reported by: DevCharly Owned by: simon04
Priority: normal Milestone: 21.04
Component: Core Version:
Keywords: Cc:

Description

In class MainApplication, the main frame is created before the look and feel is set.
And it is not updated after the look and feel have set.

This usually has no visual impact because the only component created before the L&F was set, is the JRootPane of the JFrame.
So the UI delegate of the JRootPane remains MetalRootPaneUI.

But FlatLaf 1.1 supports native window decorations (on Windows 10) and needs FlatRootPaneUI to initialize it.
https://github.com/JFormDesigner/FlatLaf/releases/tag/1.1

To fix this I'd like to suggest to update the mainFrame with following code after setting the L&F:

SwingUtilities.updateComponentTreeUI(mainFrame);

Attachments (5)

JOSM-mainFrame-updateUI.diff (664 bytes) - added by DevCharly 14 months ago.
JOSM-mainFrame-updateUI-off.png (28.1 KB) - added by DevCharly 14 months ago.
JOSM-mainFrame-updateUI-on.png (27.7 KB) - added by DevCharly 14 months ago.
r17702.PNG (77.0 KB) - added by GerdP 13 months ago.
r18004.PNG (102.0 KB) - added by GerdP 13 months ago.

Download all attachments as: .zip

Change History (14)

Changed 14 months ago by DevCharly

Changed 14 months ago by DevCharly

Changed 14 months ago by DevCharly

comment:1 Changed 14 months ago by DevCharly

The patch (and latest flatlaf plugin from today) changes this (on Windows 10):


into this


Window title bar of main frame is dark and menubar is embedded into window title bar.

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

comment:2 Changed 14 months ago by DevCharly

Summary: MainFrame created before setting look and feel and not updated[Patch] MainFrame created before setting look and feel and not updated

comment:3 Changed 14 months ago by GerdP

How does the title bar look when the user name is displayed with preference draw.show-user set to true?

comment:4 Changed 14 months ago by DevCharly

The window title (incl. user name) is shown in the area between the "Help" menu and the minimize button.
If the title is longer, then it is cut-off with "...".
If the window is wider than in the above screenshot, then there is more space for the title.

BTW the screenshots are so large because they were made on a 150% scaled screen.

comment:5 Changed 13 months ago by simon04

Milestone: 21.04
Owner: changed from team to simon04
Status: newassigned

comment:6 Changed 13 months ago by simon04

Resolution: fixed
Status: assignedclosed

In 17796/josm:

fix #20771 - MainFrame created before setting look and feel and not updated (patch by DevCharly)

comment:7 Changed 13 months ago by GerdP

Not sure if this ticket or #20706 caused this, but I see changes on Windows without FlatLaf, too.

Changed 13 months ago by GerdP

Attachment: r17702.PNG added

Changed 13 months ago by GerdP

Attachment: r18004.PNG added

comment:8 Changed 13 months ago by GerdP

My first thought was that r18004 looks worse, not sure why.

Last edited 13 months ago by GerdP (previous) (diff)

comment:9 Changed 13 months ago by GerdP

I think #20706 is to blame. With r17796 I don't see any differences on Windows.

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.