mirror of
https://github.com/dscyrescotti/Memola.git
synced 2026-03-13 05:45:23 +01:00
feat: fine tune photo preview
This commit is contained in:
@@ -34,6 +34,7 @@ struct ElementToolbar: View {
|
||||
.fill(.regularMaterial)
|
||||
}
|
||||
.padding(.bottom, 10)
|
||||
.frame(maxWidth: .infinity)
|
||||
.transition(.move(edge: .bottom).combined(with: .blurReplace))
|
||||
} else {
|
||||
compactToolbar
|
||||
@@ -196,6 +197,7 @@ struct ElementToolbar: View {
|
||||
.fill(.regularMaterial)
|
||||
}
|
||||
.padding(10)
|
||||
.frame(maxWidth: .infinity)
|
||||
.transition(.move(edge: .bottom).combined(with: .blurReplace))
|
||||
}
|
||||
|
||||
|
||||
@@ -92,6 +92,7 @@ struct MemoView: View {
|
||||
case .photo:
|
||||
if let photoItem = tool.selectedPhotoItem {
|
||||
PhotoPreview(photoItem: photoItem, tool: tool)
|
||||
.frame(maxWidth: .infinity, alignment: .trailing)
|
||||
.transition(.move(edge: .trailing))
|
||||
}
|
||||
default:
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
import SwiftUI
|
||||
|
||||
struct PhotoPreview: View {
|
||||
@Environment(\.horizontalSizeClass) var horizontalSizeClass
|
||||
|
||||
let photoItem: PhotoItem
|
||||
@ObservedObject var tool: Tool
|
||||
|
||||
@@ -15,7 +17,7 @@ struct PhotoPreview: View {
|
||||
Image(uiImage: photoItem.previewImage)
|
||||
.resizable()
|
||||
.scaledToFit()
|
||||
.frame(height: 100)
|
||||
.frame(width: horizontalSizeClass == .compact ? 80 : nil, height: horizontalSizeClass == .compact ? nil : 100)
|
||||
.cornerRadius(5)
|
||||
.overlay {
|
||||
RoundedRectangle(cornerRadius: 5)
|
||||
|
||||
Reference in New Issue
Block a user