Native Window Controls Within Custom Titlebar/ Component

How can I use the native window controls and behaviour inside a custom window title bar or component?
I’m trying to have some of my components fill the height of the window and be ‘inside’ the title bar (as shown below) but I’m not entirely sure how to go about it. Using the JUCE Titlebar and just faking the look of the icons seems to change the default behaviour for the window controls which isn’t my desired behaviour.

Got this bit of ObjC code to achieve this on the Mac. Is there anywhere in JUCE to achieve a similar functionality using just C++?

window.titlebarAppearsTransparent = true
window.titleVisibility = .Hidden
window.styleMask |= NSFullSizeContentViewWindowMask
1 Like

AFAIK you can set the titlebar height to 0 to hide it:
DocumentWindow::setTitleBarHeight (0); and set required buttons to 0 when you construct the window.

Is this what you are after?

Doesn’t that remove the Window control buttons completely? (I’m away from a Mac to test) I’m looking to have the window controls overlayed on my JUCE component

Well yes, I thought that’s what the ObjC calls do, that you posted as reference… maybe I understood the goal wrong then.

I was wondering if there was already a cross platform solution in JUCE as I’d ideally like a similar behaviour on windows

Edit: This is the sort of effect I’m looking for

Now I am confused, yes, the code I gave will remove the title bar on windows, mac and linux.
You could add your own buttons then inside the window and call setFullScreen() or what is appropriate.

The image makes it clear now, thanks.

I don’t know, if you can set a background image behind the original titlebar though…

Good luck

I see it is an old topic but …
why when I use setUsingNativeTitleBar (false);
I cannot resize the window anymore ?
I would like to get rid of the native titlebar, but keep the window resizability. setResizable(true) does what its name suggests as long as I have setUsingNativeTitleBar set to true. Not a big issue overall but as I came across this behaviour I would like to understand how it works …is there a workaround so to have the window without the nativeBar on top AND resizable? I have turned my window into a DocumentWindow (it was a ResizableWindow) just to call setTitleBarHeight(0), as Daniel suggested, but calling this method doesn’t make the title bar disappear … ?