|
|
[Mac] Use NSTitlebarAccessoryViewController to implement colored app window frames.
DO NOT COMMIT
This explores how colored app windows might be implemented using
NSTitlebarAccessoryViewController. By default, the view controller's
layoutAttribute is NSLayoutAttributeBottom, which puts the accessory
view under the titlebar without overlapping the content view. I.e. it
extends the titlebar height.
Here, the layoutAttribute is set to 2 (NSLayoutAttributeRight), which
draws it over the titlebar, and aligns it to the right of the window.
Unfortunately, the accessory view is always drawn above the title bar,
so it covers the window control buttons. We can add them to the
accessory view, but we'd need to some of their behavior, e.g. mouse
hover.
|