mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-28 15:44:32 +00:00
Somewhat working file tray
This commit is contained in:
parent
4c7e79b954
commit
30422c3d95
29 changed files with 4032 additions and 65 deletions
29
DynamicIsland/components/Shelf/Views/DragPreviewView.swift
Normal file
29
DynamicIsland/components/Shelf/Views/DragPreviewView.swift
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import SwiftUI
|
||||
import AppKit
|
||||
|
||||
struct DragPreviewView: View {
|
||||
let thumbnail: NSImage?
|
||||
let displayName: String
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .center, spacing: 4) {
|
||||
Image(nsImage: thumbnail ?? NSImage())
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.frame(width: 56, height: 56)
|
||||
.clipShape(RoundedRectangle(cornerRadius: 12))
|
||||
|
||||
Text(displayName)
|
||||
.font(.system(size: 12, weight: .medium))
|
||||
.foregroundColor(.white)
|
||||
.lineLimit(2)
|
||||
.truncationMode(.middle)
|
||||
.multilineTextAlignment(.center)
|
||||
.padding(.horizontal, 8)
|
||||
.padding(.vertical, 2)
|
||||
.background(RoundedRectangle(cornerRadius: 4).fill(Color.accentColor))
|
||||
.frame(alignment: .top)
|
||||
}
|
||||
.frame(width: 105)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue