spacing on custom icon widget
create color extension for random widget 512x512 ... 1024x1024 didn't work clean up Icon Widget View
This commit is contained in:
@@ -27,6 +27,13 @@ struct IconView: View {
|
||||
return CGFloat(-8)
|
||||
}
|
||||
|
||||
private var entireFuckingViewOffset: CGFloat {
|
||||
if isPreview {
|
||||
return CGFloat(0)
|
||||
}
|
||||
return CGFloat(25)
|
||||
}
|
||||
|
||||
let columns = [
|
||||
GridItem(.flexible(minimum: 1, maximum: 100), spacing: 1),
|
||||
GridItem(.flexible(minimum: 1, maximum: 100), spacing: 1),
|
||||
@@ -47,8 +54,7 @@ struct IconView: View {
|
||||
.fill(
|
||||
customIcon.bgColor
|
||||
)
|
||||
.frame(width: geo.size.width, height: geo.size.height, alignment: .center)
|
||||
.position(x: geo.size.width/2, y: geo.size.height/2)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
|
||||
LazyVGrid(columns: columns, alignment: .leading, spacing: 0) {
|
||||
ForEach(customIcon.background, id: \.self.1) { (image, uuid) in
|
||||
@@ -58,12 +64,7 @@ struct IconView: View {
|
||||
.foregroundColor(customIcon.bgOverlayColor)
|
||||
}
|
||||
}
|
||||
.frame(width: geo.size.width,
|
||||
height: geo.size.height,
|
||||
alignment: .center)
|
||||
.position(x: geo.size.width/2 + gridXOffset,
|
||||
y: geo.size.height/2 + gridYOffset)
|
||||
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.background(
|
||||
.clear
|
||||
)
|
||||
@@ -104,7 +105,7 @@ struct IconView: View {
|
||||
y: geo.size.height*0.59)
|
||||
}
|
||||
.position(x: geo.size.width/2,
|
||||
y: geo.size.height/2)
|
||||
y: geo.size.height/2 - entireFuckingViewOffset)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user