mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-12-04 03:08:43 +00:00
Make Timeline its own screen. Include timeline layout settings in that screen.
This commit is contained in:
1 parent
ff52900504
commit
74c2ec2dd8
4 files changed
+142
-343
No files matched your search
@@ -368,6 +368,9 @@
|
||||
"Completed" : {
|
||||
"comment" : "Completed"
|
||||
},
|
||||
"Confirm Mark All as Read" : {
|
||||
"comment" : "Confirm Mark All as Read"
|
||||
},
|
||||
"Continue" : {
|
||||
"localizations" : {
|
||||
"es" : {
|
||||
@@ -725,6 +728,9 @@
|
||||
"Grayscale Feed Icons" : {
|
||||
"comment" : "Grayscale Feed Icons"
|
||||
},
|
||||
"Group by Feed" : {
|
||||
"comment" : "Group by Feed"
|
||||
},
|
||||
"Help" : {
|
||||
"comment" : "Help"
|
||||
},
|
||||
@@ -822,6 +828,9 @@
|
||||
"Last Response" : {
|
||||
"comment" : "Last HTTP Response"
|
||||
},
|
||||
"Layout" : {
|
||||
"comment" : "Layout"
|
||||
},
|
||||
"Light" : {
|
||||
"comment" : "Light"
|
||||
},
|
||||
@@ -1136,6 +1145,9 @@
|
||||
"Refresh Scan" : {
|
||||
"comment" : "Refresh scan button"
|
||||
},
|
||||
"Refresh to Clear Read Articles" : {
|
||||
"comment" : "Refresh to Clear Read Articles"
|
||||
},
|
||||
"Release Notes" : {
|
||||
"comment" : "Release Notes"
|
||||
},
|
||||
@@ -1281,6 +1293,9 @@
|
||||
"Show notifications for new articles" : {
|
||||
"comment" : "Show notifications for new articles"
|
||||
},
|
||||
"Show Previews in Context Menus" : {
|
||||
"comment" : "Show Previews in Context Menus"
|
||||
},
|
||||
"Show Read Articles" : {
|
||||
"comment" : "Command"
|
||||
},
|
||||
@@ -1365,6 +1380,9 @@
|
||||
"Smart Feeds" : {
|
||||
"comment" : "Smart Feeds group title"
|
||||
},
|
||||
"Sort Oldest to Newest" : {
|
||||
"comment" : "Sort Oldest to Newest"
|
||||
},
|
||||
"Star" : {
|
||||
"comment" : "Star"
|
||||
},
|
||||
@@ -1495,9 +1513,6 @@
|
||||
"Timeline" : {
|
||||
"comment" : "Timeline"
|
||||
},
|
||||
"Timeline Layout" : {
|
||||
"comment" : "Timeline Layout"
|
||||
},
|
||||
"Timeline Separator" : {
|
||||
"comment" : "Toolbar item"
|
||||
},
|
||||
|
||||
@@ -115,198 +115,6 @@
|
||||
</tableViewCell>
|
||||
</cells>
|
||||
</tableViewSection>
|
||||
<tableViewSection headerTitle="Timeline" id="9Pk-Y8-JVJ">
|
||||
<cells>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" id="MpA-w1-Wwh" customClass="VibrantTableViewCell" customModule="NetNewsWire" customModuleProvider="target">
|
||||
<rect key="frame" x="20" y="478.5" width="374" height="51.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="MpA-w1-Wwh" id="GhU-ib-Mz8">
|
||||
<rect key="frame" x="0.0" y="0.0" width="374" height="51.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="250" text="Sort Oldest to Newest" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="c9W-IF-u6i" customClass="VibrantLabel" customModule="NetNewsWire" customModuleProvider="target">
|
||||
<rect key="frame" x="20" y="15" width="167.5" height="21.5"/>
|
||||
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="Keq-Np-l9O">
|
||||
<rect key="frame" x="293" y="12" width="63" height="28"/>
|
||||
<color key="onTintColor" name="primaryAccentColor"/>
|
||||
<connections>
|
||||
<action selector="switchTimelineOrder:" destination="a0p-rk-skQ" eventType="valueChanged" id="ARp-jk-sAo"/>
|
||||
</connections>
|
||||
</switch>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="Keq-Np-l9O" firstAttribute="top" relation="greaterThanOrEqual" secondItem="GhU-ib-Mz8" secondAttribute="top" constant="6" id="B0w-Jk-LsD"/>
|
||||
<constraint firstItem="Keq-Np-l9O" firstAttribute="centerY" secondItem="GhU-ib-Mz8" secondAttribute="centerY" id="Fn1-4L-3Mu"/>
|
||||
<constraint firstItem="c9W-IF-u6i" firstAttribute="top" secondItem="GhU-ib-Mz8" secondAttribute="topMargin" id="I6I-av-62X"/>
|
||||
<constraint firstAttribute="bottomMargin" secondItem="c9W-IF-u6i" secondAttribute="bottom" id="RKN-iP-jvM"/>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="Keq-Np-l9O" secondAttribute="trailing" id="Ry8-Ww-bwT"/>
|
||||
<constraint firstItem="Keq-Np-l9O" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="c9W-IF-u6i" secondAttribute="trailing" constant="8" id="crw-aM-cVp"/>
|
||||
<constraint firstItem="c9W-IF-u6i" firstAttribute="leading" secondItem="GhU-ib-Mz8" secondAttribute="leadingMargin" id="hcX-Ao-zHb"/>
|
||||
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="Keq-Np-l9O" secondAttribute="bottom" constant="6" id="zNh-Vc-Ryn"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" id="f7r-AZ-aDn" customClass="VibrantTableViewCell" customModule="NetNewsWire" customModuleProvider="target">
|
||||
<rect key="frame" x="20" y="530" width="374" height="51.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="f7r-AZ-aDn" id="KHC-cc-tOC">
|
||||
<rect key="frame" x="0.0" y="0.0" width="374" height="51.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="250" text="Group by Feed" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cit-i1-0Hp" customClass="VibrantLabel" customModule="NetNewsWire" customModuleProvider="target">
|
||||
<rect key="frame" x="20" y="15" width="112.5" height="21.5"/>
|
||||
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="JNi-Wz-RbU">
|
||||
<rect key="frame" x="293" y="12" width="63" height="28"/>
|
||||
<color key="onTintColor" name="primaryAccentColor"/>
|
||||
<connections>
|
||||
<action selector="switchGroupByFeed:" destination="a0p-rk-skQ" eventType="valueChanged" id="Bxb-Jq-EEi"/>
|
||||
</connections>
|
||||
</switch>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="JNi-Wz-RbU" secondAttribute="trailing" id="99y-MA-Qbl"/>
|
||||
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="JNi-Wz-RbU" secondAttribute="bottom" constant="6" id="Jls-0y-9cd"/>
|
||||
<constraint firstItem="JNi-Wz-RbU" firstAttribute="top" relation="greaterThanOrEqual" secondItem="KHC-cc-tOC" secondAttribute="top" constant="6" id="Qoi-uf-HDC"/>
|
||||
<constraint firstItem="JNi-Wz-RbU" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="cit-i1-0Hp" secondAttribute="trailing" constant="8" id="SaK-1e-1Mg"/>
|
||||
<constraint firstItem="cit-i1-0Hp" firstAttribute="bottom" secondItem="KHC-cc-tOC" secondAttribute="bottomMargin" id="cHk-g1-Wsg"/>
|
||||
<constraint firstItem="JNi-Wz-RbU" firstAttribute="centerY" secondItem="KHC-cc-tOC" secondAttribute="centerY" id="idT-LP-oPt"/>
|
||||
<constraint firstItem="cit-i1-0Hp" firstAttribute="leading" secondItem="KHC-cc-tOC" secondAttribute="leadingMargin" id="lXq-t5-hoi"/>
|
||||
<constraint firstItem="cit-i1-0Hp" firstAttribute="top" secondItem="KHC-cc-tOC" secondAttribute="topMargin" id="ojH-3E-wea"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" id="5wo-fM-0l6" customClass="VibrantTableViewCell" customModule="NetNewsWire" customModuleProvider="target">
|
||||
<rect key="frame" x="20" y="581.5" width="374" height="51.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="5wo-fM-0l6" id="XAn-lK-LoN">
|
||||
<rect key="frame" x="0.0" y="0.0" width="374" height="51.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="749" text="Refresh to Clear Read Articles" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="KtJ-tk-DlD">
|
||||
<rect key="frame" x="20" y="15" width="227.5" height="21.5"/>
|
||||
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="duV-CN-JmH">
|
||||
<rect key="frame" x="293" y="12" width="63" height="28"/>
|
||||
<color key="onTintColor" name="primaryAccentColor"/>
|
||||
<connections>
|
||||
<action selector="switchClearsReadArticles:" destination="a0p-rk-skQ" eventType="valueChanged" id="Nel-mq-9fP"/>
|
||||
</connections>
|
||||
</switch>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="KtJ-tk-DlD" firstAttribute="top" secondItem="XAn-lK-LoN" secondAttribute="topMargin" id="3mX-9g-2Bp"/>
|
||||
<constraint firstItem="KtJ-tk-DlD" firstAttribute="leading" secondItem="XAn-lK-LoN" secondAttribute="leadingMargin" id="AOT-A0-ak0"/>
|
||||
<constraint firstItem="duV-CN-JmH" firstAttribute="top" relation="greaterThanOrEqual" secondItem="XAn-lK-LoN" secondAttribute="top" constant="6" id="FeD-Le-7bK"/>
|
||||
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="duV-CN-JmH" secondAttribute="bottom" constant="6" id="MJP-qB-ivU"/>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="duV-CN-JmH" secondAttribute="trailing" id="Qkh-LF-zez"/>
|
||||
<constraint firstItem="duV-CN-JmH" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="KtJ-tk-DlD" secondAttribute="trailing" constant="8" id="cCz-fb-lta"/>
|
||||
<constraint firstItem="duV-CN-JmH" firstAttribute="centerY" secondItem="XAn-lK-LoN" secondAttribute="centerY" id="eui-vJ-Bp8"/>
|
||||
<constraint firstAttribute="bottomMargin" secondItem="KtJ-tk-DlD" secondAttribute="bottom" id="iyQ-7h-MT3"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" id="SXs-NQ-y3U" customClass="VibrantTableViewCell" customModule="NetNewsWire" customModuleProvider="target">
|
||||
<rect key="frame" x="20" y="633" width="374" height="51.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="SXs-NQ-y3U" id="BpI-Hz-KH2">
|
||||
<rect key="frame" x="0.0" y="0.0" width="374" height="51.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="749" text="Confirm Mark All as Read" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5tY-5k-v2g">
|
||||
<rect key="frame" x="20" y="15" width="191.5" height="21.5"/>
|
||||
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="UOo-9z-IuL">
|
||||
<rect key="frame" x="293" y="12" width="63" height="28"/>
|
||||
<color key="onTintColor" name="primaryAccentColor"/>
|
||||
<connections>
|
||||
<action selector="switchConfirmMarkAllAsRead:" destination="a0p-rk-skQ" eventType="valueChanged" id="7wW-hF-2OY"/>
|
||||
</connections>
|
||||
</switch>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="5tY-5k-v2g" firstAttribute="top" secondItem="BpI-Hz-KH2" secondAttribute="topMargin" id="K3n-tK-0tu"/>
|
||||
<constraint firstItem="UOo-9z-IuL" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="5tY-5k-v2g" secondAttribute="trailing" constant="8" id="KeP-ft-0GH"/>
|
||||
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="UOo-9z-IuL" secondAttribute="bottom" constant="6" id="RUM-9w-Q3y"/>
|
||||
<constraint firstItem="UOo-9z-IuL" firstAttribute="centerY" secondItem="BpI-Hz-KH2" secondAttribute="centerY" id="V2L-l3-s1E"/>
|
||||
<constraint firstAttribute="bottomMargin" secondItem="5tY-5k-v2g" secondAttribute="bottom" id="VeZ-P7-kQW"/>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="UOo-9z-IuL" secondAttribute="trailing" id="mNk-x8-oJx"/>
|
||||
<constraint firstItem="UOo-9z-IuL" firstAttribute="top" relation="greaterThanOrEqual" secondItem="BpI-Hz-KH2" secondAttribute="top" constant="6" id="tps-aV-CKA"/>
|
||||
<constraint firstItem="5tY-5k-v2g" firstAttribute="leading" secondItem="BpI-Hz-KH2" secondAttribute="leadingMargin" id="v4X-Nd-cpC"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" id="pTc-Mp-c01" customClass="VibrantTableViewCell" customModule="NetNewsWire" customModuleProvider="target">
|
||||
<rect key="frame" x="20" y="633" width="374" height="51.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="pTc-Mp-c01" id="pTc-Mp-c02">
|
||||
<rect key="frame" x="0.0" y="0.0" width="374" height="51.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="749" text="Show Previews in Context Menus" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pTc-Mp-c03">
|
||||
<rect key="frame" x="20" y="15" width="191.5" height="21.5"/>
|
||||
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="pTc-Mp-c04">
|
||||
<rect key="frame" x="293" y="12" width="63" height="28"/>
|
||||
<color key="onTintColor" name="primaryAccentColor"/>
|
||||
<connections>
|
||||
<action selector="switchShowPreviewInTimelineContextMenu:" destination="a0p-rk-skQ" eventType="valueChanged" id="pTc-Mp-c05"/>
|
||||
</connections>
|
||||
</switch>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="pTc-Mp-c03" firstAttribute="top" secondItem="pTc-Mp-c02" secondAttribute="topMargin" id="pTc-Mp-c06"/>
|
||||
<constraint firstItem="pTc-Mp-c04" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="pTc-Mp-c03" secondAttribute="trailing" constant="8" id="pTc-Mp-c07"/>
|
||||
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="pTc-Mp-c04" secondAttribute="bottom" constant="6" id="pTc-Mp-c08"/>
|
||||
<constraint firstItem="pTc-Mp-c04" firstAttribute="centerY" secondItem="pTc-Mp-c02" secondAttribute="centerY" id="pTc-Mp-c09"/>
|
||||
<constraint firstAttribute="bottomMargin" secondItem="pTc-Mp-c03" secondAttribute="bottom" id="pTc-Mp-c10"/>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="pTc-Mp-c04" secondAttribute="trailing" id="pTc-Mp-c11"/>
|
||||
<constraint firstItem="pTc-Mp-c04" firstAttribute="top" relation="greaterThanOrEqual" secondItem="pTc-Mp-c02" secondAttribute="top" constant="6" id="pTc-Mp-c12"/>
|
||||
<constraint firstItem="pTc-Mp-c03" firstAttribute="leading" secondItem="pTc-Mp-c02" secondAttribute="leadingMargin" id="pTc-Mp-c13"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" id="8Gj-qz-NMY" customClass="VibrantBasicTableViewCell" customModule="NetNewsWire" customModuleProvider="target">
|
||||
<rect key="frame" x="20" y="684.5" width="374" height="51"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="8Gj-qz-NMY" id="OTe-tG-sb4">
|
||||
<rect key="frame" x="0.0" y="0.0" width="343.5" height="51"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Timeline Layout" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YHt-eS-KrX">
|
||||
<rect key="frame" x="20" y="15.5" width="119.5" height="20.5"/>
|
||||
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="YHt-eS-KrX" firstAttribute="centerY" secondItem="OTe-tG-sb4" secondAttribute="centerY" id="HpK-qo-s57"/>
|
||||
<constraint firstItem="YHt-eS-KrX" firstAttribute="leading" secondItem="OTe-tG-sb4" secondAttribute="leadingMargin" id="STg-aB-F7n"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="label" destination="YHt-eS-KrX" id="zaC-7C-hda"/>
|
||||
</connections>
|
||||
</tableViewCell>
|
||||
</cells>
|
||||
</tableViewSection>
|
||||
<tableViewSection headerTitle="Articles" id="TRr-Ew-IvU">
|
||||
<cells>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" id="WFP-zj-Pve" customClass="VibrantBasicTableViewCell" customModule="NetNewsWire" customModuleProvider="target">
|
||||
@@ -512,6 +320,23 @@
|
||||
</subviews>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" textLabel="Tml-lb-4bR" style="IBUITableViewCellStyleDefault" id="Tml-Cel-7rY" customClass="VibrantTableViewCell" customModule="NetNewsWire" customModuleProvider="target">
|
||||
<rect key="frame" x="20" y="1157" width="374" height="51"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="Tml-Cel-7rY" id="Tml-Cnt-2mN">
|
||||
<rect key="frame" x="0.0" y="0.0" width="343.5" height="51"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Timeline" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" id="Tml-lb-4bR">
|
||||
<rect key="frame" x="20" y="0.0" width="315.5" height="51"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" textLabel="Apr-lb-4bR" style="IBUITableViewCellStyleDefault" id="Apr-Cel-7rY" customClass="VibrantTableViewCell" customModule="NetNewsWire" customModuleProvider="target">
|
||||
<rect key="frame" x="20" y="1208" width="374" height="51"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
@@ -580,45 +405,16 @@
|
||||
</navigationItem>
|
||||
<connections>
|
||||
<outlet property="articleThemeDetailLabel" destination="DUf-DZ-3Nm" id="QHN-Le-zyw"/>
|
||||
<outlet property="confirmMarkAllAsReadSwitch" destination="UOo-9z-IuL" id="yLZ-Kf-wDt"/>
|
||||
<outlet property="showPreviewInTimelineContextMenuSwitch" destination="pTc-Mp-c04" id="pTc-Mp-c14"/>
|
||||
<outlet property="enableJavaScriptSwitch" destination="Djo-HE-LWS" id="muL-I5-eDE"/>
|
||||
<outlet property="swipeToNextPreviousArticleSwitch" destination="Sw1-pe-Swt" id="Sw1-pe-Ot2"/>
|
||||
<outlet property="groupByFeedSwitch" destination="JNi-Wz-RbU" id="TwH-Kd-o6N"/>
|
||||
<outlet property="openLinksInNetNewsWire" destination="dhR-L2-PX3" id="z1b-pX-bwG"/>
|
||||
<outlet property="refreshClearsReadArticlesSwitch" destination="duV-CN-JmH" id="xTd-jF-Ei1"/>
|
||||
<outlet property="showFullscreenArticlesSwitch" destination="2Md-2E-7Z4" id="lEN-VP-wEO"/>
|
||||
<outlet property="timelineSortOrderSwitch" destination="Keq-Np-l9O" id="Zm7-HG-r5h"/>
|
||||
</connections>
|
||||
</tableViewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="GZq-IX-Qod" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="282.60869565217394" y="150.66964285714286"/>
|
||||
</scene>
|
||||
<!--Timeline Customizer Collection View Controller-->
|
||||
<scene sceneID="fXX-KA-wIe">
|
||||
<objects>
|
||||
<collectionViewController storyboardIdentifier="TimelineCustomizerCollectionViewController" id="XEX-9Z-nVH" customClass="TimelineCustomizerCollectionViewController" customModule="NetNewsWire" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<collectionView key="view" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" id="a3y-1d-Jtk">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<collectionViewFlowLayout key="collectionViewLayout" automaticEstimatedItemSize="YES" minimumLineSpacing="20" minimumInteritemSpacing="10" sectionInsetReference="safeArea" id="JcL-Zm-mbs">
|
||||
<size key="itemSize" width="414" height="128"/>
|
||||
<size key="headerReferenceSize" width="0.0" height="0.0"/>
|
||||
<size key="footerReferenceSize" width="0.0" height="0.0"/>
|
||||
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
|
||||
</collectionViewFlowLayout>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="XEX-9Z-nVH" id="Ioc-M7-xcT"/>
|
||||
<outlet property="delegate" destination="XEX-9Z-nVH" id="YJM-b1-Gtc"/>
|
||||
</connections>
|
||||
</collectionView>
|
||||
</collectionViewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="bHh-r9-jkX" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="3053.6231884057975" y="150.66964285714286"/>
|
||||
</scene>
|
||||
<!--Navigation Controller-->
|
||||
<scene sceneID="Ezn-Ny-zye">
|
||||
<objects>
|
||||
|
||||
@@ -20,16 +20,16 @@ final class SettingsViewController: UITableViewController {
|
||||
case notifications = 0
|
||||
case accounts = 1
|
||||
case feeds = 2
|
||||
case timeline = 3
|
||||
case articles = 4
|
||||
case moreScreens = 5
|
||||
case articles = 3
|
||||
case moreScreens = 4
|
||||
}
|
||||
|
||||
private enum MoreScreensRow: Int {
|
||||
case sidebar = 0
|
||||
case appearance = 1
|
||||
case troubleshooting = 2
|
||||
case help = 3
|
||||
case timeline = 1
|
||||
case appearance = 2
|
||||
case troubleshooting = 3
|
||||
case help = 4
|
||||
}
|
||||
|
||||
private enum FeedsRow: Int {
|
||||
@@ -38,15 +38,6 @@ final class SettingsViewController: UITableViewController {
|
||||
case addNetNewsWireNewsFeed = 2
|
||||
}
|
||||
|
||||
private enum TimelineRow: Int {
|
||||
case sortOrder = 0
|
||||
case groupByFeed = 1
|
||||
case refreshClearsReadArticles = 2
|
||||
case confirmMarkAllAsRead = 3
|
||||
case showPreviewInTimelineContextMenu = 4
|
||||
case timelineLayout = 5
|
||||
}
|
||||
|
||||
private enum ArticlesRow: Int, CaseIterable {
|
||||
case theme = 0
|
||||
case openLinksInNetNewsWire = 1
|
||||
@@ -57,12 +48,7 @@ final class SettingsViewController: UITableViewController {
|
||||
|
||||
private weak var opmlAccount: Account?
|
||||
|
||||
@IBOutlet var timelineSortOrderSwitch: UISwitch!
|
||||
@IBOutlet var groupByFeedSwitch: UISwitch!
|
||||
@IBOutlet var refreshClearsReadArticlesSwitch: UISwitch!
|
||||
@IBOutlet var articleThemeDetailLabel: UILabel!
|
||||
@IBOutlet var confirmMarkAllAsReadSwitch: UISwitch!
|
||||
@IBOutlet var showPreviewInTimelineContextMenuSwitch: UISwitch?
|
||||
@IBOutlet var showFullscreenArticlesSwitch: UISwitch!
|
||||
@IBOutlet var openLinksInNetNewsWire: UISwitch!
|
||||
@IBOutlet var enableJavaScriptSwitch: UISwitch!
|
||||
@@ -90,33 +76,8 @@ final class SettingsViewController: UITableViewController {
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
|
||||
if AppDefaults.timelineSortDirection == .orderedAscending {
|
||||
timelineSortOrderSwitch.isOn = true
|
||||
} else {
|
||||
timelineSortOrderSwitch.isOn = false
|
||||
}
|
||||
|
||||
if AppDefaults.timelineGroupByFeed {
|
||||
groupByFeedSwitch.isOn = true
|
||||
} else {
|
||||
groupByFeedSwitch.isOn = false
|
||||
}
|
||||
|
||||
if AppDefaults.refreshClearsReadArticles {
|
||||
refreshClearsReadArticlesSwitch.isOn = true
|
||||
} else {
|
||||
refreshClearsReadArticlesSwitch.isOn = false
|
||||
}
|
||||
|
||||
articleThemeDetailLabel.text = ArticleThemesManager.shared.currentTheme.name
|
||||
|
||||
if AppDefaults.confirmMarkAllAsRead {
|
||||
confirmMarkAllAsReadSwitch.isOn = true
|
||||
} else {
|
||||
confirmMarkAllAsReadSwitch.isOn = false
|
||||
}
|
||||
|
||||
showPreviewInTimelineContextMenuSwitch?.isOn = AppDefaults.showPreviewInTimelineContextMenu
|
||||
swipeToNextPreviousArticleSwitch?.isOn = AppDefaults.articleSwipeNavigationEnabled
|
||||
|
||||
if AppDefaults.articleFullscreenAvailable {
|
||||
@@ -241,14 +202,6 @@ final class SettingsViewController: UITableViewController {
|
||||
default:
|
||||
break
|
||||
}
|
||||
case .timeline:
|
||||
switch TimelineRow(rawValue: indexPath.row) {
|
||||
case .timelineLayout:
|
||||
let timeline = UIStoryboard.settings.instantiateController(ofType: TimelineCustomizerCollectionViewController.self)
|
||||
self.navigationController?.pushViewController(timeline, animated: true)
|
||||
default:
|
||||
break
|
||||
}
|
||||
case .articles:
|
||||
switch ArticlesRow(rawValue: indexPath.row) {
|
||||
case .theme:
|
||||
@@ -261,6 +214,8 @@ final class SettingsViewController: UITableViewController {
|
||||
switch MoreScreensRow(rawValue: indexPath.row) {
|
||||
case .sidebar:
|
||||
self.navigationController?.pushViewController(SidebarSettingsViewController(), animated: true)
|
||||
case .timeline:
|
||||
self.navigationController?.pushViewController(TimelineSettingsViewController(), animated: true)
|
||||
case .appearance:
|
||||
self.navigationController?.pushViewController(AppearanceSettingsViewController(), animated: true)
|
||||
case .troubleshooting:
|
||||
@@ -303,42 +258,6 @@ final class SettingsViewController: UITableViewController {
|
||||
dismiss(animated: true)
|
||||
}
|
||||
|
||||
@IBAction func switchTimelineOrder(_ sender: Any) {
|
||||
if timelineSortOrderSwitch.isOn {
|
||||
AppDefaults.timelineSortDirection = .orderedAscending
|
||||
} else {
|
||||
AppDefaults.timelineSortDirection = .orderedDescending
|
||||
}
|
||||
}
|
||||
|
||||
@IBAction func switchGroupByFeed(_ sender: Any) {
|
||||
if groupByFeedSwitch.isOn {
|
||||
AppDefaults.timelineGroupByFeed = true
|
||||
} else {
|
||||
AppDefaults.timelineGroupByFeed = false
|
||||
}
|
||||
}
|
||||
|
||||
@IBAction func switchClearsReadArticles(_ sender: Any) {
|
||||
if refreshClearsReadArticlesSwitch.isOn {
|
||||
AppDefaults.refreshClearsReadArticles = true
|
||||
} else {
|
||||
AppDefaults.refreshClearsReadArticles = false
|
||||
}
|
||||
}
|
||||
|
||||
@IBAction func switchConfirmMarkAllAsRead(_ sender: Any) {
|
||||
if confirmMarkAllAsReadSwitch.isOn {
|
||||
AppDefaults.confirmMarkAllAsRead = true
|
||||
} else {
|
||||
AppDefaults.confirmMarkAllAsRead = false
|
||||
}
|
||||
}
|
||||
|
||||
@IBAction func switchShowPreviewInTimelineContextMenu(_ sender: UISwitch) {
|
||||
AppDefaults.showPreviewInTimelineContextMenu = sender.isOn
|
||||
}
|
||||
|
||||
@IBAction func switchFullscreenArticles(_ sender: Any) {
|
||||
if showFullscreenArticlesSwitch.isOn {
|
||||
AppDefaults.articleFullscreenAvailable = true
|
||||
|
||||
+99
-30
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// TimelineCustomizerCollectionViewController.swift
|
||||
// TimelineSettingsViewController.swift
|
||||
// NetNewsWire-iOS
|
||||
//
|
||||
// Created by Stuart Breckenridge on 27/01/2026.
|
||||
@@ -10,10 +10,11 @@ import UIKit
|
||||
import Articles
|
||||
import Images
|
||||
|
||||
class TimelineCustomizerCollectionViewController: UICollectionViewController {
|
||||
final class TimelineSettingsViewController: UICollectionViewController {
|
||||
|
||||
private enum Section: Int, CaseIterable {
|
||||
case options
|
||||
case general
|
||||
case layout
|
||||
case preview
|
||||
case previewWithThumbnail
|
||||
case previewWithFeedIcon
|
||||
@@ -30,8 +31,16 @@ class TimelineCustomizerCollectionViewController: UICollectionViewController {
|
||||
}
|
||||
}
|
||||
|
||||
private enum GeneralRow: Int, CaseIterable {
|
||||
case sortOrder
|
||||
case groupByFeed
|
||||
case refreshClearsReadArticles
|
||||
case confirmMarkAllAsRead
|
||||
case showPreviewInContextMenu
|
||||
}
|
||||
|
||||
/// Same order as the Mac Timeline settings.
|
||||
private enum OptionsRow: Int, CaseIterable {
|
||||
private enum LayoutRow: Int, CaseIterable {
|
||||
case feedIcons
|
||||
case feedIconSize
|
||||
case thumbnails
|
||||
@@ -73,13 +82,26 @@ class TimelineCustomizerCollectionViewController: UICollectionViewController {
|
||||
}
|
||||
|
||||
// Created up front, since UIKit disallows creating a registration in cellForItemAt.
|
||||
private let optionsCellRegistration = UICollectionView.CellRegistration<TimelineCustomizerOptionsCell, OptionsRow> { cell, _, optionsRow in
|
||||
TimelineCustomizerCollectionViewController.configureOptionsCell(cell, optionsRow: optionsRow)
|
||||
private let generalCellRegistration = UICollectionView.CellRegistration<TimelineSettingsOptionsCell, GeneralRow> { cell, _, generalRow in
|
||||
TimelineSettingsViewController.configureGeneralCell(cell, generalRow: generalRow)
|
||||
}
|
||||
|
||||
private let layoutCellRegistration = UICollectionView.CellRegistration<TimelineSettingsOptionsCell, LayoutRow> { cell, _, layoutRow in
|
||||
TimelineSettingsViewController.configureLayoutCell(cell, layoutRow: layoutRow)
|
||||
}
|
||||
|
||||
init() {
|
||||
// The layout is replaced in configureCollectionView.
|
||||
super.init(collectionViewLayout: UICollectionViewFlowLayout())
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
title = NSLocalizedString("Timeline Layout", comment: "Timeline Layout")
|
||||
title = NSLocalizedString("Timeline", comment: "Timeline")
|
||||
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(handleTimelineFeedIconsDisplayDidChange(_:)), name: .timelineFeedIconsDisplayDidChange, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(handleTimelineIconSizeDidChange(_:)), name: .timelineIconSizeDidChange, object: nil)
|
||||
@@ -93,6 +115,8 @@ class TimelineCustomizerCollectionViewController: UICollectionViewController {
|
||||
}
|
||||
|
||||
private func configureCollectionView() {
|
||||
collectionView.backgroundColor = .systemBackground
|
||||
|
||||
collectionView.register(
|
||||
TimelineHeaderView.self,
|
||||
forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader,
|
||||
@@ -104,8 +128,9 @@ class TimelineCustomizerCollectionViewController: UICollectionViewController {
|
||||
let layout = UICollectionViewCompositionalLayout { sectionIndex, layoutEnvironment in
|
||||
var config = UICollectionLayoutListConfiguration(appearance: .insetGrouped)
|
||||
config.showsSeparators = false
|
||||
let isHidden = Self.isHidden(Section(rawValue: sectionIndex))
|
||||
config.headerMode = isHidden ? .none : .supplementary
|
||||
let sectionID = Section(rawValue: sectionIndex)
|
||||
let isHidden = Self.isHidden(sectionID)
|
||||
config.headerMode = (isHidden || sectionID == .general) ? .none : .supplementary
|
||||
let section = NSCollectionLayoutSection.list(using: config, layoutEnvironment: layoutEnvironment)
|
||||
if isHidden {
|
||||
// An empty section still has insets, which would leave a gap.
|
||||
@@ -128,8 +153,11 @@ class TimelineCustomizerCollectionViewController: UICollectionViewController {
|
||||
if Self.isHidden(section) {
|
||||
return 0
|
||||
}
|
||||
if section == .options {
|
||||
return OptionsRow.allCases.count
|
||||
if section == .general {
|
||||
return GeneralRow.allCases.count
|
||||
}
|
||||
if section == .layout {
|
||||
return LayoutRow.allCases.count
|
||||
}
|
||||
return 1
|
||||
}
|
||||
@@ -137,9 +165,12 @@ class TimelineCustomizerCollectionViewController: UICollectionViewController {
|
||||
override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
|
||||
|
||||
switch Section(rawValue: indexPath.section) {
|
||||
case .options:
|
||||
let optionsRow = OptionsRow(rawValue: indexPath.item) ?? .feedIcons
|
||||
return collectionView.dequeueConfiguredReusableCell(using: optionsCellRegistration, for: indexPath, item: optionsRow)
|
||||
case .general:
|
||||
let generalRow = GeneralRow(rawValue: indexPath.item) ?? .sortOrder
|
||||
return collectionView.dequeueConfiguredReusableCell(using: generalCellRegistration, for: indexPath, item: generalRow)
|
||||
case .layout:
|
||||
let layoutRow = LayoutRow(rawValue: indexPath.item) ?? .feedIcons
|
||||
return collectionView.dequeueConfiguredReusableCell(using: layoutCellRegistration, for: indexPath, item: layoutRow)
|
||||
case .preview, .previewWithThumbnail, .previewWithFeedIcon, .previewWithFeedIconAndThumbnail:
|
||||
return previewCell(section: Section(rawValue: indexPath.section) ?? .preview, indexPath: indexPath)
|
||||
case .none:
|
||||
@@ -165,7 +196,9 @@ class TimelineCustomizerCollectionViewController: UICollectionViewController {
|
||||
switch Section(rawValue: indexPath.section) {
|
||||
case .preview, .previewWithThumbnail, .previewWithFeedIcon, .previewWithFeedIconAndThumbnail:
|
||||
header.label.text = Self.previewHeaderTitle(Section(rawValue: indexPath.section) ?? .preview)
|
||||
case .options, .none:
|
||||
case .layout:
|
||||
header.label.text = NSLocalizedString("Layout", comment: "Layout")
|
||||
case .general, .none:
|
||||
header.label.text = nil
|
||||
}
|
||||
return header
|
||||
@@ -183,37 +216,37 @@ class TimelineCustomizerCollectionViewController: UICollectionViewController {
|
||||
// MARK: Notifications
|
||||
|
||||
@objc func handleTimelineFeedIconsDisplayDidChange(_ notification: Notification) {
|
||||
reloadOptionsRowsAndPreviews()
|
||||
reloadLayoutRowsAndPreviews()
|
||||
}
|
||||
|
||||
@objc func handleTimelineIconSizeDidChange(_ notification: Notification) {
|
||||
reloadOptionsRowsAndPreviews()
|
||||
reloadLayoutRowsAndPreviews()
|
||||
}
|
||||
|
||||
@objc func handleTimelineThumbnailsDisplayDidChange(_ notification: Notification) {
|
||||
reloadOptionsRowsAndPreviews()
|
||||
reloadLayoutRowsAndPreviews()
|
||||
}
|
||||
|
||||
@objc func handleTimelineNumberOfLinesDidChange(_ notification: Notification) {
|
||||
reloadOptionsRowsAndPreviews()
|
||||
reloadLayoutRowsAndPreviews()
|
||||
}
|
||||
|
||||
@objc func handleTimelineShowFullTitlesDidChange(_ notification: Notification) {
|
||||
reloadOptionsRowsAndPreviews()
|
||||
reloadLayoutRowsAndPreviews()
|
||||
}
|
||||
|
||||
@objc func handleTimelineFadeReadArticlesDidChange(_ notification: Notification) {
|
||||
reloadOptionsRowsAndPreviews()
|
||||
reloadLayoutRowsAndPreviews()
|
||||
}
|
||||
|
||||
@objc func handleTimelineFeedNameAndDateAboveTitleDidChange(_ notification: Notification) {
|
||||
reloadOptionsRowsAndPreviews()
|
||||
reloadLayoutRowsAndPreviews()
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
private extension TimelineCustomizerCollectionViewController {
|
||||
private extension TimelineSettingsViewController {
|
||||
|
||||
/// Hides a preview that the Feed Icons and Thumbnail Size settings mean would never be seen.
|
||||
/// Thumbnails don’t hide previews without one, since not every article has a thumbnail.
|
||||
@@ -272,11 +305,44 @@ private extension TimelineCustomizerCollectionViewController {
|
||||
return cell
|
||||
}
|
||||
|
||||
static private func configureOptionsCell(_ cell: TimelineCustomizerOptionsCell, optionsRow: OptionsRow) {
|
||||
static private func configureGeneralCell(_ cell: TimelineSettingsOptionsCell, generalRow: GeneralRow) {
|
||||
var content = UIListContentConfiguration.cell()
|
||||
switch generalRow {
|
||||
case .sortOrder:
|
||||
content.text = NSLocalizedString("Sort Oldest to Newest", comment: "Sort Oldest to Newest")
|
||||
configureSwitch(cell, isOn: AppDefaults.timelineSortDirection == .orderedAscending) { isOn in
|
||||
AppDefaults.timelineSortDirection = isOn ? .orderedAscending : .orderedDescending
|
||||
}
|
||||
case .groupByFeed:
|
||||
content.text = NSLocalizedString("Group by Feed", comment: "Group by Feed")
|
||||
configureSwitch(cell, isOn: AppDefaults.timelineGroupByFeed) { isOn in
|
||||
AppDefaults.timelineGroupByFeed = isOn
|
||||
}
|
||||
case .refreshClearsReadArticles:
|
||||
content.text = NSLocalizedString("Refresh to Clear Read Articles", comment: "Refresh to Clear Read Articles")
|
||||
configureSwitch(cell, isOn: AppDefaults.refreshClearsReadArticles) { isOn in
|
||||
AppDefaults.refreshClearsReadArticles = isOn
|
||||
}
|
||||
case .confirmMarkAllAsRead:
|
||||
content.text = NSLocalizedString("Confirm Mark All as Read", comment: "Confirm Mark All as Read")
|
||||
configureSwitch(cell, isOn: AppDefaults.confirmMarkAllAsRead) { isOn in
|
||||
AppDefaults.confirmMarkAllAsRead = isOn
|
||||
}
|
||||
case .showPreviewInContextMenu:
|
||||
content.text = NSLocalizedString("Show Previews in Context Menus", comment: "Show Previews in Context Menus")
|
||||
configureSwitch(cell, isOn: AppDefaults.showPreviewInTimelineContextMenu) { isOn in
|
||||
AppDefaults.showPreviewInTimelineContextMenu = isOn
|
||||
}
|
||||
}
|
||||
cell.contentConfiguration = content
|
||||
configureBackground(cell)
|
||||
}
|
||||
|
||||
static private func configureLayoutCell(_ cell: TimelineSettingsOptionsCell, layoutRow: LayoutRow) {
|
||||
// The pop-up menu accessory shows only a chevron, so the value cell’s secondary text shows the current choice.
|
||||
var content = UIListContentConfiguration.valueCell()
|
||||
cell.isUserInteractionEnabled = true
|
||||
switch optionsRow {
|
||||
switch layoutRow {
|
||||
case .feedIcons:
|
||||
content.text = NSLocalizedString("Feed Icons", comment: "Feed Icons")
|
||||
content.secondaryText = AppDefaults.timelineFeedIconsDisplay.description
|
||||
@@ -317,7 +383,10 @@ private extension TimelineCustomizerCollectionViewController {
|
||||
}
|
||||
}
|
||||
cell.contentConfiguration = content
|
||||
configureBackground(cell)
|
||||
}
|
||||
|
||||
static func configureBackground(_ cell: TimelineSettingsOptionsCell) {
|
||||
cell.configurationUpdateHandler = { cell, state in
|
||||
var backgroundConfig = UIBackgroundConfiguration.listCell().updated(for: state)
|
||||
backgroundConfig.backgroundColor = cell.traitCollection.userInterfaceStyle == .dark ? .secondarySystemBackground : .white
|
||||
@@ -326,7 +395,7 @@ private extension TimelineCustomizerCollectionViewController {
|
||||
}
|
||||
}
|
||||
|
||||
static func configureSwitch(_ cell: TimelineCustomizerOptionsCell, isOn: Bool, switchDidChange: @escaping (Bool) -> Void) {
|
||||
static func configureSwitch(_ cell: TimelineSettingsOptionsCell, isOn: Bool, switchDidChange: @escaping (Bool) -> Void) {
|
||||
cell.switchControl.isOn = isOn
|
||||
cell.switchDidChange = switchDidChange
|
||||
cell.accessories = [.customView(configuration: .init(customView: cell.switchControl, placement: .trailing()))]
|
||||
@@ -403,19 +472,19 @@ private extension TimelineCustomizerCollectionViewController {
|
||||
}
|
||||
|
||||
/// One batch, since reconfiguring alone fails validation when a preview section’s item count has changed.
|
||||
func reloadOptionsRowsAndPreviews() {
|
||||
func reloadLayoutRowsAndPreviews() {
|
||||
collectionView.performBatchUpdates {
|
||||
let indexPaths = OptionsRow.allCases.map { IndexPath(item: $0.rawValue, section: Section.options.rawValue) }
|
||||
let indexPaths = LayoutRow.allCases.map { IndexPath(item: $0.rawValue, section: Section.layout.rawValue) }
|
||||
collectionView.reconfigureItems(at: indexPaths)
|
||||
reloadPreviews()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - TimelineCustomizerOptionsCell
|
||||
// MARK: - TimelineSettingsOptionsCell
|
||||
|
||||
/// Keeps one switch for the cell’s lifetime, since a new switch on every reconfigure animates into place.
|
||||
final class TimelineCustomizerOptionsCell: UICollectionViewListCell {
|
||||
final class TimelineSettingsOptionsCell: UICollectionViewListCell {
|
||||
|
||||
var switchDidChange: ((Bool) -> Void)?
|
||||
|
||||
Reference in new issue
Block a user