This commit is contained in:
parent
72bd722def
commit
348e8734e7
@ -450,24 +450,25 @@
|
|||||||
<autoresizingMask key="autoresizingMask"/>
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="lSU-OC-sEC">
|
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="lSU-OC-sEC">
|
||||||
<rect key="frame" x="8" y="176" width="49" height="19"/>
|
<rect key="frame" x="8" y="176" width="51" height="19"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<constraint firstAttribute="height" constant="18" id="DoO-KI-ena"/>
|
<constraint firstAttribute="height" constant="18" id="DoO-KI-ena"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<popUpButtonCell key="cell" type="recessed" title="Sort" bezelStyle="recessed" alignment="center" lineBreakMode="truncatingTail" borderStyle="border" tag="1" imageScaling="proportionallyDown" inset="2" pullsDown="YES" id="bl0-6I-cH2">
|
<popUpButtonCell key="cell" type="recessed" title="Sort" bezelStyle="recessed" alignment="center" lineBreakMode="truncatingTail" borderStyle="border" tag="1" imageScaling="proportionallyDown" inset="2" pullsDown="YES" id="bl0-6I-cH2">
|
||||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES" changeBackground="YES" changeGray="YES"/>
|
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES" changeBackground="YES" changeGray="YES"/>
|
||||||
<font key="font" metaFont="controlContent" size="11"/>
|
<font key="font" metaFont="systemBold" size="11"/>
|
||||||
<menu key="menu" id="dN0-S2-uqU">
|
<menu key="menu" id="dN0-S2-uqU">
|
||||||
<items>
|
<items>
|
||||||
<menuItem title="Sort" tag="1" hidden="YES" id="4BZ-ya-evy">
|
<menuItem title="Sort" tag="1" hidden="YES" id="4BZ-ya-evy">
|
||||||
|
<attributedString key="attributedTitle"/>
|
||||||
<modifierMask key="keyEquivalentModifierMask"/>
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
</menuItem>
|
</menuItem>
|
||||||
<menuItem title="Newest To Oldest" state="on" tag="2" id="40c-kt-vhO">
|
<menuItem title="Newest Article on Top" state="on" tag="2" id="40c-kt-vhO">
|
||||||
<connections>
|
<connections>
|
||||||
<action selector="sortByNewestArticleOnTop:" target="Ebq-4s-EwK" id="vYg-MZ-zve"/>
|
<action selector="sortByNewestArticleOnTop:" target="Ebq-4s-EwK" id="vYg-MZ-zve"/>
|
||||||
</connections>
|
</connections>
|
||||||
</menuItem>
|
</menuItem>
|
||||||
<menuItem title="Oldest To Newest" tag="3" id="sOF-Ez-vIL">
|
<menuItem title="Oldest Article on Top" tag="3" id="sOF-Ez-vIL">
|
||||||
<connections>
|
<connections>
|
||||||
<action selector="sortByOldestArticleOnTop:" target="Ebq-4s-EwK" id="KFG-M7-blB"/>
|
<action selector="sortByOldestArticleOnTop:" target="Ebq-4s-EwK" id="KFG-M7-blB"/>
|
||||||
</connections>
|
</connections>
|
||||||
@ -505,10 +506,10 @@
|
|||||||
<constraint firstAttribute="trailing" secondItem="iA5-go-AO0" secondAttribute="trailing" constant="12" id="9Dl-n9-vRI"/>
|
<constraint firstAttribute="trailing" secondItem="iA5-go-AO0" secondAttribute="trailing" constant="12" id="9Dl-n9-vRI"/>
|
||||||
<constraint firstItem="lSU-OC-sEC" firstAttribute="leading" secondItem="Dnl-L5-xFP" secondAttribute="leading" constant="8" id="Ceb-sA-ECJ"/>
|
<constraint firstItem="lSU-OC-sEC" firstAttribute="leading" secondItem="Dnl-L5-xFP" secondAttribute="leading" constant="8" id="Ceb-sA-ECJ"/>
|
||||||
<constraint firstItem="Zpk-pq-9nW" firstAttribute="top" secondItem="7p6-pA-iw6" secondAttribute="bottom" id="KCa-8b-a6y"/>
|
<constraint firstItem="Zpk-pq-9nW" firstAttribute="top" secondItem="7p6-pA-iw6" secondAttribute="bottom" id="KCa-8b-a6y"/>
|
||||||
|
<constraint firstItem="lSU-OC-sEC" firstAttribute="centerY" secondItem="iA5-go-AO0" secondAttribute="centerY" id="OeL-Zp-iRT"/>
|
||||||
<constraint firstItem="Zpk-pq-9nW" firstAttribute="leading" secondItem="Dnl-L5-xFP" secondAttribute="leading" id="XF2-31-E1x"/>
|
<constraint firstItem="Zpk-pq-9nW" firstAttribute="leading" secondItem="Dnl-L5-xFP" secondAttribute="leading" id="XF2-31-E1x"/>
|
||||||
<constraint firstAttribute="trailing" secondItem="7p6-pA-iw6" secondAttribute="trailing" id="fG3-fe-Stb"/>
|
<constraint firstAttribute="trailing" secondItem="7p6-pA-iw6" secondAttribute="trailing" id="fG3-fe-Stb"/>
|
||||||
<constraint firstAttribute="bottom" secondItem="Zpk-pq-9nW" secondAttribute="bottom" id="fyv-EG-PC8"/>
|
<constraint firstAttribute="bottom" secondItem="Zpk-pq-9nW" secondAttribute="bottom" id="fyv-EG-PC8"/>
|
||||||
<constraint firstItem="iA5-go-AO0" firstAttribute="top" secondItem="Dnl-L5-xFP" secondAttribute="top" constant="5" id="nM9-iA-OzY"/>
|
|
||||||
<constraint firstItem="7p6-pA-iw6" firstAttribute="leading" secondItem="Dnl-L5-xFP" secondAttribute="leading" id="pZU-jW-B1h"/>
|
<constraint firstItem="7p6-pA-iw6" firstAttribute="leading" secondItem="Dnl-L5-xFP" secondAttribute="leading" id="pZU-jW-B1h"/>
|
||||||
<constraint firstItem="7p6-pA-iw6" firstAttribute="top" secondItem="Dnl-L5-xFP" secondAttribute="top" constant="23" id="tUm-nX-Jce"/>
|
<constraint firstItem="7p6-pA-iw6" firstAttribute="top" secondItem="Dnl-L5-xFP" secondAttribute="top" constant="23" id="tUm-nX-Jce"/>
|
||||||
<constraint firstItem="iA5-go-AO0" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="lSU-OC-sEC" secondAttribute="trailing" constant="8" id="yCg-gc-exN"/>
|
<constraint firstItem="iA5-go-AO0" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="lSU-OC-sEC" secondAttribute="trailing" constant="8" id="yCg-gc-exN"/>
|
||||||
|
@ -58,6 +58,10 @@ final class TimelineContainerViewController: NSViewController {
|
|||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
setRepresentedObjects(nil, mode: .regular)
|
setRepresentedObjects(nil, mode: .regular)
|
||||||
showTimeline(for: .regular)
|
showTimeline(for: .regular)
|
||||||
|
|
||||||
|
makeMenuItemTitleLarger(newestToOldestMenuItem)
|
||||||
|
makeMenuItemTitleLarger(oldestToNewestMenuItem)
|
||||||
|
makeMenuItemTitleLarger(groupByFeedMenuItem)
|
||||||
updateViewOptionsPopUpButton()
|
updateViewOptionsPopUpButton()
|
||||||
|
|
||||||
NotificationCenter.default.addObserver(self, selector: #selector(userDefaultsDidChange(_:)), name: UserDefaults.didChangeNotification, object: nil)
|
NotificationCenter.default.addObserver(self, selector: #selector(userDefaultsDidChange(_:)), name: UserDefaults.didChangeNotification, object: nil)
|
||||||
@ -144,6 +148,11 @@ extension TimelineContainerViewController: TimelineDelegate {
|
|||||||
|
|
||||||
private extension TimelineContainerViewController {
|
private extension TimelineContainerViewController {
|
||||||
|
|
||||||
|
func makeMenuItemTitleLarger(_ menuItem: NSMenuItem) {
|
||||||
|
menuItem.attributedTitle = NSAttributedString(string: menuItem.title,
|
||||||
|
attributes: [NSAttributedString.Key.font: NSFont.controlContentFont(ofSize: NSFont.systemFontSize)])
|
||||||
|
}
|
||||||
|
|
||||||
func timelineViewController(for mode: TimelineSourceMode) -> TimelineViewController {
|
func timelineViewController(for mode: TimelineSourceMode) -> TimelineViewController {
|
||||||
switch mode {
|
switch mode {
|
||||||
case .regular:
|
case .regular:
|
||||||
@ -165,18 +174,14 @@ private extension TimelineContainerViewController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func updateViewOptionsPopUpButton() {
|
func updateViewOptionsPopUpButton() {
|
||||||
let localizedTitle = NSLocalizedString("Sort %@", comment: "Sort")
|
|
||||||
|
|
||||||
if AppDefaults.shared.timelineSortDirection == .orderedAscending {
|
if AppDefaults.shared.timelineSortDirection == .orderedAscending {
|
||||||
newestToOldestMenuItem.state = .off
|
newestToOldestMenuItem.state = .off
|
||||||
oldestToNewestMenuItem.state = .on
|
oldestToNewestMenuItem.state = .on
|
||||||
let title = NSString.localizedStringWithFormat(localizedTitle as NSString, oldestToNewestMenuItem.title) as String
|
viewOptionsPopUpButton.setTitle(oldestToNewestMenuItem.title)
|
||||||
viewOptionsPopUpButton.setTitle(title)
|
|
||||||
} else {
|
} else {
|
||||||
newestToOldestMenuItem.state = .on
|
newestToOldestMenuItem.state = .on
|
||||||
oldestToNewestMenuItem.state = .off
|
oldestToNewestMenuItem.state = .off
|
||||||
let title = NSString.localizedStringWithFormat(localizedTitle as NSString, newestToOldestMenuItem.title) as String
|
viewOptionsPopUpButton.setTitle(newestToOldestMenuItem.title)
|
||||||
viewOptionsPopUpButton.setTitle(title)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if AppDefaults.shared.timelineGroupByFeed == true {
|
if AppDefaults.shared.timelineGroupByFeed == true {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user