Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve overall readability #74

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public final class ImageButton: CustomButton {
override public func layout() {
super.layout()

highlightView.layerBackgroundColor = .systemGray.withAlphaComponent(0.15)
highlightView.layerBackgroundColor = .highlightedBackground
highlightView.frame = bounds.insetBy(
dx: Constants.highlightViewInset,
dy: Constants.highlightViewInset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
import AppKit

public extension NSColor {
static var highlightedBackground: NSColor {
NSColor(name: nil) {
($0.isDarkMode ? NSColor.white : NSColor.black).withAlphaComponent(0.06)
}
}

@MainActor
func resolvedColor(with appearance: NSAppearance = NSApp.effectiveAppearance) -> NSColor {
var cgColor: CGColor?
Expand Down
1 change: 0 additions & 1 deletion LunarBarMac/Sources/Shared/AppDefinitions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ enum Colors {
static let controlAccent: NSColor = .controlAccentColor
static let darkGray: NSColor = .darkGray
static let primaryLabel: NSColor = .labelColor
static let systemGray: NSColor = .systemGray
static let systemTeal: NSColor = .systemTeal
static let systemOrange: NSColor = .systemOrange
}
Expand Down
2 changes: 1 addition & 1 deletion LunarBarMac/Sources/Views/DateGridCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ extension DateGridCell {
super.viewDidLayout()
containerView.frame = view.bounds

highlightView.layerBackgroundColor = Colors.systemGray.withAlphaComponent(0.15)
highlightView.layerBackgroundColor = .highlightedBackground
focusRingView.layer?.borderColor = Colors.controlAccent.cgColor
}
}
Expand Down
6 changes: 2 additions & 4 deletions LunarBarMac/Sources/Views/DateGridView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,8 @@ private extension DateGridView {
dataSource?.apply(snapshot, animatingDifferences: animated)

// Force update of certain properties that are not part of the diffable model
if !diffable {
visibleCells.forEach {
$0.updateOpacity(monthDate: monthDate)
}
visibleCells.forEach {
$0.updateOpacity(monthDate: monthDate)
}
}
}
Expand Down