Hello, I have a simple NSSlider with a custom slider cell that colors the bar with nice gradients. This slider renders just the way I like it, when added under a window (and a box with a black background).
However, when I copy paste the exact same slider onto a popover view (that is shown attached to a status bar button) with the same background color (i.e. black), the cell of the slider (i.e. the portion around the bar) is drawn with a gray-ish color (see image below).
NOTE - When this popover is shown, the app is in "accessory" mode, i.e. it is now a "status bar app", whereas in the window example, the app is in "regular" mode.
The same popover renders the cell just fine in regular mode. It is only when it is run in "status bar" (or "accessory") mode that this problem occurs.
It is as if, in the window, the slider cell is somehow transparent around the bar (thus revealing the black box color), while in the popover, it is entirely opaque (thus showing the cell background and not its parent view's background color - black).
I know that this has something to do with Alpha/transparency, Core Animation layers, or drawing order, and I read a Core Graphics tutorial, but got absolutely nowhere. I've spent a good 6 hours or so on this, trying all kinds of modifications to the rendering, and now I would really appreciate some help ! Thanks !
(I can post code if necessary)
However, when I copy paste the exact same slider onto a popover view (that is shown attached to a status bar button) with the same background color (i.e. black), the cell of the slider (i.e. the portion around the bar) is drawn with a gray-ish color (see image below).
NOTE - When this popover is shown, the app is in "accessory" mode, i.e. it is now a "status bar app", whereas in the window example, the app is in "regular" mode.
Code:
NSApp.setActivationPolicy(.accessory)
The same popover renders the cell just fine in regular mode. It is only when it is run in "status bar" (or "accessory") mode that this problem occurs.
It is as if, in the window, the slider cell is somehow transparent around the bar (thus revealing the black box color), while in the popover, it is entirely opaque (thus showing the cell background and not its parent view's background color - black).
I know that this has something to do with Alpha/transparency, Core Animation layers, or drawing order, and I read a Core Graphics tutorial, but got absolutely nowhere. I've spent a good 6 hours or so on this, trying all kinds of modifications to the rendering, and now I would really appreciate some help ! Thanks !
(I can post code if necessary)
Last edited: