Skip to content

Commit

Permalink
let LazyVGrid to manage the cols automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
haren724 committed Jun 18, 2023
1 parent 2b235f5 commit 298b900
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Open Wallpaper Engine/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ struct ContentView: View {
@State var projectUrl: URL!
@State var greet: String = "Hello, world!"

let columns = [GridItem](repeating: GridItem(.flexible()), count: 4)

var body: some View {
HSplitView {
VStack(spacing: 5) {
Expand Down Expand Up @@ -231,7 +229,7 @@ struct ContentView: View {
.frame(width: isFilterReveal ? 200 : 0)
.opacity(isFilterReveal ? 1 : 0)
ScrollView {
LazyVGrid(columns: columns) {
LazyVGrid(columns: [GridItem(.adaptive(minimum: 150, maximum: 300))]) {
ForEach(0..<2, id: \.self) { index in
ZStack {
Image("sumeru")
Expand Down

0 comments on commit 298b900

Please sign in to comment.