The default behavior when scrolling on macOS is to show a blurred version of the scrolled content through the titlebar. I'm wondering what attribute/setting controls this behavior. In particular I'd like to disable this effect for my document windows.
I've found that I can disable the effect app wide by setting the NSScrollViewShouldScrollUnderTitlebar defaults key to false.
I've also found that you can disable the effect for a particular documentView (presented in scroll view) by overriding - (BOOL)_wantsUnderTitlebarView; and returning false. Or you can disable in by creating a custom the NSScrollView and having - (BOOL)_canAddUnderTitlebarView; return false.
This solves the problem, though in a hacky way. Still looking for the proper way to disable this feature.
Related
(using Xcode 8b0 on 10.11.5, but the problem also occurs under 7.3)
My app uses an NSColorWell and two NSImageWells to allow users to set a background (colour, image, pattern). The colourWell behaves just fine. The two image wells do not: if you click on one, it will be selected and it is impossible to deselect both (which is what I want if I am using the colourWell.)
NSImageView does not have a deactivate or deselect method. isHighlighted is false even when the imageWell is clearly marked as selected; setting the highlight on either the imageWell or its cell has no visual effect.
The memory of selection persists even between restarts of the app which makes me think it must be stored in the storyboard somehow, only I cannot work out which property is responsible (I've read through the documentation for NSImageView and NSControl without luck).
By employing a ridiculous dance of disabling and enabling my image wells in specific order (you need to enable the one you want to show up as selected first) combined with subclassing NSImageView to override 'mouseDown' so it sends a notification that I capture to trigger the imageWell's action I have got the behaviour I want, but I would really appreciate an easier way of doing this since 'enable/disable controls in specific order' feels like a hack. (So, alas, feels adding the appropriate drag-and-drop support to a NSButton; I really like the 'drop image, have background change' functionality).
Who or what is causing my NSImageViews to be highlighted and how can I take control of this behaviour?
The answer is that this is not a highlight, which is why setting isHighlighted to false does nothing at all. NSImageView has a property named allowsCutCopyPaste- and if this is set to 'true', the imageWell - or the currently active imageWell if you have more than one - will show this 'highlight'.
This is probably some "ugly Yosemite" issue. So I have a button which is either enabled or disabled. Inside a normal window it looks ok, so you can distinguish between enabled
and disabled:
But if I show the very same button in a popover the difference appears to be not that clear:
The right one is disabled, but the background seems to be almost the same. Can there be done anything with it? Any parameter which can be set?
I have an older application that has a specific appearance based on NSCell-based NSTableView having Source List highlighting. Unfortunately, on Yosemite this adds the NSVisualEffectView vibrancy under the selected cell which breaks the appearance in an unpleasant way.
I can't find a way to opt-out of this behaviour, unfortunately.
Setting Regular highlighting breaks the appearance in another way (grey selection instead of blue).
Any idea if there is a way to opt-out of this behaviour on 10.10?
You need to change table view appearance from NSAppearanceNameVibrantLight to NSAppearanceNameAqua. If you're targeting OS X 10.8 or earlier try setting the appearance by editing XIB file directly:
<tableView appearanceType="aqua" ...>
Also make sure that table view background color is set to Default in IB.
I don't know if it works for your case, but the best way to disable an implicit visual effect view is to just embed your NSTable/OutlineView in another NSVisualEffectView and set that views state to inactive
visualEffectView.state = .inactive
When laying out an NSPanel in IB I usually open a big window space, add and lay out the content elements, then resize the window to fit.
In Xcode 4.4 the items I add always seem to have space constraints associated with them and resize as I resize the enclosing elements and I can't seem to be able to turn this behaviour off.
I've tried setting the constraints to 'less than or equal', but it has no effect. This is insanely irritating, it's as if I need to build my UI from the outside inward, which is crazy.
Any suggestions?
You need to disable the auto layout check-box in attributes for the xib...
I had the same problem but found this on google: http://gentlebytes.com/2011/09/auto-layout-in-lion/
I´m doing a bit GUI, this has a Form with a TMemo with the property ScrollBars set to ssVertical but I would like that the vertical scroll only shows when necessary, at present it's always shown. How can I disable when not necessary and enable when necessary?
Thanks you very much.
Unfortunately, TMemo's scrollbars do not work that way. If they are enbled then they are always displayed, regardless of the content. Switch to a TRichEdit instead.