mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-14 13:13:33 +01:00
cleanup
This commit is contained in:
@@ -20,12 +20,9 @@ extension Modern.ColorsDemo.UIKit {
|
||||
|
||||
func setPalette(_ palette: Modern.ColorsDemo.Palette) {
|
||||
|
||||
self.imageView?.image = UIImage(
|
||||
color: palette.color,
|
||||
size: .init(width: 30, height: 30),
|
||||
cornerRadius: 5
|
||||
)
|
||||
self.contentView.backgroundColor = palette.color
|
||||
self.textLabel?.text = palette.colorText
|
||||
self.textLabel?.textColor = palette.brightness > 0.6 ? .black : .white
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,12 +37,12 @@ extension Modern.ColorsDemo.SwiftUI {
|
||||
return AnyView(EmptyView())
|
||||
}
|
||||
return AnyView(
|
||||
HStack {
|
||||
Color(palette.$color)
|
||||
.cornerRadius(5)
|
||||
.frame(width: 30, height: 30, alignment: .leading)
|
||||
Color(palette.$color).overlay(
|
||||
Text(palette.$colorText)
|
||||
}
|
||||
.foregroundColor(palette.$brightness > 0.6 ? .black : .white)
|
||||
.padding(),
|
||||
alignment: .leading
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ extension Modern.ColorsDemo.SwiftUI {
|
||||
Modern.ColorsDemo.SwiftUI.ItemView(palette)
|
||||
}
|
||||
)
|
||||
.listRowInsets(.init())
|
||||
}
|
||||
.onDelete { itemIndices in
|
||||
|
||||
|
||||
@@ -33,7 +33,10 @@ extension Modern.PokedexDemo {
|
||||
|
||||
let screenWidth = UIScreen.main.bounds.inset(by: layout.sectionInset).width
|
||||
let cellsPerRow: CGFloat = 3
|
||||
let cellWidth = floor((screenWidth - ((cellsPerRow - 1) * layout.minimumInteritemSpacing)) / cellsPerRow)
|
||||
let cellWidth = min(
|
||||
230,
|
||||
floor((screenWidth - ((cellsPerRow - 1) * layout.minimumInteritemSpacing)) / cellsPerRow)
|
||||
)
|
||||
layout.itemSize = .init(
|
||||
width: cellWidth,
|
||||
height: ceil(cellWidth * (4 / 3))
|
||||
|
||||
Reference in New Issue
Block a user