JEP: JavaFX controls in the title bar
Michael Strauß
michaelstrau2 at gmail.com
Fri Nov 15 22:31:05 UTC 2024
I don't really like the idea of supporting multiple HeaderBars. If we
did that, we'd have application developers deviating from the de-facto
implementation requirement that a HeaderBar be placed at the top of
the window, and extend its entire width. If that is not the case, then
leftSystemInset and rightSystemInset don't meanignfully correspond to
the visuals on display. In addition to that, HeaderBarBase negotiates
its height with the platform decorations on macOS, and having more
than one would require us to think about what would happen if they
were different in height.
Why not create a SplitHeaderBar instead? You could have two slots, and
maybe also accept different background paints for the two slots. This
is all possible within the proposed API.
On Fri, Nov 15, 2024 at 10:09 PM Martin Fox <martin at martinfox.com> wrote:
>
> Michael,
>
> On the Mac a common UI layout is to have a splitter view that extends to the top of the window with separate toolbars in each panel. Have you given any thought on supporting this layout in an EXTENDED window?
>
> (I realize this is a Mac thing; Apple loves their sidebars. Microsoft dabbled with this design language but it seems to be fading away. I have seen it in a few Windows apps like 1Password.)
>
> In UIKit Apple implements this using separate views. The equivalent in JavaFX would be to add a separate HeaderBarBase object to the top of each panel in a SplitPane. That would require supporting multiple HeaderBarBase instances and providing an API to tell one to ignore leftSystemInset or rightSystemInset (or both). I like this solution since it allows the background visuals for each header bar to be customized.
>
> The way Apple shoe-horned this into the older AppKit is a bit less elegant. There’s still one NSToolbar that spans the entire window. A developer can add special items to the toolbar that track the dividers in an NSSplitView. I would let developers roll their own solutions if they want that design. Replicating that in JavaFX wouldn’t require any alterations to the HeaderBarBase class and it’s too specialized to be added to HeaderBar.
>
> Martin
More information about the openjfx-dev
mailing list