mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-28 15:44:32 +00:00
Restored files from old Mac, force pushing
This commit is contained in:
parent
5dd95228b8
commit
5040381840
126 changed files with 10431 additions and 67 deletions
64
DynamicIsland/components/Notch/NotchShelfView.swift
Normal file
64
DynamicIsland/components/Notch/NotchShelfView.swift
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
|
||||
import SwiftUI
|
||||
|
||||
struct NotchShelfView: View {
|
||||
@EnvironmentObject var vm: DynamicIslandViewModel
|
||||
@StateObject var tvm = TrayDrop.shared
|
||||
|
||||
var body: some View {
|
||||
HStack {
|
||||
AirDropView()
|
||||
panel
|
||||
.onDrop(of: [.data], isTargeted: $vm.dropZoneTargeting) { providers in
|
||||
vm.dropEvent = true
|
||||
DispatchQueue.global().async {
|
||||
tvm.load(providers)
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var panel: some View {
|
||||
RoundedRectangle(cornerRadius: 16)
|
||||
.strokeBorder(style: StrokeStyle(lineWidth: 4, dash: [10]))
|
||||
.foregroundStyle(.white.opacity(0.1))
|
||||
.overlay {
|
||||
content
|
||||
.padding()
|
||||
}
|
||||
.animation(vm.animation, value: tvm.items)
|
||||
.animation(vm.animation, value: tvm.isLoading)
|
||||
}
|
||||
|
||||
var content: some View {
|
||||
Group {
|
||||
if tvm.isEmpty {
|
||||
VStack(spacing: 10) {
|
||||
Image(systemName: "tray.and.arrow.down")
|
||||
.symbolVariant(.fill)
|
||||
.symbolRenderingMode(.hierarchical)
|
||||
.foregroundStyle(.white, .gray)
|
||||
.imageScale(.large)
|
||||
|
||||
Text("Drop files here")
|
||||
.foregroundStyle(.gray)
|
||||
.font(.system(.title3, design: .rounded))
|
||||
.fontWeight(.medium)
|
||||
}
|
||||
} else {
|
||||
ScrollView(.horizontal) {
|
||||
HStack(spacing: spacing) {
|
||||
ForEach(tvm.items) { item in
|
||||
DropItemView(item: item)
|
||||
}
|
||||
}
|
||||
.padding(spacing)
|
||||
}
|
||||
.padding(-spacing)
|
||||
.scrollIndicators(.never)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue