Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change TitleBar height Windows 10/11 #897

Closed
Frank-99 opened this issue Oct 15, 2024 · 2 comments
Closed

Change TitleBar height Windows 10/11 #897

Frank-99 opened this issue Oct 15, 2024 · 2 comments
Milestone

Comments

@Frank-99
Copy link

Frank-99 commented Oct 15, 2024

I need to make a taller title bar for a specific JFrame in Windows 10/11.
I'd need something along the lines of JRootPane.titleBarHeight or JRootPane.titleBarExtended.
I've seen there is a TitlePane.buttonSize, but I don't think it would do exactly what I need as I think I'm only able to set it via UIManager for all JFrames.

To be more specific, this is the desired effect I'm looking to achieve; a taller title bar that makes the buttons squarer, thus leaving more room for a Profile "button" and a search bar, as seen here in all current Office365 apps design:
image
image

I've also tried to force a custom height on a JMenu button in the integrated title bar menu but the close, minimise and maximise buttons don't expand to fill the new height.
This is exaggerated but it shows well what I mean:
image
image

Is there a way of doing this that I'm missing, or is it just not supported currently? in the latter case, would it be ever supported in a future version?
Thank you in advance

DevCharly added a commit that referenced this issue Oct 17, 2024
DevCharly added a commit that referenced this issue Oct 17, 2024
…Height` to allow specifying a (larger) preferred height for the title bar (issue #897)
@DevCharly
Copy link
Collaborator

fixed/implemented in latest 3.5.2-SNAPSHOT: https://github.com/JFormDesigner/FlatLaf#snapshots

The iconify/maximize/close buttons now always fill whole title bar height.

Also there is a new client property JRootPane.titleBarHeight (or FlatClientProperties.TITLE_BAR_HEIGHT) of type int.

For your use case, I would suggest the use of "full window content" mode (PR #801).
If you use a "buttons placeholder" (see PR #801) and set JRootPane.titleBarHeight,
then the placeholder gets that height as well.
For a nice layout, you could put your top bar into the center of a BorderLayout and the placeholder to the east.

@DevCharly DevCharly added this to the 3.5.2 milestone Oct 17, 2024
@DevCharly
Copy link
Collaborator

FlatLaf 3.5.2 is out now 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants