From e27a632801aa2ddeb9fe7e9c3cadb0a644848487 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Tue, 19 Mar 2019 22:41:09 -0700 Subject: [PATCH] Finish with accounts preferences custom borders and view. --- NetNewsWire.xcodeproj/project.pbxproj | 6 + NetNewsWire/Base.lproj/Preferences.storyboard | 117 ++++++++++-------- .../AccountsControlsBackgroundView.swift | 12 +- .../AccountsPreferencesViewController.swift | 9 +- .../AccountsTableViewBackgroundView.swift | 21 ++++ 5 files changed, 104 insertions(+), 61 deletions(-) create mode 100644 NetNewsWire/Preferences/Accounts/AccountsTableViewBackgroundView.swift diff --git a/NetNewsWire.xcodeproj/project.pbxproj b/NetNewsWire.xcodeproj/project.pbxproj index d87776262..0e6cbdaae 100644 --- a/NetNewsWire.xcodeproj/project.pbxproj +++ b/NetNewsWire.xcodeproj/project.pbxproj @@ -312,6 +312,8 @@ 84E8E0EB202F693600562D8F /* DetailWebView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E8E0EA202F693600562D8F /* DetailWebView.swift */; }; 84E95D241FB1087500552D99 /* ArticlePasteboardWriter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E95D231FB1087500552D99 /* ArticlePasteboardWriter.swift */; }; 84EB381F1FBA8B9F000D2111 /* KeyboardShortcuts.html in Resources */ = {isa = PBXBuildFile; fileRef = 84EB38101FBA8B9F000D2111 /* KeyboardShortcuts.html */; }; + 84F1F0562242038B00DA0616 /* AccountsTableViewBackgroundView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F1F0552242038B00DA0616 /* AccountsTableViewBackgroundView.swift */; }; + 84F1F0572242038B00DA0616 /* AccountsTableViewBackgroundView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F1F0552242038B00DA0616 /* AccountsTableViewBackgroundView.swift */; }; 84F204E01FAACBB30076E152 /* ArticleArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F204DF1FAACBB30076E152 /* ArticleArray.swift */; }; 84F2D5371FC22FCC00998D64 /* PseudoFeed.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F2D5351FC22FCB00998D64 /* PseudoFeed.swift */; }; 84F2D5381FC22FCC00998D64 /* TodayFeedDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F2D5361FC22FCB00998D64 /* TodayFeedDelegate.swift */; }; @@ -914,6 +916,7 @@ 84E95CF61FABB3C800552D99 /* FeedList.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = FeedList.plist; sourceTree = ""; }; 84E95D231FB1087500552D99 /* ArticlePasteboardWriter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArticlePasteboardWriter.swift; sourceTree = ""; }; 84EB38101FBA8B9F000D2111 /* KeyboardShortcuts.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = KeyboardShortcuts.html; sourceTree = ""; }; + 84F1F0552242038B00DA0616 /* AccountsTableViewBackgroundView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountsTableViewBackgroundView.swift; sourceTree = ""; }; 84F204CD1FAACB660076E152 /* FeedListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedListViewController.swift; sourceTree = ""; }; 84F204DF1FAACBB30076E152 /* ArticleArray.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArticleArray.swift; sourceTree = ""; }; 84F2D5351FC22FCB00998D64 /* PseudoFeed.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PseudoFeed.swift; sourceTree = ""; }; @@ -1131,6 +1134,7 @@ children = ( 842AE5B82241F37B004A742C /* AccountsPreferencesViewController.swift */, 842AE5B72241F37B004A742C /* AccountsControlsBackgroundView.swift */, + 84F1F0552242038B00DA0616 /* AccountsTableViewBackgroundView.swift */, ); name = Accounts; path = NetNewsWire/Preferences/Accounts; @@ -2464,6 +2468,7 @@ 840F7C4721BDA4B40057E851 /* ArticleStyle.swift in Sources */, 840F7C4821BDA4B40057E851 /* FaviconURLFinder.swift in Sources */, 8477ACBF22238E9500DF7F37 /* SearchFeedDelegate.swift in Sources */, + 84F1F0572242038B00DA0616 /* AccountsTableViewBackgroundView.swift in Sources */, 840F7C4921BDA4B40057E851 /* SidebarViewController+ContextualMenus.swift in Sources */, 840F7C4A21BDA4B40057E851 /* RSHTMLMetadata+Extension.swift in Sources */, 840F7C4B21BDA4B40057E851 /* SendToMarsEditCommand.swift in Sources */, @@ -2632,6 +2637,7 @@ 849A97771ED9EC04007D329B /* TimelineCellData.swift in Sources */, 841ABA6020145EC100980E11 /* BuiltinSmartFeedInspectorViewController.swift in Sources */, D5E4CC54202C1361009B4FFC /* AppDelegate+Scriptability.swift in Sources */, + 84F1F0562242038B00DA0616 /* AccountsTableViewBackgroundView.swift in Sources */, D5F4EDB5200744A700B9E363 /* ScriptingObject.swift in Sources */, 84F3EE1A20DEC97E003FADEB /* HTMLFeedFinder.swift in Sources */, D5F4EDB920074D7C00B9E363 /* Folder+Scriptability.swift in Sources */, diff --git a/NetNewsWire/Base.lproj/Preferences.storyboard b/NetNewsWire/Base.lproj/Preferences.storyboard index ea8742dcb..29c0a2f0a 100644 --- a/NetNewsWire/Base.lproj/Preferences.storyboard +++ b/NetNewsWire/Base.lproj/Preferences.storyboard @@ -246,62 +246,71 @@ - + - + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + + + + + - - - + - + - + - + - + - + + - + - diff --git a/NetNewsWire/Preferences/Accounts/AccountsControlsBackgroundView.swift b/NetNewsWire/Preferences/Accounts/AccountsControlsBackgroundView.swift index 531b1e2a2..ef4489430 100644 --- a/NetNewsWire/Preferences/Accounts/AccountsControlsBackgroundView.swift +++ b/NetNewsWire/Preferences/Accounts/AccountsControlsBackgroundView.swift @@ -11,11 +11,11 @@ import RSCore final class AccountsControlsBackgroundView: NSView { - private static let lightModeFillColor = NSColor(white: 0.97, alpha: 1.0) - private static let darkModeFillColor = NSColor(white: 0.24, alpha: 1.0) + private let lightModeFillColor = NSColor(white: 0.97, alpha: 1.0) + private let darkModeFillColor = NSColor(red: 0.32, green: 0.34, blue: 0.35, alpha: 1.0) - private static let lightModeBorderColor = NSColor(white: 0.71, alpha: 1.0) - private static let darkModeBorderColor = NSColor(white: 0.5, alpha: 1.0) + private let lightModeBorderColor = NSColor(white: 0.71, alpha: 1.0) + private let darkModeBorderColor = NSColor(red: 0.41, green: 0.43, blue: 0.44, alpha: 1.0) override var isFlipped: Bool { return true @@ -26,11 +26,11 @@ final class AccountsControlsBackgroundView: NSView { } override func draw(_ dirtyRect: NSRect) { - let fillColor = self.effectiveAppearance.isDarkMode ? AccountsControlsBackgroundView.darkModeFillColor : AccountsControlsBackgroundView.lightModeFillColor + let fillColor = self.effectiveAppearance.isDarkMode ? darkModeFillColor : lightModeFillColor fillColor.setFill() dirtyRect.fill() - let borderColor = self.effectiveAppearance.isDarkMode ? AccountsControlsBackgroundView.darkModeBorderColor : AccountsControlsBackgroundView.lightModeBorderColor + let borderColor = self.effectiveAppearance.isDarkMode ? darkModeBorderColor : lightModeBorderColor borderColor.set() let topPath = NSBezierPath() diff --git a/NetNewsWire/Preferences/Accounts/AccountsPreferencesViewController.swift b/NetNewsWire/Preferences/Accounts/AccountsPreferencesViewController.swift index 3e5089612..4fbe17ad4 100644 --- a/NetNewsWire/Preferences/Accounts/AccountsPreferencesViewController.swift +++ b/NetNewsWire/Preferences/Accounts/AccountsPreferencesViewController.swift @@ -6,4 +6,11 @@ // Copyright © 2019 Ranchero Software. All rights reserved. // -import Foundation +import AppKit + +final class AccountsPreferencesViewController: NSViewController { + + override func viewDidLoad() { + super.viewDidLoad() + } +} diff --git a/NetNewsWire/Preferences/Accounts/AccountsTableViewBackgroundView.swift b/NetNewsWire/Preferences/Accounts/AccountsTableViewBackgroundView.swift new file mode 100644 index 000000000..2c30b96b1 --- /dev/null +++ b/NetNewsWire/Preferences/Accounts/AccountsTableViewBackgroundView.swift @@ -0,0 +1,21 @@ +// +// AccountsTableViewBackgroundView.swift +// NetNewsWire +// +// Created by Brent Simmons on 3/19/19. +// Copyright © 2019 Ranchero Software. All rights reserved. +// + +import AppKit + +final class AccountsTableViewBackgroundView: NSView { + + let lightBorderColor = NSColor(white: 0.71, alpha: 1.0) + let darkBorderColor = NSColor(red: 0.41, green: 0.43, blue: 0.44, alpha: 1.0) + + override func draw(_ dirtyRect: NSRect) { + let color = self.effectiveAppearance.isDarkMode ? darkBorderColor : lightBorderColor + color.setFill() + dirtyRect.fill() + } +}