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

8313424: JavaFX controls in the title bar #1605

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
3d19b87
WIP
mstr2 Oct 19, 2024
0ddd63d
doc change
mstr2 Oct 20, 2024
7969622
revert unintended change
mstr2 Oct 20, 2024
a289572
Merge branch 'master' into feature/extended-window
mstr2 Oct 23, 2024
ba02e8f
Improve HeaderBar documentation
mstr2 Oct 24, 2024
f973e8c
improve documentation
mstr2 Oct 25, 2024
f02e7e9
Windows: add system menu
mstr2 Oct 25, 2024
fef8cfc
Windows: custom context menu overrides system menu
mstr2 Oct 26, 2024
778e6c1
GTK: prevent resizing below window button size, fix crash
mstr2 Oct 26, 2024
3b468fe
GTK: add system menu
mstr2 Oct 26, 2024
0526edb
small code changes
mstr2 Oct 28, 2024
95736df
remove unused code
mstr2 Oct 28, 2024
d9c0fe2
Merge branch 'master' into feature/extended-window
mstr2 Oct 28, 2024
c0b588f
set minHeight to native height of title bar
mstr2 Oct 28, 2024
d7f88c3
better documentation
mstr2 Oct 28, 2024
9de4694
macOS: hide window title
mstr2 Oct 28, 2024
cd5d443
improve title text documentation
mstr2 Oct 28, 2024
bc48ae0
fix peer access outside of synchronizer
mstr2 Oct 28, 2024
804d0be
NPE
mstr2 Oct 28, 2024
f5e3121
fix header bar height flicker
mstr2 Oct 28, 2024
1c4ecc1
macOS: dynamically adapt toolbar style to headerbar height
mstr2 Oct 29, 2024
15dc3ff
Merge branch 'master' into feature/extended-window
mstr2 Oct 31, 2024
9b63892
Merge branch 'master' into feature/extended-window
mstr2 Nov 1, 2024
e7febc5
fix mirroring/unmirroring of X coord in win-glass
mstr2 Nov 5, 2024
d1c388b
stylistic changes
mstr2 Nov 5, 2024
8c9fbbd
use CsvSource in HeaderBarTest
mstr2 Nov 5, 2024
3660a29
EMPTY Dimension2D constant
mstr2 Nov 5, 2024
8974c14
HeaderBar changes
mstr2 Nov 5, 2024
ca9b325
refactor performWindowDrag
mstr2 Nov 6, 2024
8e77a22
HeaderBar javadoc change
mstr2 Nov 7, 2024
4336735
WindowControlsOverlay snapping
mstr2 Nov 7, 2024
a9178b7
add system menu documentation
mstr2 Nov 7, 2024
6a16536
Merge branch 'master' into feature/extended-window
mstr2 Nov 7, 2024
65f095e
Merge branch 'master' into feature/extended-window
mstr2 Nov 9, 2024
d5afc7d
Merge branch 'master' into feature/extended-window
mstr2 Nov 14, 2024
26b81b8
remove unneeded dll
mstr2 Nov 14, 2024
003e9d5
macOS: double-click action + fullscreen toolbar
mstr2 Nov 14, 2024
485a9d9
Merge branch 'master' into feature/extended-window
mstr2 Nov 14, 2024
743626f
Merge branch 'master' into feature/extended-window
mstr2 Dec 6, 2024
d9b82c8
Add HeaderBar.overlappingSystemInset property
mstr2 Dec 6, 2024
8649f91
StyleableBooleanProperty -> BooleanProperty
mstr2 Dec 6, 2024
af35dce
Merge branch 'master' into feature/extended-window
mstr2 Dec 10, 2024
6523073
fix system menu for non-resizeable extended window
mstr2 Dec 10, 2024
8d5d7b8
add StageStyle.EXTENDED_UTILITY
mstr2 Dec 10, 2024
eaafd9f
fix resizable states for GTK windows
mstr2 Dec 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@
* of leading or trailing children or the platform-specific placement of default window buttons.
* <p>
* All children will be resized to their preferred widths and extend the height of the {@code HeaderBar}.
* {@code HeaderBar} honors the minimum, preferred, and maximum sizes of its children. If the child's
* resizable range prevents it from be resized to fit within its position, it will be vertically centered
* relative to the available space; this alignment can be customized with a layout constraint.
* {@code HeaderBar} honors the minimum, preferred, and maximum sizes of its children. As a consequence,
* its computed minimum width is sufficient to accommodate all of its children. If a child's resizable
* range prevents it from be resized to fit within its position, it will be vertically centered relative
* to the available space; this alignment can be customized with a layout constraint.
* <p>
* The default {@link #minHeightProperty() minHeight} of the {@code HeaderBar} is set to match the height
* of the platform-specific default window buttons.
Expand Down Expand Up @@ -259,7 +260,9 @@ public final void setTrailing(Node value) {

@Override
protected double computeMinWidth(double height) {
Node leading = getLeading(), center = getCenter(), trailing = getTrailing();
Node leading = getLeading();
Node center = getCenter();
Node trailing = getTrailing();
Insets insets = getInsets();
double leftPrefWidth;
double rightPrefWidth;
Expand Down Expand Up @@ -290,7 +293,9 @@ protected double computeMinWidth(double height) {

@Override
protected double computeMinHeight(double width) {
Node leading = getLeading(), center = getCenter(), trailing = getTrailing();
Node leading = getLeading();
Node center = getCenter();
Node trailing = getTrailing();
Insets insets = getInsets();
double leadingMinHeight = getAreaHeight(leading, -1, true);
double trailingMinHeight = getAreaHeight(trailing, -1, true);
Expand All @@ -311,7 +316,9 @@ protected double computeMinHeight(double width) {

@Override
protected double computePrefHeight(double width) {
Node leading = getLeading(), center = getCenter(), trailing = getTrailing();
Node leading = getLeading();
Node center = getCenter();
Node trailing = getTrailing();
Insets insets = getInsets();
double leadingPrefHeight = getAreaHeight(leading, -1, false);
double trailingPrefHeight = getAreaHeight(trailing, -1, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
*/
public abstract class HeaderBarBase extends Region {

private static final Dimension2D EMPTY = new Dimension2D(0, 0);
private static final String DRAGGABLE = "headerbar-draggable";

/**
Expand Down Expand Up @@ -135,21 +136,21 @@ private void onFullScreenChanged(boolean fullScreen) {

private void updateInsets() {
if (currentFullScreen || currentMetrics == null) {
leftSystemInset.set(new Dimension2D(0, 0));
rightSystemInset.set(new Dimension2D(0, 0));
leftSystemInset.set(EMPTY);
rightSystemInset.set(EMPTY);
minSystemHeight.set(0);
return;
}

if (currentMetrics.placement() == HorizontalDirection.LEFT) {
leftSystemInset.set(currentMetrics.size());
rightSystemInset.set(new Dimension2D(0, 0));
rightSystemInset.set(EMPTY);
} else if (currentMetrics.placement() == HorizontalDirection.RIGHT) {
leftSystemInset.set(new Dimension2D(0, 0));
leftSystemInset.set(EMPTY);
rightSystemInset.set(currentMetrics.size());
} else {
leftSystemInset.set(new Dimension2D(0, 0));
rightSystemInset.set(new Dimension2D(0, 0));
leftSystemInset.set(EMPTY);
rightSystemInset.set(EMPTY);
}

minSystemHeight.set(currentMetrics.minHeight());
Expand Down Expand Up @@ -188,7 +189,7 @@ public final Dimension2D getLeftSystemInset() {
* independent of layout orientation.
*/
private final ReadOnlyObjectWrapper<Dimension2D> rightSystemInset =
mstr2 marked this conversation as resolved.
Show resolved Hide resolved
new ReadOnlyObjectWrapper<>(this, "rightInset", new Dimension2D(0, 0)) {
new ReadOnlyObjectWrapper<>(this, "rightInset", EMPTY) {
@Override
protected void invalidated() {
requestLayout();
Expand Down
Loading