Update to latest RSCore

This commit is contained in:
Nate Weaver
2020-03-18 19:58:29 -05:00
parent 33081a3443
commit 7a9095b63a
44 changed files with 116 additions and 114 deletions

View File

@@ -143,9 +143,9 @@ private extension SidebarCell {
}
func layoutWith(_ layout: SidebarCellLayout) {
faviconImageView.rs_setFrameIfNotEqual(layout.faviconRect)
titleView.rs_setFrameIfNotEqual(layout.titleRect)
unreadCountView.rs_setFrameIfNotEqual(layout.unreadCountRect)
faviconImageView.setFrame(ifNotEqualTo: layout.faviconRect)
titleView.setFrame(ifNotEqualTo: layout.titleRect)
unreadCountView.setFrame(ifNotEqualTo: layout.unreadCountRect)
}
}

View File

@@ -24,7 +24,7 @@ struct SidebarCellLayout {
var rFavicon = NSRect.zero
if shouldShowImage {
rFavicon = NSRect(x: 0.0, y: 0.0, width: appearance.imageSize.width, height: appearance.imageSize.height)
rFavicon = RSRectCenteredVerticallyInRect(rFavicon, bounds)
rFavicon = rFavicon.centeredVertically(in: bounds)
}
self.faviconRect = rFavicon
@@ -34,7 +34,7 @@ struct SidebarCellLayout {
if shouldShowImage {
rTextField.origin.x = NSMaxX(rFavicon) + appearance.imageMarginRight
}
rTextField = RSRectCenteredVerticallyInRect(rTextField, bounds)
rTextField = rTextField.centeredVertically(in: bounds)
let unreadCountSize = unreadCountView.intrinsicContentSize
let unreadCountIsHidden = unreadCountView.unreadCount < 1
@@ -43,7 +43,7 @@ struct SidebarCellLayout {
if !unreadCountIsHidden {
rUnread.size = unreadCountSize
rUnread.origin.x = NSMaxX(bounds) - unreadCountSize.width
rUnread = RSRectCenteredVerticallyInRect(rUnread, bounds)
rUnread = rUnread.centeredVertically(in: bounds)
let textFieldMaxX = NSMinX(rUnread) - appearance.unreadCountMarginLeft
if NSMaxX(rTextField) > textFieldMaxX {
rTextField.size.width = textFieldMaxX - NSMinX(rTextField)

View File

@@ -37,9 +37,9 @@ struct PasteboardFeed: Hashable {
let isLocalFeed: Bool
init(url: String, feedID: String?, homePageURL: String?, name: String?, editedName: String?, accountID: String?, accountType: AccountType?) {
self.url = url.rs_normalizedURL()
self.url = url.normalizedURL
self.feedID = feedID
self.homePageURL = homePageURL?.rs_normalizedURL()
self.homePageURL = homePageURL?.normalizedURL
self.name = name
self.editedName = editedName
self.accountID = accountID
@@ -93,7 +93,7 @@ struct PasteboardFeed: Hashable {
}
if let foundType = pasteboardType {
if let possibleURLString = pasteboardItem.string(forType: foundType) {
if possibleURLString.rs_stringMayBeURL() {
if possibleURLString.mayBeURL {
self.init(url: possibleURLString, feedID: nil, homePageURL: nil, name: nil, editedName: nil, accountID: nil, accountType: nil)
return
}