From 25515322e5f76bbc9ab19b9c78a10d187d0fa2f5 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Sun, 8 Oct 2023 22:47:10 -0400 Subject: [PATCH] MacPDF: Remove outline view header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Just setting headerView to nil removes the header, but also has the effect of no longer drawing the outline view with a sidebar background ¯\_(ツ)_/¯. But also setting drawsBackground to NO on the scroll view restores the sidebar look, so do that too. With this, it is no longer necessar to explicitly set style. The default NSTableViewStyleAutomatic now seems to resolve to NSTableViewStyleSourceList, so stop explicitly setting it. (This part has no behavior change.) --- Meta/Lagom/Contrib/MacPDF/MacPDFWindowController.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Meta/Lagom/Contrib/MacPDF/MacPDFWindowController.mm b/Meta/Lagom/Contrib/MacPDF/MacPDFWindowController.mm index 649a0f36e1..62ffe6ef21 100644 --- a/Meta/Lagom/Contrib/MacPDF/MacPDFWindowController.mm +++ b/Meta/Lagom/Contrib/MacPDF/MacPDFWindowController.mm @@ -69,8 +69,8 @@ { _outlineView = [[NSOutlineView alloc] initWithFrame:NSZeroRect]; - _outlineView.style = NSTableViewStyleSourceList; _outlineView.focusRingType = NSFocusRingTypeNone; + _outlineView.headerView = nil; // FIXME: Implement data source support for autosaveExpandedItems and use that. @@ -83,6 +83,7 @@ NSScrollView* scrollView = [[NSScrollView alloc] initWithFrame:NSZeroRect]; scrollView.hasVerticalScroller = YES; + scrollView.drawsBackground = NO; scrollView.documentView = _outlineView; // The scroll view knows to put things only in the safe area, but it doesn't clip to it.