Skip to content

Commit

Permalink
On macOS 11 set the outline view style to NSTableViewStylePlain.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lapcat committed Nov 27, 2020
1 parent d224d31 commit 86defea
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions source/BrowserWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 86defea

Please sign in to comment.