That works.
a Canvas and a Label on the Canvas, looks fine
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)
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.
[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
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.
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?
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.