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