2017-11-25 06:39:59 +01:00
|
|
|
//
|
|
|
|
// SidebarCellAppearance.swift
|
2018-08-29 07:18:24 +02:00
|
|
|
// NetNewsWire
|
2017-11-25 06:39:59 +01:00
|
|
|
//
|
|
|
|
// Created by Brent Simmons on 11/24/17.
|
|
|
|
// Copyright © 2017 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
2018-02-03 07:51:32 +01:00
|
|
|
import AppKit
|
2017-11-25 06:39:59 +01:00
|
|
|
|
|
|
|
struct SidebarCellAppearance: Equatable {
|
|
|
|
|
2020-08-09 00:07:21 +02:00
|
|
|
let imageSize: CGSize
|
2019-04-11 07:23:31 +02:00
|
|
|
let imageMarginRight: CGFloat = 4.0
|
|
|
|
let unreadCountMarginLeft: CGFloat = 10.0
|
2017-11-25 06:39:59 +01:00
|
|
|
let textFieldFontSize: CGFloat
|
|
|
|
let textFieldFont: NSFont
|
|
|
|
|
2020-08-09 00:07:21 +02:00
|
|
|
init(rowSizeStyle: NSTableView.RowSizeStyle) {
|
|
|
|
switch rowSizeStyle {
|
|
|
|
case .small:
|
|
|
|
imageSize = CGSize(width: 16, height: 16)
|
|
|
|
textFieldFontSize = 11
|
|
|
|
case .large:
|
2020-11-15 22:18:33 +01:00
|
|
|
imageSize = CGSize(width: 22, height: 22)
|
2020-08-10 18:43:18 +02:00
|
|
|
if #available(macOS 11.0, *) {
|
2020-08-09 00:07:21 +02:00
|
|
|
textFieldFontSize = 15
|
|
|
|
} else {
|
|
|
|
textFieldFontSize = 13
|
|
|
|
}
|
|
|
|
default:
|
2020-11-15 22:18:33 +01:00
|
|
|
imageSize = CGSize(width: 19, height: 19)
|
2020-08-09 00:07:21 +02:00
|
|
|
textFieldFontSize = 13
|
|
|
|
}
|
|
|
|
|
2017-11-25 06:39:59 +01:00
|
|
|
self.textFieldFont = NSFont.systemFont(ofSize: textFieldFontSize)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|