diff --git a/Evergreen.xcodeproj/project.pbxproj b/Evergreen.xcodeproj/project.pbxproj index d4a9ac507..5f05e01e3 100644 --- a/Evergreen.xcodeproj/project.pbxproj +++ b/Evergreen.xcodeproj/project.pbxproj @@ -28,6 +28,7 @@ 842E45E31ED8C681000A8B52 /* KeyboardDelegateProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 842E45E21ED8C681000A8B52 /* KeyboardDelegateProtocol.swift */; }; 842E45E51ED8C6B7000A8B52 /* MainWindowSplitView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 842E45E41ED8C6B7000A8B52 /* MainWindowSplitView.swift */; }; 842E45E71ED8C747000A8B52 /* DB5.plist in Resources */ = {isa = PBXBuildFile; fileRef = 842E45E61ED8C747000A8B52 /* DB5.plist */; }; + 843A3B5620311E7700BF76EC /* FeedListOutlineView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 843A3B5520311E7700BF76EC /* FeedListOutlineView.swift */; }; 84411E711FE5FBFA004B527F /* SmallIconProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84411E701FE5FBFA004B527F /* SmallIconProvider.swift */; }; 8444C8F21FED81840051386C /* OPMLExporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8444C8F11FED81840051386C /* OPMLExporter.swift */; }; 844B5B591FE9FE4F00C7C76A /* SidebarKeyboardDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 844B5B581FE9FE4F00C7C76A /* SidebarKeyboardDelegate.swift */; }; @@ -540,6 +541,7 @@ 842E45E21ED8C681000A8B52 /* KeyboardDelegateProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KeyboardDelegateProtocol.swift; sourceTree = ""; }; 842E45E41ED8C6B7000A8B52 /* MainWindowSplitView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainWindowSplitView.swift; sourceTree = ""; }; 842E45E61ED8C747000A8B52 /* DB5.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = DB5.plist; path = Evergreen/Resources/DB5.plist; sourceTree = ""; }; + 843A3B5520311E7700BF76EC /* FeedListOutlineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedListOutlineView.swift; sourceTree = ""; }; 84411E701FE5FBFA004B527F /* SmallIconProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SmallIconProvider.swift; sourceTree = ""; }; 8444C8F11FED81840051386C /* OPMLExporter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OPMLExporter.swift; sourceTree = ""; }; 844B5B581FE9FE4F00C7C76A /* SidebarKeyboardDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SidebarKeyboardDelegate.swift; sourceTree = ""; }; @@ -1020,6 +1022,7 @@ 84C12A141FF5B0080009A267 /* FeedList.storyboard */, 849A978C1ED9EE4D007D329B /* FeedListWindowController.swift */, 84F204CD1FAACB660076E152 /* FeedListViewController.swift */, + 843A3B5520311E7700BF76EC /* FeedListOutlineView.swift */, 84B99C661FAE35E600ECDEDB /* FeedListTreeControllerDelegate.swift */, 84B99C681FAE36B800ECDEDB /* FeedListFolder.swift */, 84B99C6A1FAE370B00ECDEDB /* FeedListFeed.swift */, @@ -1920,6 +1923,7 @@ 849A978A1ED9ECEF007D329B /* ArticleStylesManager.swift in Sources */, 84E8E0DB202EC49300562D8F /* TimelineViewController+ContextualMenus.swift in Sources */, 849A97791ED9EC04007D329B /* TimelineStringUtilities.swift in Sources */, + 843A3B5620311E7700BF76EC /* FeedListOutlineView.swift in Sources */, 8472058120142E8900AD578B /* FeedInspectorViewController.swift in Sources */, 84F204CE1FAACB660076E152 /* FeedListViewController.swift in Sources */, 845A29241FC9255E007B49E3 /* SidebarCellAppearance.swift in Sources */, diff --git a/Evergreen/FeedList/FeedList.storyboard b/Evergreen/FeedList/FeedList.storyboard index 49f3ac362..917f8ad6a 100644 --- a/Evergreen/FeedList/FeedList.storyboard +++ b/Evergreen/FeedList/FeedList.storyboard @@ -9,7 +9,7 @@ - + @@ -33,20 +33,20 @@ - + - + - + - + @@ -82,7 +82,7 @@ - + @@ -138,6 +138,9 @@ + + + diff --git a/Evergreen/FeedList/FeedListOutlineView.swift b/Evergreen/FeedList/FeedListOutlineView.swift new file mode 100644 index 000000000..7e6966bc0 --- /dev/null +++ b/Evergreen/FeedList/FeedListOutlineView.swift @@ -0,0 +1,30 @@ +// +// FeedListOutlineView.swift +// Evergreen +// +// Created by Brent Simmons on 2/11/18. +// Copyright © 2018 Ranchero Software. All rights reserved. +// + +import AppKit +import RSTree + +final class FeedListOutlineView: NSOutlineView { + + override func frameOfCell(atColumn column: Int, row: Int) -> NSRect { + + // Adjust top-level cells — they were too close to the disclosure indicator. + + var frame = super.frameOfCell(atColumn: column, row: row) + + let node = item(atRow: row) as! Node + guard let parentNode = node.parent, parentNode.isRoot else { + return frame + } + + let adjustment: CGFloat = 4.0 + frame.origin.x += adjustment + frame.size.width -= adjustment + return frame + } +} diff --git a/Evergreen/FeedList/FeedListViewController.swift b/Evergreen/FeedList/FeedListViewController.swift index 4145f94c6..e5c5d0928 100644 --- a/Evergreen/FeedList/FeedListViewController.swift +++ b/Evergreen/FeedList/FeedListViewController.swift @@ -67,11 +67,15 @@ final class FeedListViewController: NSViewController { extension FeedListViewController { - func openHomePage(_ sender: Any?) { + @IBAction func openHomePage(_ sender: Any?) { + guard let homePageURL = singleSelectedHomePageURL() else { + return + } + Browser.open(homePageURL, inBackground: false) } - func addToFeeds(_ sender: Any?) { + @IBAction func addToFeeds(_ sender: Any?) { } } @@ -133,8 +137,11 @@ extension FeedListViewController: NSOutlineViewDelegate { postSidebarSelectionDidChangeNotification(selectedNode.representedObject) } } +} - private func configure(_ cell: SidebarCell, _ node: Node) { +private extension FeedListViewController { + + func configure(_ cell: SidebarCell, _ node: Node) { cell.cellAppearance = sidebarCellAppearance cell.objectValue = node @@ -164,9 +171,6 @@ extension FeedListViewController: NSOutlineViewDelegate { } return "" } -} - -private extension FeedListViewController { func nodeForRow(_ row: Int) -> Node? {