From 6c135c80b0bd84393c662a046b475c0ba66200f8 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Wed, 29 Nov 2017 13:35:25 -0800 Subject: [PATCH] Add TimelineHeaderView. --- Evergreen.xcodeproj/project.pbxproj | 4 + Evergreen/Base.lproj/MainWindow.storyboard | 93 ++++++++++++++++--- .../Timeline/TimelineHeaderView.swift | 30 ++++++ Evergreen/Resources/DB5.plist | 5 + 4 files changed, 118 insertions(+), 14 deletions(-) create mode 100644 Evergreen/MainWindow/Timeline/TimelineHeaderView.swift diff --git a/Evergreen.xcodeproj/project.pbxproj b/Evergreen.xcodeproj/project.pbxproj index 9e72606e0..2a6356a1b 100644 --- a/Evergreen.xcodeproj/project.pbxproj +++ b/Evergreen.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 8414AD251FCF5A1E00955102 /* TimelineHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8414AD241FCF5A1E00955102 /* TimelineHeaderView.swift */; }; 8426118A1FCB67AA0086A189 /* FeedIconDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 842611891FCB67AA0086A189 /* FeedIconDownloader.swift */; }; 8426119E1FCB6ED40086A189 /* HTMLMetadataDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8426119D1FCB6ED40086A189 /* HTMLMetadataDownloader.swift */; }; 842611A01FCB72600086A189 /* FeaturedImageDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8426119F1FCB72600086A189 /* FeaturedImageDownloader.swift */; }; @@ -407,6 +408,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 8414AD241FCF5A1E00955102 /* TimelineHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelineHeaderView.swift; sourceTree = ""; }; 842611891FCB67AA0086A189 /* FeedIconDownloader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedIconDownloader.swift; sourceTree = ""; }; 8426119D1FCB6ED40086A189 /* HTMLMetadataDownloader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HTMLMetadataDownloader.swift; sourceTree = ""; }; 8426119F1FCB72600086A189 /* FeaturedImageDownloader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeaturedImageDownloader.swift; sourceTree = ""; }; @@ -693,6 +695,7 @@ 849A97691ED9EBC8007D329B /* TimelineTableRowView.swift */, 849A976A1ED9EBC8007D329B /* TimelineTableView.swift */, 84E95D231FB1087500552D99 /* ArticlePasteboardWriter.swift */, + 8414AD241FCF5A1E00955102 /* TimelineHeaderView.swift */, 849A976F1ED9EC04007D329B /* Cell */, ); path = Timeline; @@ -1412,6 +1415,7 @@ 845A29091FC74B8E007B49E3 /* SingleFaviconDownloader.swift in Sources */, 849A97851ED9ECCD007D329B /* PreferencesWindowController.swift in Sources */, 84E850861FCB60CE0072EA88 /* AuthorAvatarDownloader.swift in Sources */, + 8414AD251FCF5A1E00955102 /* TimelineHeaderView.swift in Sources */, 849A977A1ED9EC04007D329B /* TimelineTableCellView.swift in Sources */, 849A97761ED9EC04007D329B /* TimelineCellAppearance.swift in Sources */, 849A97A21ED9F180007D329B /* FeedTitleDownloader.swift in Sources */, diff --git a/Evergreen/Base.lproj/MainWindow.storyboard b/Evergreen/Base.lproj/MainWindow.storyboard index 1944e90f4..ec4a90b44 100644 --- a/Evergreen/Base.lproj/MainWindow.storyboard +++ b/Evergreen/Base.lproj/MainWindow.storyboard @@ -1,7 +1,7 @@ - + - + @@ -491,17 +491,78 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + @@ -550,10 +611,13 @@ + + - + + @@ -592,14 +656,15 @@ + - - - - - - - + + + + + + + diff --git a/Evergreen/MainWindow/Timeline/TimelineHeaderView.swift b/Evergreen/MainWindow/Timeline/TimelineHeaderView.swift new file mode 100644 index 000000000..d5a2d09b6 --- /dev/null +++ b/Evergreen/MainWindow/Timeline/TimelineHeaderView.swift @@ -0,0 +1,30 @@ +// +// TimelineHeaderView.swift +// Evergreen +// +// Created by Brent Simmons on 11/29/17. +// Copyright © 2017 Ranchero Software. All rights reserved. +// + +import Cocoa + +final class TimelineHeaderView: NSView { + + private var didConfigureLayer = false + + override var wantsUpdateLayer: Bool { + return true + } + + override func updateLayer() { + + guard !didConfigureLayer else { + return + } + if let layer = layer { + let color = appDelegate.currentTheme.color(forKey: "MainWindow.Timeline.header.backgroundColor") + layer.backgroundColor = color.cgColor + didConfigureLayer = true + } + } +} diff --git a/Evergreen/Resources/DB5.plist b/Evergreen/Resources/DB5.plist index 8c0d00c40..96d945d44 100644 --- a/Evergreen/Resources/DB5.plist +++ b/Evergreen/Resources/DB5.plist @@ -61,6 +61,11 @@ 000000 gridColorAlpha 0.1 + header + + backgroundColor + #fcfcfc + cell paddingLeft