Title pane improvements (Windows 10 only) #268
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR brings some improvements to the title pane used in (native) custom window decorations:
Right aligned components in title pane with embedded menu bar
A usual way to add a component to the right side of the menu bar is to first add a horizontal glue component (
Box.createHorizontalGlue()
) and then the own component. In a non-embedded menu bar it looks like this:With this PR, this also works for embedded menu bars:
Example for adding own component to right side of menu bar:
Window title now centered within window bounds
New: title centered between window bounds:
Old: title centered between menu bar and window buttons:
Left aligned title with embedded menu bar
Optionally left align title when menu bar is embedded:
Enable with:
Center title
Optionally center title when menu bar is not embedded:
Enable with:
Unified backgrounds
To give your app an even more modern look, you can now use unified backgrounds for window title bar, menu bar and main content. This is similar to what IntelliJ IDEA does.
Enable with:
You can try this in the FlatLafDemo app with "Options > Unified Title Bar".