Finish with accounts preferences custom borders and view.

This commit is contained in:
Brent Simmons 2019-03-19 22:41:09 -07:00
parent 218098b6ac
commit e27a632801
5 changed files with 104 additions and 61 deletions

View File

@ -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 = "<group>"; };
84E95D231FB1087500552D99 /* ArticlePasteboardWriter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArticlePasteboardWriter.swift; sourceTree = "<group>"; };
84EB38101FBA8B9F000D2111 /* KeyboardShortcuts.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = KeyboardShortcuts.html; sourceTree = "<group>"; };
84F1F0552242038B00DA0616 /* AccountsTableViewBackgroundView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountsTableViewBackgroundView.swift; sourceTree = "<group>"; };
84F204CD1FAACB660076E152 /* FeedListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedListViewController.swift; sourceTree = "<group>"; };
84F204DF1FAACBB30076E152 /* ArticleArray.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArticleArray.swift; sourceTree = "<group>"; };
84F2D5351FC22FCB00998D64 /* PseudoFeed.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PseudoFeed.swift; sourceTree = "<group>"; };
@ -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 */,

View File

@ -246,62 +246,71 @@
</objects>
<point key="canvasLocation" x="-29" y="347"/>
</scene>
<!--Accounts Preferences View Controller-->
<!--View Controller-->
<scene sceneID="Rsj-41-ZOj">
<objects>
<viewController storyboardIdentifier="Accounts" id="z5c-Js-Up9" customClass="AccountsPreferencesViewController" sceneMemberID="viewController">
<viewController storyboardIdentifier="Accounts" id="z5c-Js-Up9" sceneMemberID="viewController">
<view key="view" id="GrE-GP-fYK">
<rect key="frame" x="0.0" y="0.0" width="450" height="300"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PaF-du-r3c">
<rect key="frame" x="20" y="46" width="128" height="234"/>
<clipView key="contentView" id="cil-Gq-akO">
<rect key="frame" x="0.0" y="0.0" width="128" height="234"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnReordering="NO" columnSelection="YES" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" rowSizeStyle="automatic" viewBased="YES" id="aTp-KR-y6b">
<rect key="frame" x="0.0" y="0.0" width="128" height="234"/>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="7UM-iq-OLB" customClass="AccountsTableViewBackgroundView" customModule="NetNewsWire" customModuleProvider="target">
<rect key="frame" x="20" y="44" width="130" height="236"/>
<subviews>
<scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PaF-du-r3c">
<rect key="frame" x="1" y="0.0" width="128" height="235"/>
<clipView key="contentView" id="cil-Gq-akO">
<rect key="frame" x="0.0" y="0.0" width="128" height="235"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnReordering="NO" columnSelection="YES" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" rowSizeStyle="automatic" viewBased="YES" id="aTp-KR-y6b">
<rect key="frame" x="0.0" y="0.0" width="128" height="235"/>
<autoresizingMask key="autoresizingMask"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
<tableColumns>
<tableColumn width="116" minWidth="40" maxWidth="1000" id="JSx-yi-vwt">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell>
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" title="Text Cell" id="Djh-3Q-J0Q">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<prototypeCellViews>
<tableCellView id="8VZ-UT-iWO">
<rect key="frame" x="1" y="1" width="116" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
</tableCellView>
</prototypeCellViews>
</tableColumn>
</tableColumns>
</tableView>
</subviews>
</clipView>
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="lI8-9e-8AE">
<rect key="frame" x="-100" y="-100" width="118" height="16"/>
<autoresizingMask key="autoresizingMask"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
<tableColumns>
<tableColumn width="116" minWidth="40" maxWidth="1000" id="JSx-yi-vwt">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell>
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" title="Text Cell" id="Djh-3Q-J0Q">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<prototypeCellViews>
<tableCellView id="8VZ-UT-iWO">
<rect key="frame" x="1" y="1" width="116" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
</tableCellView>
</prototypeCellViews>
</tableColumn>
</tableColumns>
</tableView>
</subviews>
</clipView>
</scroller>
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="DEk-lm-vvo">
<rect key="frame" x="224" y="17" width="15" height="102"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
</subviews>
<constraints>
<constraint firstAttribute="width" constant="128" id="3k7-XI-laJ"/>
<constraint firstItem="PaF-du-r3c" firstAttribute="leading" secondItem="7UM-iq-OLB" secondAttribute="leading" constant="1" id="Brq-cg-FVo"/>
<constraint firstItem="PaF-du-r3c" firstAttribute="top" secondItem="7UM-iq-OLB" secondAttribute="top" constant="1" id="G3u-Hk-xlH"/>
<constraint firstAttribute="width" constant="130" id="MWF-uR-jbC"/>
<constraint firstAttribute="bottom" secondItem="PaF-du-r3c" secondAttribute="bottom" id="bjN-h8-jtK"/>
<constraint firstAttribute="trailing" secondItem="PaF-du-r3c" secondAttribute="trailing" constant="1" id="dfm-a5-dYc"/>
</constraints>
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="lI8-9e-8AE">
<rect key="frame" x="-100" y="-100" width="118" height="16"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="DEk-lm-vvo">
<rect key="frame" x="224" y="17" width="15" height="102"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
</customView>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="QbY-Xt-QmB">
<rect key="frame" x="20" y="19" width="32" height="26"/>
<constraints>
@ -321,25 +330,25 @@
</buttonCell>
</button>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="1gP-iQ-hAV" customClass="AccountsControlsBackgroundView" customModule="NetNewsWire" customModuleProvider="target">
<rect key="frame" x="83" y="20" width="65" height="24"/>
<rect key="frame" x="83" y="20" width="67" height="24"/>
</customView>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="Y7D-xQ-wep">
<rect key="frame" x="156" y="20" width="274" height="260"/>
<rect key="frame" x="158" y="20" width="272" height="260"/>
</customView>
</subviews>
<constraints>
<constraint firstAttribute="bottom" secondItem="QbY-Xt-QmB" secondAttribute="bottom" constant="20" symbolic="YES" id="1KO-Lu-ZGN"/>
<constraint firstItem="Y7D-xQ-wep" firstAttribute="leading" secondItem="PaF-du-r3c" secondAttribute="trailing" constant="8" symbolic="YES" id="6HJ-Kp-fDJ"/>
<constraint firstItem="7UM-iq-OLB" firstAttribute="top" secondItem="GrE-GP-fYK" secondAttribute="top" constant="20" symbolic="YES" id="612-kR-lHI"/>
<constraint firstItem="1gP-iQ-hAV" firstAttribute="height" secondItem="9qe-g9-RR3" secondAttribute="height" id="83d-nY-WgE"/>
<constraint firstItem="1gP-iQ-hAV" firstAttribute="trailing" secondItem="PaF-du-r3c" secondAttribute="trailing" id="9Wz-8u-aBI"/>
<constraint firstItem="1gP-iQ-hAV" firstAttribute="trailing" secondItem="7UM-iq-OLB" secondAttribute="trailing" id="BaC-NB-dnf"/>
<constraint firstAttribute="trailing" secondItem="Y7D-xQ-wep" secondAttribute="trailing" constant="20" symbolic="YES" id="BiM-sH-Dno"/>
<constraint firstItem="QbY-Xt-QmB" firstAttribute="top" secondItem="PaF-du-r3c" secondAttribute="bottom" constant="2" id="CwF-cb-6WI"/>
<constraint firstItem="9qe-g9-RR3" firstAttribute="width" secondItem="QbY-Xt-QmB" secondAttribute="width" id="DAw-bV-gAa"/>
<constraint firstItem="Y7D-xQ-wep" firstAttribute="leading" secondItem="7UM-iq-OLB" secondAttribute="trailing" constant="8" symbolic="YES" id="EXw-I6-Ukj"/>
<constraint firstItem="QbY-Xt-QmB" firstAttribute="top" secondItem="7UM-iq-OLB" secondAttribute="bottom" id="LGE-Jq-tWp"/>
<constraint firstItem="1gP-iQ-hAV" firstAttribute="bottom" secondItem="9qe-g9-RR3" secondAttribute="bottom" id="NxN-Hb-0Ov"/>
<constraint firstItem="PaF-du-r3c" firstAttribute="top" secondItem="GrE-GP-fYK" secondAttribute="top" constant="20" symbolic="YES" id="V61-Mz-6aS"/>
<constraint firstItem="7UM-iq-OLB" firstAttribute="leading" secondItem="GrE-GP-fYK" secondAttribute="leading" constant="20" symbolic="YES" id="VtE-Lp-49T"/>
<constraint firstItem="QbY-Xt-QmB" firstAttribute="leading" secondItem="GrE-GP-fYK" secondAttribute="leading" constant="20" symbolic="YES" id="a8Q-Yv-mKh"/>
<constraint firstItem="Y7D-xQ-wep" firstAttribute="top" secondItem="GrE-GP-fYK" secondAttribute="top" constant="20" symbolic="YES" id="aLy-Bj-FNe"/>
<constraint firstItem="PaF-du-r3c" firstAttribute="leading" secondItem="GrE-GP-fYK" secondAttribute="leading" constant="20" symbolic="YES" id="bl1-Qc-G2O"/>
<constraint firstAttribute="bottom" secondItem="9qe-g9-RR3" secondAttribute="bottom" constant="20" symbolic="YES" id="j89-fd-cKY"/>
<constraint firstItem="QbY-Xt-QmB" firstAttribute="height" secondItem="9qe-g9-RR3" secondAttribute="height" id="n5c-gE-KiS"/>
<constraint firstAttribute="bottom" secondItem="Y7D-xQ-wep" secondAttribute="bottom" constant="20" symbolic="YES" id="o1k-4Z-ABq"/>

View File

@ -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()

View File

@ -6,4 +6,11 @@
// Copyright © 2019 Ranchero Software. All rights reserved.
//
import Foundation
import AppKit
final class AccountsPreferencesViewController: NSViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
}

View File

@ -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()
}
}