refactor: remove redundant rectangle in ImageCarousel
This commit is contained in:
@@ -119,33 +119,29 @@ struct ImageCarousel: View {
|
|||||||
var body: some View {
|
var body: some View {
|
||||||
TabView {
|
TabView {
|
||||||
ForEach(urls, id: \.absoluteString) { url in
|
ForEach(urls, id: \.absoluteString) { url in
|
||||||
Rectangle()
|
GeometryReader { geo in
|
||||||
.foregroundColor(Color.clear)
|
KFAnimatedImage(url)
|
||||||
.overlay {
|
.callbackQueue(.dispatch(.global(qos:.background)))
|
||||||
GeometryReader { geo in
|
.backgroundDecode(true)
|
||||||
KFAnimatedImage(url)
|
.imageContext(.note, disable_animation: state.settings.disable_animation)
|
||||||
.callbackQueue(.dispatch(.global(qos:.background)))
|
.image_fade(duration: 0.25)
|
||||||
.backgroundDecode(true)
|
.cancelOnDisappear(true)
|
||||||
.imageContext(.note, disable_animation: state.settings.disable_animation)
|
.configure { view in
|
||||||
.image_fade(duration: 0.25)
|
view.framePreloadCount = 3
|
||||||
.cancelOnDisappear(true)
|
|
||||||
.configure { view in
|
|
||||||
view.framePreloadCount = 3
|
|
||||||
}
|
|
||||||
.imageFill(for: geo.size, max: maxHeight, fill: fillHeight) { fill in
|
|
||||||
state.previews.cache_image_meta(evid: evid, image_fill: fill)
|
|
||||||
image_fill = fill
|
|
||||||
}
|
|
||||||
.background {
|
|
||||||
Placeholder(url: url, geo_size: geo.size)
|
|
||||||
}
|
|
||||||
.aspectRatio(contentMode: filling ? .fill : .fit)
|
|
||||||
.tabItem {
|
|
||||||
Text(url.absoluteString)
|
|
||||||
}
|
|
||||||
.id(url.absoluteString)
|
|
||||||
}
|
}
|
||||||
}
|
.imageFill(for: geo.size, max: maxHeight, fill: fillHeight) { fill in
|
||||||
|
state.previews.cache_image_meta(evid: evid, image_fill: fill)
|
||||||
|
image_fill = fill
|
||||||
|
}
|
||||||
|
.background {
|
||||||
|
Placeholder(url: url, geo_size: geo.size)
|
||||||
|
}
|
||||||
|
.aspectRatio(contentMode: filling ? .fill : .fit)
|
||||||
|
.tabItem {
|
||||||
|
Text(url.absoluteString)
|
||||||
|
}
|
||||||
|
.id(url.absoluteString)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.fullScreenCover(isPresented: $open_sheet) {
|
.fullScreenCover(isPresented: $open_sheet) {
|
||||||
|
|||||||
Reference in New Issue
Block a user