Black Windows

That works.

a Canvas and a Label on the Canvas, looks fine

Example

That looks awesome! I hadnā€™t considered using a label. Now I can get the bold font Iā€™ve been struggling with. You can also add a contextual menu! Wow, you could even build up an ā€œApp Storeā€ style window with buttons in the titlebar area. (Though I think the app store buttons are very ugly)

another example with ProxyIcon

Download

Although this comes close, the top corners are not rounded. If this can be fixed it would be perfect.

for round corners you can delete the canvas and change last line in Open Event to
NewTitleBar Label1

or make a Canvas with round corners

How about this.

https://www.dropbox.com/s/5zzvi6loqpfeox1/blackwindowFinal.xojo_binary_project

[quote=78867:@Richard Berglund]How about this.

https://www.dropbox.com/s/5zzvi6loqpfeox1/blackwindowFinal.xojo_binary_project [/quote]

perfectly

[quote=78867:@Richard Berglund]How about this.

https://www.dropbox.com/s/5zzvi6loqpfeox1/blackwindowFinal.xojo_binary_project[/quote]

This awesome :slight_smile:

Looks great

I did some work to get the title to center in the titlebar and hang next to where the icon should be by setting the windowā€™s titleā€¦ I think the canvas should draw the title though, so it can have the text truncate correctly.

blackwindowFinal2

Ok, even betterā€¦ got rid of the label.

blackwindowFinal3

Nice work everyone. Itā€™s very close to perfect now. I think the only thing that doesnā€™t look right is the appearance when the window has lost focus. The close/minimize/maximize buttons take on a ghostly appearance when the window loses focus. See pic below. For contrast, see the Pixelmator when it loses focus.


I did a little moreā€¦ Hereā€¦

I moved everything into a canvas subclass that can be dropped on a window. Shebang! Just set the icon file and whether it should be gradiated! Fun Stuff!!! Works for Non-black windows too.

I am astonished that this cannot be done with simple declaresā€¦

I doubt Pixelmator (and others) fake itā€¦ Iā€™m no ObjC expert by farā€¦ but has anyone looked that the ā€œInAppStoreWindowā€ class?

https://github.com/indragiek/INAppStoreWindow

problem on resizing window, titlebar too short

Alex- Oops! Just need to set LockRight to true.

Dave- The examples use (aside from my original post) declares and a built-in control.
I think the problem is that the widgets are drawn by the OS with the assumption that the window is greyĀ… I think youā€™d have to override the drawrect method. Deeper than I feel like going right now.
I think it might need a call to setWantsLayer?

[quote=78974:@Dave S]I am astonished that this cannot be done with simple declaresā€¦

I doubt Pixelmator (and others) fake itā€¦ Iā€™m no ObjC expert by farā€¦ but has anyone looked that the ā€œInAppStoreWindowā€ class?

https://github.com/indragiek/INAppStoreWindow[/quote]

This is done by declares. Except you put a Xojo canvas as subview. Instead of doing it ObjC NSView. Correct me if iā€™m wrong.

[quote=78966:@Gavin Smith]Nice work everyone. Itā€™s very close to perfect now. I think the only thing that doesnā€™t look right is the appearance when the window has lost focus. The close/minimize/maximize buttons take on a ghostly appearance when the window loses focus. See pic below. For contrast, see the Pixelmator when it loses focus.


[/quote]

PM draws its own buttons.

Drawing a gradient is how I accomplished the light beveling when drawing the custom titlebar in Shine, I also used the same trick to position a ā€œUpgradeā€ button in the free version of Shine.

https://itunes.apple.com/gb/app/shine-free/id771533664?mt=12

What I would suggest, is using a CGGradient or NSGradient as these are very fast and work beautifully on Retina displays.

Now the down side of using your own label, the OS no longer has a ā€˜titleā€™ for the Window, yes you need to draw the icon and handle the menu yourself.

Also in some of these screenshots the label positioning is wrong. It should be centered in the Window title, itā€™s slightly off.

As for doing something like the App Storeā€¦ Iā€™m so sure, because it looks to me like itā€™s a custom toolbar, however it overlaps the Windows area and the NSThemeFrame area. It might pay to dig into NSThemeFrame and see if the window title frame can be adjusted and then dump all the controls in there.