Skip to content

Commit

Permalink
Small tweaks to the week numbers appearance
Browse files Browse the repository at this point in the history
  • Loading branch information
pakerwreah committed Mar 26, 2021
1 parent 6639a3a commit 533dd48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Calendr/Calendar/CalendarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class CalendarView: NSView {

private func setUpBindings() {

let weekNumbersWidth = settings.showWeekNumbers.map { $0 ? Constants.cellSize : 0 }
let weekNumbersWidth = settings.showWeekNumbers.map { $0 ? Constants.weekNumberCellSize : 0 }

weekNumbersWidth
.observe(on: MainScheduler.instance)
Expand Down Expand Up @@ -134,6 +134,7 @@ class CalendarView: NSView {
private enum Constants {

static let cellSize: CGFloat = 25
static let weekNumberCellSize: CGFloat = 21
static let cornerRadius: CGFloat = 5
static let weekendBackgroundColor = NSColor.gray.cgColor.copy(alpha: 0.2)
}
6 changes: 2 additions & 4 deletions Calendr/Calendar/WeekNumberCellView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@ class WeekNumberCellView: NSView {

addSubview(label)

label.alignment = .center
label.textColor = .secondaryLabelColor
label.font = .systemFont(ofSize: 12, weight: .medium)
label.size(equalTo: CGSize(width: 24, height: 13))
label.center(in: self, constant: CGPoint(x: 0, y: -3))
label.font = .systemFont(ofSize: 10)
label.center(in: self, constant: CGPoint(x: -2, y: 0))
}

required init?(coder: NSCoder) {
Expand Down

0 comments on commit 533dd48

Please sign in to comment.