Merge branch 'ios-candidate' of https://github.com/Ranchero-Software/NetNewsWire into ios-candidate

This commit is contained in:
Brent Simmons 2020-01-08 22:07:07 -08:00
commit 3ba89926fc
5 changed files with 15 additions and 15 deletions

View File

@ -63,7 +63,7 @@ final class IconView: NSView {
} }
override func resizeSubviews(withOldSize oldSize: NSSize) { override func resizeSubviews(withOldSize oldSize: NSSize) {
imageView.rs_setFrameIfNotEqual(rectForImageView()) imageView.setFrame(ifNotEqualTo: rectForImageView())
} }
override func draw(_ dirtyRect: NSRect) { override func draw(_ dirtyRect: NSRect) {

View File

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

View File

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

View File

@ -116,12 +116,12 @@ class TimelineTableCellView: NSTableCellView {
setFrame(for: summaryView, rect: layoutRects.summaryRect) setFrame(for: summaryView, rect: layoutRects.summaryRect)
setFrame(for: textView, rect: layoutRects.textRect) setFrame(for: textView, rect: layoutRects.textRect)
dateView.rs_setFrameIfNotEqual(layoutRects.dateRect) dateView.setFrame(ifNotEqualTo: layoutRects.dateRect)
unreadIndicatorView.rs_setFrameIfNotEqual(layoutRects.unreadIndicatorRect) unreadIndicatorView.setFrame(ifNotEqualTo: layoutRects.unreadIndicatorRect)
feedNameView.rs_setFrameIfNotEqual(layoutRects.feedNameRect) feedNameView.setFrame(ifNotEqualTo: layoutRects.feedNameRect)
iconView.rs_setFrameIfNotEqual(layoutRects.iconImageRect) iconView.setFrame(ifNotEqualTo: layoutRects.iconImageRect)
starView.rs_setFrameIfNotEqual(layoutRects.starRect) starView.setFrame(ifNotEqualTo: layoutRects.starRect)
separatorView.rs_setFrameIfNotEqual(layoutRects.separatorRect) separatorView.setFrame(ifNotEqualTo: layoutRects.separatorRect)
} }
} }
@ -172,7 +172,7 @@ private extension TimelineTableCellView {
} }
else { else {
showView(textField) showView(textField)
textField.rs_setFrameIfNotEqual(rect) textField.setFrame(ifNotEqualTo: rect)
} }
} }

View File

@ -149,7 +149,7 @@ private extension AccountsPreferencesViewController {
addChild(controller) addChild(controller)
controller.view.translatesAutoresizingMaskIntoConstraints = false controller.view.translatesAutoresizingMaskIntoConstraints = false
detailView.addSubview(controller.view) detailView.addSubview(controller.view)
detailView.rs_addFullSizeConstraints(forSubview: controller.view) detailView.addFullSizeConstraints(forSubview: controller.view)
} }