Modify

Opened 3 years ago

Closed 3 years ago

Last modified 3 years 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 3 years ago.
JOSM-mainFrame-updateUI-off.png (28.1 KB ) - added by DevCharly 3 years ago.
JOSM-mainFrame-updateUI-on.png (27.7 KB ) - added by DevCharly 3 years ago.
r17702.PNG (77.0 KB ) - added by GerdP 3 years ago.
r18004.PNG (102.0 KB ) - added by GerdP 3 years ago.

Download all attachments as: .zip

Change History (14)

by DevCharly, 3 years ago

by DevCharly, 3 years ago

by DevCharly, 3 years ago

comment:1 by DevCharly, 3 years ago

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 3 years ago by skyper (previous) (diff)

comment:2 by DevCharly, 3 years ago

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

comment:3 by GerdP, 3 years ago

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

comment:4 by DevCharly, 3 years ago

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

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

comment:6 by simon04, 3 years ago

Resolution: fixed
Status: assignedclosed

In 17796/josm:

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

comment:7 by GerdP, 3 years ago

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

by GerdP, 3 years ago

Attachment: r17702.PNG added

by GerdP, 3 years ago

Attachment: r18004.PNG added

comment:8 by GerdP, 3 years ago

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

Version 0, edited 3 years ago by GerdP (next)

comment:9 by GerdP, 3 years ago

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. 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.