Native Window Controls Within Custom Titlebar/ Component


#1

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.


#2

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

#3

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?


#4

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


#5

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


#6

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


#7

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