Skip to content

Commit

Permalink
Fix quicklook dismiss on rotate (#756)
Browse files Browse the repository at this point in the history
  • Loading branch information
boscojwho authored and EricBAndrews committed Dec 18, 2023
1 parent e723731 commit 794e9c1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Mlem/Models/QuickLookState.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//
// QuickLookState.swift
// Mlem
//
// Created by Bosco Ho on 2023-11-10.
//

import Foundation

final class QuickLookState: ObservableObject {
@Published var url: URL?
}
10 changes: 10 additions & 0 deletions Mlem/Views/Shared/Cached Image.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@ struct CachedImage: View {
.frame(maxHeight: size.height)
.opacity(0.00000000001)
}
.overlay {
if isPresentingQuickLook {
ProgressView()
.padding(12)
.background(.ultraThinMaterial)
.clipShape(Circle())
.animation(.default, value: isPresentingQuickLook)
.transition(.opacity)
}
}
.onAppear {
// if the image appears and its size isn't cached, compute its size and cache it
if shouldRecomputeSize {
Expand Down

0 comments on commit 794e9c1

Please sign in to comment.