-
Notifications
You must be signed in to change notification settings - Fork 516
8313424: JavaFX controls in the title bar (Preview) #1605
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
Open
mstr2
wants to merge
106
commits into
openjdk:master
Choose a base branch
from
mstr2:feature/extended-window
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+6,311
−690
Open
Changes from all commits
Commits
Show all changes
106 commits
Select commit
Hold shift + click to select a range
3d19b87
WIP
mstr2 0ddd63d
doc change
mstr2 7969622
revert unintended change
mstr2 a289572
Merge branch 'master' into feature/extended-window
mstr2 ba02e8f
Improve HeaderBar documentation
mstr2 f973e8c
improve documentation
mstr2 f02e7e9
Windows: add system menu
mstr2 fef8cfc
Windows: custom context menu overrides system menu
mstr2 778e6c1
GTK: prevent resizing below window button size, fix crash
mstr2 3b468fe
GTK: add system menu
mstr2 0526edb
small code changes
mstr2 95736df
remove unused code
mstr2 d9c0fe2
Merge branch 'master' into feature/extended-window
mstr2 c0b588f
set minHeight to native height of title bar
mstr2 d7f88c3
better documentation
mstr2 9de4694
macOS: hide window title
mstr2 cd5d443
improve title text documentation
mstr2 bc48ae0
fix peer access outside of synchronizer
mstr2 804d0be
NPE
mstr2 f5e3121
fix header bar height flicker
mstr2 1c4ecc1
macOS: dynamically adapt toolbar style to headerbar height
mstr2 15dc3ff
Merge branch 'master' into feature/extended-window
mstr2 9b63892
Merge branch 'master' into feature/extended-window
mstr2 e7febc5
fix mirroring/unmirroring of X coord in win-glass
mstr2 d1c388b
stylistic changes
mstr2 8c9fbbd
use CsvSource in HeaderBarTest
mstr2 3660a29
EMPTY Dimension2D constant
mstr2 8974c14
HeaderBar changes
mstr2 ca9b325
refactor performWindowDrag
mstr2 8e77a22
HeaderBar javadoc change
mstr2 4336735
WindowControlsOverlay snapping
mstr2 a9178b7
add system menu documentation
mstr2 6a16536
Merge branch 'master' into feature/extended-window
mstr2 65f095e
Merge branch 'master' into feature/extended-window
mstr2 d5afc7d
Merge branch 'master' into feature/extended-window
mstr2 26b81b8
remove unneeded dll
mstr2 003e9d5
macOS: double-click action + fullscreen toolbar
mstr2 485a9d9
Merge branch 'master' into feature/extended-window
mstr2 743626f
Merge branch 'master' into feature/extended-window
mstr2 d9b82c8
Add HeaderBar.overlappingSystemInset property
mstr2 8649f91
StyleableBooleanProperty -> BooleanProperty
mstr2 af35dce
Merge branch 'master' into feature/extended-window
mstr2 6523073
fix system menu for non-resizeable extended window
mstr2 8d5d7b8
add StageStyle.EXTENDED_UTILITY
mstr2 eaafd9f
fix resizable states for GTK windows
mstr2 cbb3216
Merge branch 'master' into feature/extended-window
mstr2 63bd058
Refactoring, added HeaderBar.leadingSystemPadding/trailingSystemPadding
mstr2 8c33b3c
Merge branch 'master' into feature/extended-window
mstr2 49a81d3
added custom header buttons
mstr2 356a78e
fix line endings
mstr2 fcec7c8
update javadoc
mstr2 2ab1294
hide default window buttons on macOS
mstr2 8a73f5e
typo
mstr2 e874d21
add samples in MonkeyTester
mstr2 3efd782
small MonkeyTester refactor
mstr2 cadf1c2
added StageTester to MonkeyTester
mstr2 600c721
macOS bugfixes, default button behavior
mstr2 7cb591f
move StageTester to Tools menu
mstr2 c30eb60
add "maximized" pseudo-class for custom maximize button
mstr2 94ce7d4
Added HeaderBarBase.prefButtonHeight, removed Stage.initDefaultHeader…
mstr2 a04d946
Remove HeaderBarBase
mstr2 00b9be7
Merge branch 'master' into feature/extended-window
mstr2 9a7246b
update copyright headers
mstr2 1f95e9d
typo
mstr2 cd9c2a9
minify button glyphs
mstr2 394c95f
remove HeaderButtonOverlay.allowRtl
mstr2 e6e8100
Merge branch 'master' into feature/extended-window
mstr2 df90ca1
tweak header button glyph scaling
mstr2 31fa310
Merge branch 'master' into feature/extended-window
mstr2 0985e9c
add preview feature
mstr2 8a5defd
add preview feature
mstr2 30eb29b
enable preview features in tests
mstr2 f870493
tweak header button scaling at 100%
mstr2 a2b5df1
documentation
mstr2 50f9c75
documentation
mstr2 305b1aa
Merge branch 'master' into feature/extended-window
mstr2 88e5016
doc update
mstr2 63215fc
remove import
mstr2 a3497b2
Remove StageStyle.EXTENDED_UTILITY
mstr2 3622b05
Merge branch 'master' into feature/extended-window
mstr2 e9aeaef
don't show a right-click system menu in full-screen mode
mstr2 379c01e
documentation
mstr2 0969239
Merge branch 'master' into feature/extended-window
mstr2 394a039
review comments
mstr2 b6f8f9b
documentation
mstr2 7dc8f5f
add MenuBar to stage tester
mstr2 d1aa6b3
add HeaderDragType
mstr2 94d61ef
doc change
mstr2 6a2f05d
Merge branch 'master' into feature/extended-window
mstr2 544d62e
Fix top resize border on Windows
mstr2 c602f50
simplify header area picking
mstr2 5e857f1
Merge branch 'master' into feature/extended-window
mstr2 18ab411
reapply overlay CSS
mstr2 e09adfe
Merge branch 'master' into feature/extended-window
mstr2 fe7b6c7
javadoc
mstr2 dcbb68d
Merge branch 'master' into feature/extended-window
mstr2 7cccfd3
Merge branch 'master' into feature/extended-window
mstr2 b85f72f
add explicit cast in glass_window.cpp
mstr2 b947e33
Merge branch 'master' into feature/extended-window
mstr2 3b8fd53
fix memory leak in ViewScene
mstr2 06ce89a
javadoc fix
mstr2 5686848
enable preview feature system properties for tests
mstr2 e17fe8b
rename WindowManager to DesktopEnvironment
mstr2 cb7c594
Set the scene root as the parent of the overlay node
mstr2 96a0d79
Rename default window button style classes
mstr2 cdb24bc
only dispose ViewSceneOverlay when non-null
mstr2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
modules/javafx.graphics/src/main/java/com/sun/glass/ui/HeaderButtonMetrics.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. | ||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
* | ||
* This code is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License version 2 only, as | ||
* published by the Free Software Foundation. Oracle designates this | ||
* particular file as subject to the "Classpath" exception as provided | ||
* by Oracle in the LICENSE file that accompanied this code. | ||
* | ||
* This code is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* version 2 for more details (a copy is included in the LICENSE file that | ||
* accompanied this code). | ||
* | ||
* You should have received a copy of the GNU General Public License version | ||
* 2 along with this work; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
* | ||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
* or visit www.oracle.com if you need additional information or have any | ||
* questions. | ||
*/ | ||
|
||
package com.sun.glass.ui; | ||
|
||
import javafx.geometry.Dimension2D; | ||
import javafx.scene.layout.HeaderBar; | ||
import javafx.stage.StageStyle; | ||
import java.util.Objects; | ||
|
||
/** | ||
* Provides metrics about the header buttons of {@link StageStyle#EXTENDED} windows. | ||
* | ||
* @param leftInset the size of the left inset | ||
* @param rightInset the size of the right inset | ||
* @param minHeight the minimum height of the window buttons | ||
* @see HeaderButtonOverlay | ||
* @see HeaderBar | ||
*/ | ||
public record HeaderButtonMetrics(Dimension2D leftInset, Dimension2D rightInset, double minHeight) { | ||
mstr2 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
public static HeaderButtonMetrics EMPTY = new HeaderButtonMetrics(new Dimension2D(0, 0), new Dimension2D(0, 0), 0); | ||
|
||
public HeaderButtonMetrics { | ||
Objects.requireNonNull(leftInset); | ||
Objects.requireNonNull(rightInset); | ||
|
||
if (minHeight < 0) { | ||
throw new IllegalArgumentException("minHeight cannot be negative"); | ||
} | ||
} | ||
|
||
public double totalInsetWidth() { | ||
return leftInset.getWidth() + rightInset.getWidth(); | ||
} | ||
|
||
public double maxInsetHeight() { | ||
return Math.max(leftInset.getHeight(), rightInset.getHeight()); | ||
} | ||
} |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems a good approach.
it might make it a little more difficult if we wanted to test the logic that throws an exception when
javafx.enablePreview
is not"true"
, but that would still be possible by having that test explicitly set the property to the empty string in an@Before
method, and then restoring it in an@After
method. Probably not worth doing anyway.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this seems like a good solution waiting for a problem. I agree that we can do that when we discover that problem.