Update Inspector windows for folders and smart feeds to look correct on Big Sur.

This commit is contained in:
Maurice Parker 2020-12-09 17:24:55 -06:00
parent d3061f4d8a
commit 2a3f41cbbf
3 changed files with 28 additions and 14 deletions

View File

@ -11,7 +11,8 @@ import AppKit
final class BuiltinSmartFeedInspectorViewController: NSViewController, Inspector {
@IBOutlet var nameTextField: NSTextField?
@IBOutlet weak var smartFeedImageView: NSImageView!
private var smartFeed: PseudoFeed? {
didSet {
updateUI()
@ -61,8 +62,10 @@ private extension BuiltinSmartFeedInspectorViewController {
}
func updateUI() {
nameTextField?.stringValue = smartFeed?.nameForDisplay ?? ""
windowTitle = smartFeed?.nameForDisplay ?? NSLocalizedString("Smart Feed Inspector", comment: "Smart Feed Inspector window title")
if #available(macOS 11.0, *) {
smartFeedImageView?.image = smartFeed?.smallIcon?.image
}
}
}

View File

@ -13,7 +13,8 @@ import RSCore
final class FolderInspectorViewController: NSViewController, Inspector {
@IBOutlet var nameTextField: NSTextField?
@IBOutlet weak var folderImageView: NSImageView!
private var folder: Folder? {
didSet {
if folder != oldValue {
@ -45,6 +46,13 @@ final class FolderInspectorViewController: NSViewController, Inspector {
override func viewDidLoad() {
updateUI()
if #available(macOS 11.0, *) {
let image = NSImage(systemSymbolName: "folder", accessibilityDescription: nil)!
folderImageView.image = image
folderImageView.contentTintColor = NSColor.controlAccentColor
}
NotificationCenter.default.addObserver(self, selector: #selector(displayNameDidChange(_:)), name: .DisplayNameDidChange, object: nil)
}

View File

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="16097.2" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="cfG-Pn-VJS">
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="17506" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="cfG-Pn-VJS">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="16097.2"/>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="17506"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
@ -33,11 +34,11 @@
<objects>
<viewController title="Feed" storyboardIdentifier="Feed" showSeguePresentationStyle="single" id="sfH-oR-GXm" customClass="WebFeedInspectorViewController" customModule="NetNewsWire" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" id="ecA-UY-KEd">
<rect key="frame" x="0.0" y="0.0" width="267" height="318"/>
<rect key="frame" x="0.0" y="0.0" width="273" height="322"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="IWu-80-XC5">
<rect key="frame" x="20" y="186" width="227" height="56"/>
<rect key="frame" x="20" y="190" width="233" height="56"/>
<constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="56" id="zV3-AX-gyC"/>
</constraints>
@ -54,7 +55,7 @@ Field</string>
</connections>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2WO-Iu-p5e">
<rect key="frame" x="18" y="96" width="231" height="16"/>
<rect key="frame" x="18" y="96" width="237" height="16"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" allowsUndo="NO" sendsActionOnEndEditing="YES" title="Home Page" usesSingleLineMode="YES" id="Fg8-rA-G5J">
<font key="font" metaFont="system"/>
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
@ -62,7 +63,7 @@ Field</string>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="1000" horizontalCompressionResistancePriority="250" verticalCompressionResistancePriority="1000" textCompletion="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zm0-15-BFy">
<rect key="frame" x="18" y="76" width="231" height="16"/>
<rect key="frame" x="18" y="76" width="237" height="16"/>
<textFieldCell key="cell" selectable="YES" allowsUndo="NO" sendsActionOnEndEditing="YES" title="http://example.com/" id="L2p-ur-j7a">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@ -70,7 +71,7 @@ Field</string>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ju6-Zo-8X4">
<rect key="frame" x="18" y="40" width="231" height="16"/>
<rect key="frame" x="18" y="40" width="237" height="16"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" allowsUndo="NO" sendsActionOnEndEditing="YES" title="Feed" usesSingleLineMode="YES" id="zzB-rX-1dK">
<font key="font" metaFont="system"/>
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
@ -78,7 +79,7 @@ Field</string>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="1000" horizontalCompressionResistancePriority="250" verticalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="Vvk-KG-JlG">
<rect key="frame" x="18" y="20" width="231" height="16"/>
<rect key="frame" x="18" y="20" width="237" height="16"/>
<textFieldCell key="cell" selectable="YES" allowsUndo="NO" sendsActionOnEndEditing="YES" title="http://example.com/feed" id="HpC-rK-YGK">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@ -86,7 +87,7 @@ Field</string>
</textFieldCell>
</textField>
<button horizontalHuggingPriority="1000" verticalHuggingPriority="750" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="ZBX-E8-k9c">
<rect key="frame" x="18" y="150" width="231" height="18"/>
<rect key="frame" x="18" y="153" width="235" height="18"/>
<buttonCell key="cell" type="check" title="Show notifications for new articles" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="Bw5-c7-yDX">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
@ -96,7 +97,7 @@ Field</string>
</connections>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="nH2-ab-KJ5">
<rect key="frame" x="18" y="130" width="167" height="18"/>
<rect key="frame" x="18" y="131" width="171" height="18"/>
<buttonCell key="cell" type="check" title="Always use Reader view" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="aRe-yV-R0h">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
@ -106,7 +107,7 @@ Field</string>
</connections>
</button>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="I6k-QR-VmV" customClass="IconView" customModule="NetNewsWire" customModuleProvider="target">
<rect key="frame" x="110" y="250" width="48" height="48"/>
<rect key="frame" x="113" y="254" width="48" height="48"/>
<constraints>
<constraint firstAttribute="height" constant="48" id="Faa-nE-lkA"/>
<constraint firstAttribute="width" constant="48" id="esD-dT-oWU"/>
@ -196,6 +197,7 @@ Field</string>
</constraints>
</view>
<connections>
<outlet property="folderImageView" destination="HJF-Gi-62u" id="ERo-ug-OpH"/>
<outlet property="nameTextField" destination="jHf-rc-GNr" id="ZBT-48-bbv"/>
</connections>
</viewController>
@ -239,6 +241,7 @@ Field</string>
</view>
<connections>
<outlet property="nameTextField" destination="4Xp-FX-kn3" id="iJx-DZ-MjF"/>
<outlet property="smartFeedImageView" destination="cwK-Ep-mNL" id="kd1-2v-3yO"/>
</connections>
</viewController>
<customObject id="3Xn-vX-2s9" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>