Skip to content
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
2 changes: 1 addition & 1 deletion Widget/WidgetExtension/Heatmap/HeatmapWidget.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct HeatmapWidget: Widget {
provider: HeatmapWidgetProvider()
) { entry in
HeatmapWidgetEntryView(entry: entry)
.containerBackground(.fill.tertiary, for: .widget)
.containerBackground(Color.surface, for: .widget)
.widgetURL(WidgetDeepLink.heatmapURL)
}
.configurationDisplayName(LocalizedStringResource("widget_heatmap_title"))
Expand Down
3 changes: 2 additions & 1 deletion Widget/WidgetExtension/Heatmap/HeatmapWidgetEntryView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct HeatmapWidgetEntryView: View {
private func content(_ snapshot: HeatmapWidgetSnapshot) -> some View {
switch widgetFamily {
case .systemSmall:
VStack(alignment: .leading, spacing: 4) {
VStack(alignment: .leading, spacing: 8) {
header(title: "widget_heatmap_current_month_title")
WidgetHeatmapGrid(
months: currentMonths(from: snapshot),
Expand Down Expand Up @@ -83,6 +83,7 @@ struct HeatmapWidgetEntryView: View {
Text(title)
.font(.headline)
.lineLimit(1)
.minimumScaleFactor(0.8)
Spacer(minLength: 0)
}
}
Expand Down
7 changes: 4 additions & 3 deletions Widget/WidgetExtension/Heatmap/WidgetHeatmapGrid.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ private struct WidgetHeatmapMonthGrid: View {

let count = dayCount(for: day)
if count == 0 {
return Color(.systemGray5)
return Color.surfaceSecondary
}

return Color.blue.opacity(opacity(for: count, max: maxCount))
return Color.accent.opacity(opacity(for: count, max: maxCount))
}

private func dayCount(for day: WidgetHeatmapDaySnapshot) -> Int {
Expand All @@ -136,7 +136,8 @@ private struct WidgetHeatmapMonthGrid: View {
private func opacity(for count: Int, max: Int) -> Double {
guard 0 < count && 0 < max else { return 0 }
let ratio = Double(count) / Double(max)
return ceil(ratio * 10) / 10
let level = min(Int(ceil(ratio * 4)), 4)
return 0.2 + 0.2 * Double(level)
}
}

Expand Down
6 changes: 3 additions & 3 deletions Widget/WidgetExtension/Heatmap/WidgetHeatmapLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ struct WidgetHeatmapLayout {
max(2, cellSize * 0.2)
}

private static let baseCellSpacing: CGFloat = 3
private static let baseMonthSpacing: CGFloat = 10
private static let baseCellSpacing: CGFloat = 4
private static let baseMonthSpacing: CGFloat = 12
private static let maxMonthSpacing: CGFloat = 26
private static let baseMonthTitleSpacing: CGFloat = 4
private static let baseMonthTitleSpacing: CGFloat = 6

private static func resolvedMonthTitleSpacing(showsMonthTitles: Bool) -> CGFloat {
// 월 제목을 표시하는 Medium에서만 제목과 셀 사이 간격을 확보한다.
Expand Down
Loading