damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit 4a83d370d27021ca52222400fa6de0045ab61d3a
parent 898a880a15a12f8e8135373851740c2f03d9fbd9
Author: Sam DuBois <sdubois@umass.edu>
Date:   Thu, 22 Dec 2022 13:49:10 -0700

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

Changelog-Changed: Show rounded corners on inline images

Diffstat:
Mdamus/Components/ImageCarousel.swift | 28++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/damus/Components/ImageCarousel.swift b/damus/Components/ImageCarousel.swift @@ -121,21 +121,25 @@ struct ImageCarousel: View { var body: some View { TabView { ForEach(urls, id: \.absoluteString) { url in - KFAnimatedImage(url) - .configure { view in - view.framePreloadCount = 3 + Rectangle() + .overlay { + KFAnimatedImage(url) + .configure { view in + view.framePreloadCount = 3 + } + .cacheOriginalImage() + .loadDiskFileSynchronously() + .scaleFactor(UIScreen.main.scale) + .fade(duration: 0.1) + .aspectRatio(contentMode: .fill) + .tabItem { + Text(url.absoluteString) + } + .id(url.absoluteString) } - .cacheOriginalImage() - .loadDiskFileSynchronously() - .scaleFactor(UIScreen.main.scale) - .fade(duration: 0.1) - .aspectRatio(contentMode: .fit) - .tabItem { - Text(url.absoluteString) - } - .id(url.absoluteString) } } + .cornerRadius(10) .sheet(isPresented: $open_sheet) { ImageViewer(urls: urls) }