How to get the source lists selection highlight to use the Dark Vibrancy appearance in OS X 10.10?

前端 未结 4 1096
走了就别回头了
走了就别回头了 2020-12-28 22:20

In OS X 10.10 source lists seem to use the light vibrancy appearance. In the Finder (and in some other third party applications, Things.app for example) the selecte

4条回答
  •  情歌与酒
    2020-12-28 22:27

    After playing around for a while I found a way to accomplish this. It turned out that I would get the "Finder highlight" style when using NSTableViewSelectionHighlightStyleSourceList and clicking outside my NSOutlineView. So I figured it would stay that way if you refuse making it first responder.

    Simply make your NSOutlineView a subclass and override this method:

    -(BOOL)acceptsFirstResponder{
        return NO;
    }
    

    It works, but with some downsides. For example, using arrow keys in the NSOutlineView will no longer work. I downloaded the Things app, and it does not allow use of arrow keys either, so it's very likely that this is how they are doing it. If anyone finds a better way, please post it.

提交回复
热议问题