add shape picker for backgrounds
This commit is contained in:
@@ -81,13 +81,13 @@ extension ChartDataBuildable {
|
||||
|
||||
let view = ChartType(color: moodTint.color(forMood: item.mood),
|
||||
weekDay: Int(item.weekDay),
|
||||
viewType: .square)
|
||||
shape: UserDefaultsStore.getCustomBGShape())
|
||||
filledOutArray.append(view)
|
||||
} else {
|
||||
let thisDate = Calendar.current.date(bySetting: .day, value: day, of: month)!
|
||||
let view = ChartType(color: Mood.placeholder.color,
|
||||
weekDay: Calendar.current.component(.weekday, from: thisDate),
|
||||
viewType: .square)
|
||||
shape: UserDefaultsStore.getCustomBGShape())
|
||||
filledOutArray.append(view)
|
||||
}
|
||||
}
|
||||
@@ -95,7 +95,7 @@ extension ChartDataBuildable {
|
||||
for _ in filledOutArray.count...32 {
|
||||
let view = ChartType(color: Mood.placeholder.color,
|
||||
weekDay: 2,
|
||||
viewType: .cicle)
|
||||
shape: UserDefaultsStore.getCustomBGShape())
|
||||
filledOutArray.append(view)
|
||||
}
|
||||
|
||||
|
||||
@@ -7,16 +7,10 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
enum ViewType: Hashable {
|
||||
case cicle
|
||||
case square
|
||||
case text(String)
|
||||
}
|
||||
|
||||
protocol ChartViewItemBuildable: View {
|
||||
var color: Color { get }
|
||||
var weekDay: Int { get }
|
||||
var viewType: ViewType { get }
|
||||
var shape: BGShape { get }
|
||||
|
||||
init(color: Color, weekDay: Int, viewType: ViewType)
|
||||
init(color: Color, weekDay: Int, shape: BGShape)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user