mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-28 16:26:04 +00:00
Line up column titles better.
This commit is contained in:
1 parent
795dafc960
commit
ef22f3280c
2 files changed
+15
-2
No files matched your search
@@ -11,7 +11,7 @@ import AppKit
|
||||
// Cell views for the timeline’s column layout. Selection state arrives through backgroundStyle,
|
||||
// which the standard NSTableRowView sets, so no custom row view is needed.
|
||||
|
||||
private let columnCellHorizontalPadding: CGFloat = 4.0
|
||||
private let columnCellHorizontalPadding: CGFloat = 8.0
|
||||
private let feedIconDimension: CGFloat = 16.0
|
||||
private let feedIconMarginRight: CGFloat = 5.0
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ enum TimelineColumn: String, CaseIterable {
|
||||
|
||||
@MainActor func makeTableColumn() -> NSTableColumn {
|
||||
let column = NSTableColumn(identifier: identifier)
|
||||
column.title = headerTitle
|
||||
column.headerCell = TimelineColumnHeaderCell(textCell: headerTitle)
|
||||
column.headerToolTip = headerToolTip
|
||||
column.sortDescriptorPrototype = NSSortDescriptor(key: sortKey.rawValue, ascending: sortsAscendingFirst)
|
||||
|
||||
@@ -125,3 +125,16 @@ enum TimelineColumn: String, CaseIterable {
|
||||
return column
|
||||
}
|
||||
}
|
||||
|
||||
/// Adds a little room between the column separator and the title, as Mail has.
|
||||
final class TimelineColumnHeaderCell: NSTableHeaderCell {
|
||||
|
||||
private static let titleLeftPadding: CGFloat = 6.0
|
||||
|
||||
override func drawInterior(withFrame cellFrame: NSRect, in controlView: NSView) {
|
||||
var frame = cellFrame
|
||||
frame.origin.x += Self.titleLeftPadding
|
||||
frame.size.width -= Self.titleLeftPadding
|
||||
super.drawInterior(withFrame: frame, in: controlView)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user