how to customize the color of frame and title area of HUD panel - cocoa

I need to let the user to customize the HUD window appearance. Is there a way to change the frame and the title area color of HUD window? There is an API for changing a background color of the window, but title and the frame stay semitransparent black. I'd like to avoid drawing these areas by myself.
Thanks,
Nava

In case nobody knows, I found a couple of links that do it. One of them is a Synapse project, which shows how to use private headers and draws the window by itself. Definitely it's not straight forward and IMO should be allowed by native interfaces. Many thanks to the guy that wrote it:
Synapse project

Related

How to make CGWindowListCreateImage render correct background color?

Capturing an image of an off-screen window with CGWindowListCreateImage is a common way to create QuickLook style zoom-in animations, but this seems create an image with the wrong background colour, slightly lighter than the real window.
This causes a flash at the end of the animation which kind of ruins the effect.
Does anyone have any idea why this happens and what can be done about it?
EDIT: I created a demonstration app for this problem. It is a bit large and complex for a Stack Overflow question, but the relevant code is probably in the ZoomingWindow.m methods takeSnapshot and makeAndPrepareSnapshotWindow.
Setting the window appearance to textured in Interface Builder fixed this. Of course that also changes the color of the window, but that is acceptable in this particular case.

Notification area flyout link area

I made a flyout window in the notification area using WinAPI and my goal was to make it similar to the flyout windows that show up when you click some of the icons in the notification area, like the Volume icon.
I already succeeded in making it look and behave similar to the other ones, but there is one thing I can't seem to figure out. The link area of the flyout windows has a darker blueish background and there is a subtle difference in the look between Windows 7 and Windows 8. A picture of it in Windows 7 can be seen here
http://msdn.microsoft.com/en-us/library/windows/desktop/aa511448.aspx#flyouts
I achieved this by painting this link area of my flyout window manually in the right colors (including the gradient at the topmost part of the section) using the WM_PAINT message, but I just feel like it's too much of a hack, especially because it's not affected by changing themes in Windows. For example, if I set the "Windows Classic" theme this area should be grey and not blue.
So, my question is, am I missing something in how this can be achieved without painting the window manually. I noticed that the details pane in Explorer windows in Win 7 has the same look. I've searched quite a bit for answers but I haven't found anything yet. This is my first time doing a GUI using the WinAPI so I have very little experience, and therefore I'm assuming there is something that I just don't know about.
UPDATE:
I did manage to figure out how to draw this area without painting it manually. It can be drawn by using the OpenThemeData and DrawThemeBackground functions
HTHEME aeroTheme = OpenThemeData(hWnd, L"FLYOUT");
DrawThemeBackground(aeroTheme, hdc, FLYOUT_LINKAREA, 0, &rect, &rect);
This obviously only works when themes are enabled, so for non-themed cases I draw a normal rectangle with the appropriate color.
I'm not an expert in WinAPI so I can't offer any advice on achieving the look you want without manual painting.
However, if you're successfully achieving the appearance for a particular color theme, I'd suggest you look at the GetSysColor function and use this when creating your brushes for painting. This should allow you to get the correct colors based on the theme that has been set. More info (including a swatch table) can be found here.
Hope this helps.

How to draw a custom shaped window using Qt and apply current Windows theme colors/effects to it?

Is it possible to draw a custom shaped window in Qt which inherits color and transparency (glass) effects from current system theme. Ultimately I need it to look & feel just like user's taskbar adjusting to his theme. Like in this concept. I realize that it might not be possible to achieve such perfect integration, but at least make a custom shaped background which look the same as the taskbar (glass look&feel) I believe is achievable.
Partially it is answered in similar questoin - Displaying translucent / irregular-shaped windows with Qt. But still not sure how to read system theme information and apply it to QPainter.
The tricky part is that slope on the left. I'd wager you could get a title bar on a window to be taller and have the rest of the window be 0 height so the window was entirely a title bar but that slope would require rendering functions that just won't exist on Windows.
Also, you're wanting your window hide the taskbar's bevel under where your window appears. That will probably not be possible either as your window will be semi-transparent so it won't be able to block the rendered bevel of the normal taskbar.
Sorry. Might have to go back to the drawing board on your design.

Transparent rounded window but with opaque controls

I am trying to make a HUD with a transparent rounded window with opaque controls as is commonly seen in apps such as Xcode popups, the native volume control, etc.
I'm using the technique detailed here: How to implement HUD-style window like Address Book's "Show in Large Type"
but this renders controls in the view transparent. I've tried setAlphaValue:1.0 on the controls but that has no effect. Searches for other solutions point to Matt Gemmell's RoundedFloatingPanel component. I can't open the project in Xcode 4, but looking at the code as far as I can tell the only difference seems to be in Matt's code he sets the alpha of the window to 1.0 and uses a transparent fill for the NSRect in the view. I tried this but still end up with transparent controls.
So unsurprisingly, Matt Gemmell's code works just fine and I had made a mistake. I forgot that I was also messing with the alpha of the window elsewhere in my code in order to make it fade out on close.
To to sum it up for others running into this issue, if you set the alpha on the NSWindow the controls in that window will also be transparent. Instead set the alpha on the NSBezierPath fill color in the NSView. Just like Matt Gemmell's code does. :)

Cocoa: Custom control not limited to window frame - how to start?

I want to build a custom control that would work like this:
You have a kind of NSButton with an image.
You click the button and than appears a big square with a grid of photos.
You click one of the photos and it is set up as new image for the button. (square dissapears)
Now, how to draw this big square with photos if I want it not to be limited to window frame?
I mean, if the button was close to window border the square is going to be partially outside window. I would also like to add some shadow to the square and an animation for opening/closing.
One important thing: I want to be able to draw not only a square but any other simple shape (circle)!
This isn't really a drawing question so much as a general custom views question. It's important to make that distinction.
I'll describe this in terms of rectangles to give you the general idea*. You should make sure you understand the view hierarchy and view geometry in Cocoa. Without this important requisite knowledge, you'll remain dead in the water.
It's easy to set an NSButton's image, so I'll leave that to you. Your button's action, however, would tell some controller to show the "image picker" for the given button. Your image picker would be some type of borderless window with an image list inside. The image picker could be an IKImageBrowserView (you'll have to enable Image Kit in Interface Builder for this control to appear), which gives you an iPhoto-like grid of images (with/without titles, different border types, etc.).
An explanation of the operation of this controller and how it creates the window, manages the selection, and sets the button's image is very broad so if you get hung up on any of those steps, you'll need to create a separate question for each problem, otherwise this answer would have to be an instruction manual for writing your app for you.
* Your problem is a little more difficult because of your desire to have differently-shaped "popup windows" ... you'd have to make sure your available photos fit neatly within the shape so none of them are cut off. Armed with the basic knowledge of view geometry, I'll leave this to you as an exercise. A hint: you can use a borderless, transparent window to host a view that draws itself in any shape you please.

Resources