From 86defead83df8308854c6bd8118ab1df50edbb3c Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 27 Nov 2020 06:51:16 -0600 Subject: [PATCH] On macOS 11 set the outline view style to NSTableViewStylePlain. This eliminates the padding added to the outline view on Big Sur. Use KVC to allow compiling without the macOS 11 SDK. The method -[NSTableView setStyle:] was not available before then. --- source/BrowserWindowController.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/BrowserWindowController.swift b/source/BrowserWindowController.swift index 61a922b..a7add21 100644 --- a/source/BrowserWindowController.swift +++ b/source/BrowserWindowController.swift @@ -66,6 +66,9 @@ class BrowserWindowController:NSObject, NSOutlineViewDataSource, NSOutlineViewDe outlineView.headerView = nil outlineView.intercellSpacing = NSMakeSize(3.0, 2.0) // macOS 11 SDK changed the default, so use the old value. outlineView.rowHeight = 17.0 // macOS 11 SDK changed the default, so use the old value. + if #available(macOS 11.0, *) { + outlineView.setValue(4, forKey:"style") // NSTableViewStylePlain + } outlineView.setDraggingSourceOperationMask([.copy], forLocal:false) // Allow drags to other apps outlineView.usesAlternatingRowBackgroundColors = false