JEP: JavaFX controls in the title bar

Michael Strauß michaelstrau2 at gmail.com
Thu Oct 24 23:29:24 UTC 2024


> In the table, you mention "custom implementation" for resize borders.  What does it mean (who is providing the implementation?)

glass-gtk is providing the implementation; added to the JEP



> Also in the table, please add "right click to invoke the system menu" (this might be a windows-only feature), and the "window shadow" row.

Done.



> I see the native code in your PR refer to iOS, but not Android.  Can you add the two columns to the table (even if they are N/A right now)?

I've clarified in the sentence before the table that the feature is
only supported on Windows, macOS, and Linux.



> In the "Superimposed window buttons" section, you mention that the window buttons automatically adapt to the Scene background, yet on Windows (10, I think) the color of buttons is a user-selectable item, as far as  I remember.  Can you elaborate, maybe with examples (in the JEP)?

I don't think that you can change the colors of windows buttons on
Windows 10 or Windows 11.



> "the system-reserved areas will be empty" meaning non-null (0,0), right?

Correct, added to the JEP.



> "With the absence of a system-provided header bar, the click-to-drag and double-click to maximize behaviors are lost."  I read it as the application code must re-implement this functionality, yet afterward you say the HeaderBar provides it.  May be it should read "... behaviors would be lost" or something to that effect.  The main thing I want to know from reading the JEP is what parts the application developers should implement and what is provided by the new feature.

Clarified in the JEP.



> "leftSystemInset and rightSystemInset" properties.  How does this work on RTL platforms?  Do these properties retain their left/right semantics, or should they be renamed leading/trailing?

leftSystemInset and rightSystemInset refer to the physical left or
right side, as we have two independent questions:
1. Are the window buttons on the physical left or right side of the
window? (that's what this API answers)
2. Is the JavaFX application running in RTL mode?



> For HeaderBar: what are the steps to ensure that the height of the bar is exactly the same as the native?  Same question, but with two initial conditions: the children that can be enlarged or shrink, and the children that might have a minimum size, like TextArea for instance.

The HeaderBar need not be the same height as the native title bar. In
fact, it can be any height. The latest Windows UI design guidelines
even recomment that applications choose an appropriate height:
https://learn.microsoft.com/en-us/windows/apps/design/basics/titlebar-design

HeaderBar will respect the minimum, maximum, and preferred sizes of
its children. If you place a child with a certain min height into the
HeaderBar, it will be at least as high as the child. The same goes for
width.



> What happens if the header bar width is less than the minimum size of its children?  Should the trailing children slide out of the view, or should the children be squished beyond their minimum size?  Could this be an option?  Could this be controlled in the same manner as the GridPane, for example?  Is the header bar always clipped?

The HeaderBar width will not be less than the minimum width of its
children. If you resize the window below the minimum width of the
HeaderBar, the children will simply be clipped at the window border.
Note that applications can place a layout container into the HeaderBar
that supports other layout features (for example, overflow menus like
ToolBar).



> Minor question: should there be an explicit safeguard against creating two HeaderBars, or placing them in the unusual place?  An exception perhaps?

That would probably only apply to two HeaderBars that are active in
the scene graph. But on the other hand, maybe an application wants to
configure two different header bars, place both of them in the scene
graph, and then only show one of those (maybe toggling the visibility
of both).
I certainly wouldn't create such an application, but who knows what
people will do...


More information about the openjfx-dev mailing list