Browse Source

Changed the layout of the image to be a bit more UI friendly

Changelog-Changed: Show rounded corners on inline images
post-button-style
Sam DuBois 2 years ago
committed by William Casarin
parent
commit
4a83d370d2
  1. 6
      damus/Components/ImageCarousel.swift

6
damus/Components/ImageCarousel.swift

@ -121,6 +121,8 @@ 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()
.overlay {
KFAnimatedImage(url) KFAnimatedImage(url)
.configure { view in .configure { view in
view.framePreloadCount = 3 view.framePreloadCount = 3
@ -129,13 +131,15 @@ struct ImageCarousel: View {
.loadDiskFileSynchronously() .loadDiskFileSynchronously()
.scaleFactor(UIScreen.main.scale) .scaleFactor(UIScreen.main.scale)
.fade(duration: 0.1) .fade(duration: 0.1)
.aspectRatio(contentMode: .fit) .aspectRatio(contentMode: .fill)
.tabItem { .tabItem {
Text(url.absoluteString) Text(url.absoluteString)
} }
.id(url.absoluteString) .id(url.absoluteString)
} }
} }
}
.cornerRadius(10)
.sheet(isPresented: $open_sheet) { .sheet(isPresented: $open_sheet) {
ImageViewer(urls: urls) ImageViewer(urls: urls)
} }

Loading…
Cancel
Save