Closed ctipper closed 2 years ago
So I've found a workaround with a javax.swing.border.EmptyBorder
I guess that will get me most of the way there, but achieving the native padding effect seems impossible using existing Java APIs.
So I've found a workaround with a
EmptyBorder
...
What do you mean? Could you move the three round system buttons?
There is a comment on JDK-8211301 that suggests adding an empty NSToolbar, which would move the three round system buttons.
Here is an example how to do this with Swift: https://github.com/lukakerr/NSWindowStyles#12-transparent-toolbar-without-seperator
For Java, there seems to be no solution at the moment...
I think you have confirmed what I thought and really it would be too much to expect native controls in Java. The property to set a transparent title bar means that the title bar is still available, I only confirmed that after I posted this issue. So I will close this issue.
Issue is already closed, but you might have a look at the property "apple.awt.windowTransparentTitleBarHeight"
that's available when you run your application with a recent Jetbrains Runtime:
As a test I was able to move the traffic lights:
I'm not using it because It's not yet perfect I think, the buttons sometimes get highlighted when hovering the mouse over the original location (and I'm also having some font issues when using Jetbrains Runtime on MacOS). Also make sure to pass a float to this property (integer won't work).
Thanks for the info. That's very interesting 👍
I suspect this is to do with JDK implementation of
apple.awt.fullWindowContent
but the affordance using FlatLaf at top of the frame is smaller than other native apps. I am putting this here in the hope that the issue gains some traction. I show a screenshot of my own private app and macOS Safari (macOS 12). When a user attempts to drag using the title bar the target is very narrow, though not insurmountable.