mirror of
https://github.com/yattee/yattee.git
synced 2025-04-27 23:40:35 +05:30
Fix videos layout for focusing
This commit is contained in:
parent
f397b13720
commit
0fa0518f0a
@ -15,7 +15,7 @@ struct VideosCellsView: View {
|
|||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ScrollView(.vertical, showsIndicators: false) {
|
ScrollView(.vertical, showsIndicators: false) {
|
||||||
LazyVGrid(columns: items, spacing: 10) {
|
LazyVGrid(columns: items, alignment: .center, spacing: 10) {
|
||||||
ForEach(videos) { video in
|
ForEach(videos) { video in
|
||||||
VideoCellView(video: video)
|
VideoCellView(video: video)
|
||||||
.contextMenu { VideoContextMenuView(video: video) }
|
.contextMenu { VideoContextMenuView(video: video) }
|
||||||
@ -26,6 +26,10 @@ struct VideosCellsView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var items: [GridItem] {
|
var items: [GridItem] {
|
||||||
Array(repeating: .init(.fixed(600)), count: columns)
|
Array(repeating: .init(.fixed(600)), count: gridColumns)
|
||||||
|
}
|
||||||
|
|
||||||
|
var gridColumns: Int {
|
||||||
|
videos.count < columns ? videos.count : columns
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user