WIP - custom widget icon
This commit is contained in:
@@ -8,25 +8,98 @@
|
||||
import SwiftUI
|
||||
|
||||
class CustomIcon: ObservableObject {
|
||||
init(leftEye: AnyView,
|
||||
rightEye: AnyView,
|
||||
mouth: AnyView,
|
||||
background: [(AnyView, UUID)],
|
||||
static let numberOfBGItems = 99
|
||||
|
||||
init(leftEye: Image,
|
||||
rightEye: Image,
|
||||
mouth: Image,
|
||||
background: [(Image, UUID)],
|
||||
bgColor: Color,
|
||||
innerColor: Color) {
|
||||
innerColor: Color,
|
||||
bgOverlayColor: Color) {
|
||||
self.leftEye = leftEye
|
||||
self.rightEye = rightEye
|
||||
self.mouth = mouth
|
||||
self.background = background
|
||||
self.bgColor = bgColor
|
||||
self.innerColor = innerColor
|
||||
self.bgOverlayColor = bgOverlayColor
|
||||
}
|
||||
|
||||
@Published var leftEye: AnyView
|
||||
@Published var rightEye: AnyView
|
||||
@Published var mouth: AnyView
|
||||
@Published var leftEye: Image
|
||||
@Published var rightEye: Image
|
||||
@Published var mouth: Image
|
||||
|
||||
@Published var background: [(AnyView, UUID)]
|
||||
@Published var background: [(Image, UUID)]
|
||||
@Published var bgColor: Color
|
||||
@Published var innerColor: Color
|
||||
@Published var bgOverlayColor: Color
|
||||
}
|
||||
|
||||
enum BackGroundOptions: String, CaseIterable {
|
||||
case horrible
|
||||
case bad
|
||||
case average
|
||||
case good
|
||||
case great
|
||||
case random
|
||||
|
||||
static var selectable: [BackGroundOptions] {
|
||||
return [.great, .good, .average, .bad, .horrible]
|
||||
}
|
||||
}
|
||||
|
||||
enum Eyes {
|
||||
case left
|
||||
case right
|
||||
}
|
||||
|
||||
enum EyeOptions: String, CaseIterable {
|
||||
case fire = "fire"
|
||||
case bolt = "bolt2"
|
||||
case dollar = "dollar"
|
||||
case bell = "bell"
|
||||
case btc = "btc"
|
||||
case code = "code"
|
||||
case crown = "crown"
|
||||
case divide = "divide"
|
||||
case exclamation = "exclamation"
|
||||
case fan = "fan"
|
||||
case floppy = "floppy"
|
||||
case x = "x"
|
||||
case skull = "skull"
|
||||
case covid = "covid"
|
||||
case bomb = "bomb"
|
||||
case skull2 = "skull2"
|
||||
case poo = "poo"
|
||||
|
||||
static public var defaultOption: Image {
|
||||
let image = Image(EyeOptions.fire.rawValue, bundle: .main)
|
||||
return image
|
||||
}
|
||||
}
|
||||
|
||||
enum MouthOptions: String, CaseIterable {
|
||||
case fire = "fire"
|
||||
case bolt = "bolt2"
|
||||
case dollar = "dollar"
|
||||
case bell = "bell"
|
||||
case btc = "btc"
|
||||
case code = "code"
|
||||
case crown = "crown"
|
||||
case divide = "divide"
|
||||
case exclamation = "exclamation"
|
||||
case fan = "fan"
|
||||
case floppy = "floppy"
|
||||
case x = "x"
|
||||
case skull = "skull"
|
||||
case covid = "covid"
|
||||
case bomb = "bomb"
|
||||
case skull2 = "skull2"
|
||||
case poo = "poo"
|
||||
|
||||
static public var defaultOption: Image {
|
||||
let image = Image(MouthOptions.bomb.rawValue, bundle: .main)
|
||||
return image
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user