Neues Design 'Leuchttisch' (warmes Graphit, Bernstein-Akzent) für alle Fenster; Lupe im Studio-Layout (Filmstreifen + IPTC-Panel mit ⌘N/⌘B); Matchday-Ansicht (Teamleiste, Spielerinnen-Liste, Teamfilter, Kacheln mit Teamfarbe + Nummer)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012bGzgsxrmbBhDzeMV2L57D
This commit is contained in:
Lichtkasten DevandClaude Opus 5.5 committed 2026-11-04 15:40:53 +00:00
1 parent 44f995c3d0
commit 7a349b8c34
13 files changed
+920 -203

No files matched your search

+106 -71
View File
@@ -18,6 +18,7 @@ struct ContactSheetView: View {
isCursor: state.cursorID == item.id,
imageURL: state.previewURL(for: item),
badge: state.suggestionBadge(for: item.id),
player: state.matchdayActive ? state.playerInfo(for: item) : nil,
onTagClick: { tagClick(item) })
.equatable()
.id(item.id)
@@ -29,7 +30,7 @@ struct ContactSheetView: View {
}
.padding(10)
}
.background(Color(white: 0.22))
.background(LK.ground)
.onChange(of: state.cursorID) { _, id in
if let id { proxy.scrollTo(id) }
}
@@ -108,113 +109,147 @@ struct ThumbnailCell: View, Equatable {
let imageURL: URL
/// open jersey suggestions ("#10 #7")
let badge: String?
/// Matchday: main player (team color edge + big number)
let player: AppState.PlayerInfo?
let onTagClick: () -> Void
@State private var image: NSImage?
static func == (a: ThumbnailCell, b: ThumbnailCell) -> Bool {
a.item == b.item && a.size == b.size && a.selected == b.selected && a.isCursor == b.isCursor && a.imageURL == b.imageURL && a.badge == b.badge
a.item == b.item && a.size == b.size && a.selected == b.selected && a.isCursor == b.isCursor && a.imageURL == b.imageURL && a.badge == b.badge && a.player == b.player
}
/// PM shows the selection as a pale yellow card.
private static let selectedFill = Color(red: 0.93, green: 0.96, blue: 0.68)
private var dateLine: String {
guard let d = item.captureDate else { return "" }
return ThumbnailCell.dateFormatter.string(from: d)
}
private static let dateFormatter: DateFormatter = {
private static let timeFormatter: DateFormatter = {
let f = DateFormatter()
f.dateFormat = "dd.MM.yyyy - HH:mm:ss"
f.dateFormat = "HH:mm:ss"
return f
}()
private var cameraLine: String {
var lens: [String] = []
if let fl = item.exif["FocalLength"] { lens.append(fl.replacingOccurrences(of: ".0 mm", with: "mm").replacingOccurrences(of: " mm", with: "mm")) }
if let f = item.exif["FNumber"] { lens.append(f) }
let left = lens.joined(separator: " ")
let model = item.exif["Model"] ?? ""
return [left, model].filter { !$0.isEmpty }.joined(separator: " - ")
private var timeLine: String {
item.captureDate.map { ThumbnailCell.timeFormatter.string(from: $0) } ?? ""
}
var body: some View {
let textColor: Color = selected ? .black : .primary
VStack(spacing: 2) {
VStack(alignment: .leading, spacing: 0) {
ZStack {
Rectangle().fill(LK.deep)
if let image {
Image(nsImage: image).resizable().interpolation(.medium).scaledToFit()
.shadow(color: .black.opacity(0.4), radius: 2, y: 1)
} else {
ProgressView().controlSize(.small)
}
}
.frame(width: size - 14, height: (size - 14) * 0.75)
.overlay(alignment: .topTrailing) {
if let badge {
Text(badge)
.font(.system(size: 10, weight: .bold).monospacedDigit())
.foregroundStyle(.white)
.padding(.horizontal, 5).padding(.vertical, 2)
.background(Capsule().fill(Color.blue.opacity(0.85)))
.padding(4)
.help("Spieler-Vorschlag – mit I prüfen und annehmen")
.frame(width: size - 20, height: (size - 20) * 0.72)
.clipShape(RoundedRectangle(cornerRadius: 8))
// Matchday: team color edge
.overlay(alignment: .leading) {
if let t = player?.team {
UnevenRoundedRectangle(topLeadingRadius: 8, bottomLeadingRadius: 8)
.fill(t.shirtColor.swiftUI).frame(width: 5)
}
}
.padding(.top, 6)
VStack(spacing: 0) {
Text(item.filename).lineLimit(1).truncationMode(.middle)
Text(dateLine).lineLimit(1)
Text(item.iptc.text["headline"] ?? " ").lineLimit(1).truncationMode(.middle)
Text(cameraLine.isEmpty ? " " : cameraLine).lineLimit(1)
}
.font(.system(size: 11))
.foregroundStyle(textColor)
.frame(maxWidth: .infinity)
HStack(spacing: 6) {
// PM: color class bar with the rating dots/stars inside
ZStack {
Capsule().fill(item.label?.color ?? Color.gray.opacity(0.35))
HStack(spacing: 6) {
ForEach(1...5, id: \.self) { n in
if n <= item.rating {
Image(systemName: "star.fill").font(.system(size: 8))
} else {
Circle().frame(width: 3, height: 3)
}
// tag: amber check, top left
.overlay(alignment: .topLeading) {
Button(action: onTagClick) {
Group {
if item.tagged {
Image(systemName: "checkmark")
.font(.system(size: 11, weight: .heavy))
.foregroundStyle(LK.onAmber)
.frame(width: 22, height: 22)
.background(RoundedRectangle(cornerRadius: 6).fill(LK.amber))
} else {
RoundedRectangle(cornerRadius: 6).stroke(Color.white.opacity(selected || isCursor ? 0.6 : 0.0), lineWidth: 1.5)
.frame(width: 22, height: 22)
}
}
.foregroundStyle(item.label == nil ? Color.primary.opacity(0.6) : Color.white)
}
.frame(height: 12)
Button(action: onTagClick) {
Image(systemName: item.tagged ? "checkmark.square.fill" : "square")
.font(.system(size: 14))
.foregroundStyle(item.tagged ? (selected ? Color.black : Color.white) : Color.secondary)
.padding(8)
.contentShape(Rectangle())
}
.buttonStyle(.plain)
.help("Tag (T)")
}
.padding(.horizontal, 8)
.padding(.bottom, 6)
// open player suggestion
.overlay(alignment: .bottomTrailing) {
if let badge {
Text(badge)
.font(LK.mono(11, .semibold))
.foregroundStyle(LK.amber)
.padding(.horizontal, 8).padding(.vertical, 3)
.background(Capsule().fill(LK.deep.opacity(0.88)))
.padding(8)
.help("Spieler-Vorschlag – prüfen mit I oder in der Lupe")
}
}
if let player {
// Matchday line: number in team color + name
HStack(spacing: 8) {
Text(player.number.map(String.init) ?? "–")
.font(.system(size: 20, weight: .heavy, design: .rounded))
.foregroundStyle(player.team?.shirtColor.swiftUI ?? LK.text2)
.frame(minWidth: 26, alignment: .leading)
VStack(alignment: .leading, spacing: 1) {
Text(player.name + (player.confirmed ? "" : " ?"))
.font(.system(size: 12, weight: .semibold)).foregroundStyle(LK.text).lineLimit(1)
Text(timeLine).font(LK.mono(11)).foregroundStyle(LK.muted)
}
Spacer(minLength: 2)
stars
}
.padding(.top, 9)
} else {
HStack(spacing: 8) {
Circle().fill(item.label?.lkColor ?? LK.faint).frame(width: 9, height: 9)
Text(item.filename).font(LK.mono(11.5, .medium)).foregroundStyle(LK.text)
.lineLimit(1).truncationMode(.middle)
if !item.companions.isEmpty {
Text(item.companions.map { $0.pathExtension.uppercased() }.joined(separator: "+"))
.font(.system(size: 9, weight: .bold)).foregroundStyle(LK.muted)
}
}
.padding(.top, 9)
HStack {
Text(timeLine).font(LK.mono(11)).foregroundStyle(LK.muted)
if !item.iptc.isEmpty(Self.captionField) {
Image(systemName: "text.alignleft").font(.system(size: 9)).foregroundStyle(LK.muted)
.help("Hat Bildunterschrift")
}
Spacer()
stars
}
.padding(.top, 3)
}
}
.padding(10)
.frame(width: size)
.background(
RoundedRectangle(cornerRadius: 2)
.fill(selected ? ThumbnailCell.selectedFill : Color(white: 0.30))
)
.background(RoundedRectangle(cornerRadius: 12).fill(selected ? LK.selected : LK.card))
.overlay(
RoundedRectangle(cornerRadius: 2)
.strokeBorder(isCursor ? Color.accentColor : .clear, lineWidth: 2)
RoundedRectangle(cornerRadius: 12)
.stroke(selected ? LK.amber : (isCursor ? LK.amber.opacity(0.5) : Color.clear), lineWidth: selected ? 2 : 1)
)
.shadow(color: selected ? LK.amber.opacity(0.18) : .clear, radius: 14, y: 6)
.overlay(alignment: .topTrailing) {
// color class as small tab in the corner (matchday shows team instead of the dot line)
if player != nil, let l = item.label {
Circle().fill(l.lkColor).frame(width: 9, height: 9).padding(16)
}
}
.task(id: imageURL) {
image = ImageLoader.shared.cachedThumbnail(imageURL)
if image == nil { image = await ImageLoader.shared.thumbnail(for: imageURL) }
}
}
private static let captionField = IPTCField.byID["caption"]!
private var stars: some View {
HStack(spacing: 1) {
ForEach(0..<item.rating, id: \.self) { _ in
Image(systemName: "star.fill").font(.system(size: 9))
}
}
.foregroundStyle(LK.amber)
}
}
extension ColorLabel {
+103 -84
View File
@@ -16,8 +16,9 @@ struct ContentView: View {
} detail: {
VStack(spacing: 0) {
TabBar()
if state.folder != nil && state.matchdayActive { MatchdayHeader() }
if state.folder != nil { ContactSheetHeader() }
Divider()
Rectangle().fill(LK.border).frame(height: 1)
if state.folder == nil {
EmptyStateView()
} else if state.items.isEmpty && !state.loadingMetadata {
@@ -29,7 +30,10 @@ struct ContentView: View {
}
PMStatusBar()
}
.background(LK.ground)
}
.preferredColorScheme(.dark)
.tint(LK.amber)
.navigationTitle(state.folder?.lastPathComponent ?? "Lichtkasten")
.toolbar { MainToolbar() }
.searchable(text: $state.searchText, placement: .toolbar, prompt: "Dateiname, IPTC …")
@@ -117,36 +121,41 @@ struct TabBar: View {
@EnvironmentObject var state: AppState
var body: some View {
HStack(spacing: 4) {
HStack(spacing: 6) {
ForEach(state.tabs, id: \.self) { url in
let active = state.folder == url
HStack(spacing: 6) {
Button { state.closeTab(url) } label: { Image(systemName: "xmark.circle.fill") }
.buttonStyle(.plain).foregroundStyle(.secondary)
Image(systemName: "folder.fill").foregroundStyle(.secondary)
Text(url.lastPathComponent).lineLimit(1)
HStack(spacing: 8) {
Button { state.closeTab(url) } label: { Image(systemName: "xmark").font(.system(size: 9, weight: .bold)) }
.buttonStyle(.plain).foregroundStyle(LK.muted)
.help("Tab schließen")
Text(url.lastPathComponent).font(.system(size: 13, weight: active ? .bold : .medium)).lineLimit(1)
.foregroundStyle(active ? LK.text : LK.text2)
if active {
Text("\(state.visible.count)")
.font(.caption.monospacedDigit())
.padding(.horizontal, 5)
.background(Capsule().fill(Color.secondary.opacity(0.3)))
.font(LK.mono(11, .medium))
.foregroundStyle(LK.onAmber)
.padding(.horizontal, 7).padding(.vertical, 1)
.background(Capsule().fill(LK.amber))
}
}
.padding(.horizontal, 8)
.padding(.vertical, 3)
.background(RoundedRectangle(cornerRadius: 5).fill(active ? Color.secondary.opacity(0.28) : Color.clear))
.padding(.horizontal, 12)
.frame(height: 30)
.background(RoundedRectangle(cornerRadius: 8).fill(active ? LK.selected : Color.clear))
.overlay(RoundedRectangle(cornerRadius: 8).stroke(active ? LK.borderStrong : Color.clear))
.contentShape(Rectangle())
.onTapGesture { state.open(folder: url) }
.help(url.path)
}
Button { state.newTab() } label: { Image(systemName: "plus.circle") }
Button { state.newTab() } label: { Image(systemName: "plus").font(.system(size: 12, weight: .semibold)) }
.buttonStyle(.plain)
.help("Neuer Tab")
.foregroundStyle(LK.muted)
.frame(width: 28, height: 28)
.help("Neuer Tab (⌘T)")
Spacer()
}
.padding(.horizontal, 8)
.padding(.vertical, 4)
.background(.bar)
.padding(.horizontal, 14)
.padding(.vertical, 6)
.background(LK.bar)
}
}
@@ -156,78 +165,74 @@ struct ContactSheetHeader: View {
@EnvironmentObject var state: AppState
var body: some View {
HStack(spacing: 12) {
HStack(spacing: 14) {
LKSegmented(options: [(TagFilter.all, "Alle"), (TagFilter.tagged, "Getaggt"), (TagFilter.untagged, "Nicht getaggt")],
selection: $state.filter.tag)
Button { state.filter.suggestionsOnly.toggle() } label: {
Label("Vorschläge", systemImage: "person.text.rectangle")
.font(.system(size: 12, weight: .semibold))
.foregroundStyle(state.filter.suggestionsOnly ? LK.onAmber : LK.text2)
.padding(.horizontal, 10).frame(height: 28)
.background(RoundedRectangle(cornerRadius: 8).fill(state.filter.suggestionsOnly ? LK.amber : LK.raised))
}
.buttonStyle(.plain)
.help("Nur Bilder mit offenen Spieler-Vorschlägen")
Menu {
Picker("Sortierung", selection: $state.sortOrder) {
ForEach(SortOrder.allCases, id: \.self) { Text($0.rawValue).tag($0) }
}
Toggle("Umkehren", isOn: $state.reverseSort)
} label: {
Text("\(state.sortOrder.rawValue) \(state.reverseSort ? "↑" : "↓")").font(.system(size: 13)).foregroundStyle(LK.text2)
}
.menuStyle(.borderlessButton)
.fixedSize()
Slider(value: $state.settings.thumbnailSize, in: 120...max(200, state.settings.maxThumbnailSize))
.frame(width: 140)
.frame(width: 120)
.help("Vorschaugröße")
Picker("", selection: $state.sortOrder) {
ForEach(SortOrder.allCases, id: \.self) { Text($0.rawValue).tag($0) }
}
.labelsHidden()
.frame(width: 140)
Toggle("Umkehren", isOn: $state.reverseSort).toggleStyle(.checkbox)
Picker("", selection: $state.filter.tag) {
ForEach(TagFilter.allCases, id: \.self) { Text($0.rawValue).tag($0) }
}
.labelsHidden()
.frame(width: 130)
Spacer(minLength: 8)
// Stars filter (PM: checkbox + 0★…5★ toggles)
Toggle("", isOn: $state.filter.ratingOn).toggleStyle(.checkbox).labelsHidden()
.help("Nach Sternen filtern")
HStack(spacing: 0) {
// Stars: toggles 0…5 (several possible), amber when on
HStack(spacing: 2) {
ForEach(0...5, id: \.self) { n in
let on = state.filter.ratings.contains(n)
Button { toggle(rating: n) } label: {
Text("\(n)★").font(.system(size: 11, weight: on ? .bold : .regular))
.frame(width: 30, height: 20)
.background(on ? Color.accentColor.opacity(0.45) : Color.secondary.opacity(0.15))
Text(n == 0 ? "0" : String(repeating: "★", count: 1) + "\(n)")
.font(.system(size: 11, weight: on ? .bold : .medium))
.foregroundStyle(on ? LK.onAmber : LK.text2)
.frame(width: 30, height: 24)
.background(RoundedRectangle(cornerRadius: 6).fill(on ? LK.amber : LK.raised))
}
.buttonStyle(.plain)
.help(n == 0 ? "Ohne Sterne" : "\(n) Stern(e)")
}
}
.clipShape(RoundedRectangle(cornerRadius: 4))
.opacity(state.filter.ratingOn ? 1 : 0.5)
Toggle(isOn: $state.filter.suggestionsOnly) {
Label("Vorschläge", systemImage: "person.text.rectangle")
}
.toggleStyle(.button)
.help("Nur Bilder mit offenen Spieler-Vorschlägen (Trikotnummern)")
Rectangle().fill(LK.borderStrong).frame(width: 1, height: 22)
// Color class filter (PM: checkbox + color swatches, last = no color)
Toggle("", isOn: $state.filter.colorOn).toggleStyle(.checkbox).labelsHidden()
.help("Nach Farbklasse filtern")
HStack(spacing: 0) {
ForEach(ColorLabel.allCases, id: \.self) { l in
swatch(l.color, n: l.pmColorClass, help: "\(l.pmColorClass) – \(l.germanName)")
}
swatch(.clear, n: 0, help: "Ohne Farbklasse")
// Color classes as dots; ring = active filter
HStack(spacing: 7) {
ForEach(ColorLabel.allCases, id: \.self) { l in dot(l.lkColor, n: l.pmColorClass, help: "\(l.pmColorClass) – \(l.germanName)") }
dot(LK.faint, n: 0, help: "Ohne Farbklasse")
}
.clipShape(RoundedRectangle(cornerRadius: 4))
.opacity(state.filter.colorOn ? 1 : 0.5)
}
.padding(.horizontal, 10)
.padding(.vertical, 6)
.padding(.horizontal, 20)
.frame(height: 54)
.background(LK.ground)
}
private func swatch(_ c: Color, n: Int, help: String) -> some View {
private func dot(_ c: Color, n: Int, help: String) -> some View {
let on = state.filter.colors.contains(n)
return Button { toggle(color: n) } label: {
ZStack {
if n == 0 {
Image(systemName: "checkerboard.rectangle").font(.system(size: 12)).foregroundStyle(.secondary)
} else {
c
}
if on { Image(systemName: "checkmark").font(.system(size: 10, weight: .bold)).foregroundStyle(.white).shadow(radius: 1) }
}
.frame(width: 20, height: 20)
.overlay(Rectangle().stroke(on ? Color.white : Color.clear, lineWidth: 1.5))
Circle().fill(c)
.frame(width: 15, height: 15)
.overlay(Circle().stroke(LK.ground, lineWidth: on ? 2 : 0).padding(-2))
.overlay(Circle().stroke(on ? c : Color.clear, lineWidth: 2).padding(-4))
.frame(width: 22, height: 22)
.contentShape(Rectangle())
}
.buttonStyle(.plain)
.help(help)
@@ -253,14 +258,13 @@ struct PMStatusBar: View {
var body: some View {
HStack(spacing: 12) {
if state.loadingMetadata { ProgressView().controlSize(.small) }
Text(summary).lineLimit(1).truncationMode(.middle)
Text(summary).lineLimit(1).truncationMode(.middle).foregroundStyle(LK.text2)
Spacer()
if state.lrPendingCount > 0 { Label("LR: \(state.lrPendingCount)", systemImage: "hourglass") }
if uploads.activeCount > 0 {
Label(uploads.rate > 0 ? "\(uploads.activeCount) Upload(s) · \(uploads.rateText)" : "\(uploads.activeCount) Upload(s) …",
systemImage: "arrow.up.circle.fill")
.foregroundStyle(Color.accentColor)
.monospacedDigit()
.foregroundStyle(LK.amber)
.onTapGesture { state.openWindow("tasks") }
}
if uploads.failedCount > 0 {
@@ -270,10 +274,12 @@ struct PMStatusBar: View {
}
if !state.statusText.isEmpty { Text(state.statusText).foregroundStyle(.secondary).lineLimit(1) }
}
.font(.system(size: 11))
.padding(.horizontal, 10)
.padding(.vertical, 4)
.background(.bar)
.font(LK.mono(11))
.foregroundStyle(LK.muted)
.padding(.horizontal, 20)
.frame(height: 30)
.background(LK.ground)
.overlay(alignment: .top) { Rectangle().fill(LK.border).frame(height: 1) }
}
/// "Ausgewählt 1 von 2189 (3,22 MB) | 2189 gesamt | /Users/…/datei.jpg" like PM.
@@ -340,19 +346,29 @@ struct PMSidebar: View {
.buttonStyle(.borderless).help("Aufgaben-Fenster (⌘⌥U)")
}
.frame(minHeight: 80, idealHeight: 150)
if state.matchdayActive {
panel("Spielerinnen") { MatchdayPlayerList() } accessory: {
if state.filter.person != nil || state.filter.team != nil || state.filter.withoutPlayer {
Button("Alle") { state.setTeamFilter(nil) }.buttonStyle(.borderless).font(.system(size: 11))
}
}
.frame(minHeight: 120, idealHeight: 260)
}
}
.background(LK.panel)
}
private func panel<C: View, A: View>(_ title: String, @ViewBuilder content: () -> C, @ViewBuilder accessory: () -> A) -> some View {
VStack(spacing: 0) {
HStack {
Text(title).font(.system(size: 12, weight: .semibold))
LKSectionLabel(title: title)
Spacer()
accessory()
}
.padding(.horizontal, 10)
.padding(.vertical, 5)
.background(Color.secondary.opacity(0.12))
.padding(.horizontal, 16)
.padding(.top, 14)
.padding(.bottom, 6)
content()
}
}
@@ -433,9 +449,12 @@ struct FolderTreeRow: View {
.fontWeight(state.folder == url ? .semibold : .regular)
Spacer()
}
.padding(.leading, CGFloat(depth) * 14 + 6)
.padding(.vertical, 2)
.background(state.folder == url ? Color.accentColor.opacity(0.25) : Color.clear)
.padding(.leading, CGFloat(depth) * 14 + 10)
.padding(.trailing, 8)
.padding(.vertical, 5)
.foregroundStyle(state.folder == url ? LK.amber : LK.text)
.background(RoundedRectangle(cornerRadius: 7).fill(state.folder == url ? LK.selected : Color.clear))
.padding(.horizontal, 8)
.contentShape(Rectangle())
.onTapGesture(count: 1) {
state.open(folder: url)
+10 -11
View File
@@ -17,19 +17,18 @@ extension IPTCValues {
}
}
/// PM's blue section header bar.
/// Section header (same order as PM, Leuchttisch look: amber label + hairline).
struct PMSectionHeader: View {
let title: String
var body: some View {
Text(title)
.font(.system(size: 13, weight: .semibold))
.foregroundStyle(.white)
.frame(maxWidth: .infinity)
.padding(.vertical, 3)
.background(
Capsule().fill(LinearGradient(colors: [Color(red: 0.30, green: 0.55, blue: 0.90), Color(red: 0.14, green: 0.38, blue: 0.75)],
startPoint: .top, endPoint: .bottom))
)
HStack(spacing: 10) {
Text(title.uppercased())
.font(.system(size: 11, weight: .bold))
.tracking(1.3)
.foregroundStyle(LK.amber)
Rectangle().fill(LK.border).frame(height: 1)
}
.padding(.top, 6)
}
}
@@ -127,7 +126,7 @@ struct PMFieldRow: View {
VStack(alignment: .leading, spacing: 2) {
Text(field.pmLabel + ":")
.font(.system(size: 12))
.foregroundStyle(isDirty ? Color.accentColor : .primary)
.foregroundStyle(isDirty ? LK.amber : .primary)
.help(field.label)
// IIM limit: for keywords etc. it applies to each entry, not to the whole field.
if let max = field.iimMaxBytes, !text.contains("{") {
@@ -96,7 +96,7 @@ struct IPTCInfoWindow: View {
if !open.isEmpty, let item {
VStack(alignment: .leading, spacing: 6) {
HStack {
Image(systemName: "person.text.rectangle").foregroundStyle(Color.accentColor)
Image(systemName: "person.text.rectangle").foregroundStyle(LK.amber)
Text("Erkannt:").bold()
Spacer()
if acceptable.count > 1 {
@@ -137,7 +137,7 @@ struct IPTCInfoWindow: View {
}
}
.padding(10)
.background(Color.accentColor.opacity(0.10))
.background(LK.amber.opacity(0.10))
Divider()
}
}
@@ -171,7 +171,7 @@ struct JerseySetupView: View {
RoundedRectangle(cornerRadius: 4)
.fill(Color(red: c.r, green: c.g, blue: c.b))
.frame(width: 34, height: 24)
.overlay(RoundedRectangle(cornerRadius: 4).stroke(active ? Color.accentColor : Color.secondary, lineWidth: active ? 3 : 1))
.overlay(RoundedRectangle(cornerRadius: 4).stroke(active ? LK.amber : Color.secondary, lineWidth: active ? 3 : 1))
Text(shorts ? "Hose" : "Trikot").font(.caption2)
}
}
@@ -0,0 +1,200 @@
import SwiftUI
import LichtkastenCore
/// Right panel of the loupe (layout B): rating, color class, player suggestion and the IPTC fields
/// you change per image – saving with ⌘N / ⌘B like in the IPTC window. All other fields: I.
struct LoupeInspector: View {
@EnvironmentObject var state: AppState
@State private var texts: FieldTexts = [:]
@State private var dirty: Set<String> = []
@State private var loadedID: String?
@State private var saving = false
private var item: PhotoItem? { state.cursorItem }
private static let quickFields = ["caption", "headline", "keywords", "personInImage", "event", "city", "sublocation", "dateCreated"]
var body: some View {
VStack(spacing: 0) {
header
Rectangle().fill(LK.border).frame(height: 1)
ScrollView {
VStack(alignment: .leading, spacing: 14) {
suggestions
LKSectionLabel(title: "Bildinhalt")
field("caption", "Beschreibung", height: 150)
field("headline", "Überschrift", height: 50)
field("keywords", "Stichwörter", height: 70)
field("personInImage", "Personen")
LKSectionLabel(title: "Ort").padding(.top, 4)
HStack(alignment: .top, spacing: 10) {
field("city", "Stadt")
field("sublocation", "Ort")
}
field("event", "Ereignis")
VStack(alignment: .leading, spacing: 5) {
Text("Datum").font(.system(size: 12)).foregroundStyle(LK.text2)
DateFieldEditor(text: binding("dateCreated"))
}
Button("Alle IPTC-Felder … (I)") { state.openWindow("iptc") }
.buttonStyle(LKButtonStyle(compact: true))
}
.padding(18)
}
Rectangle().fill(LK.border).frame(height: 1)
HStack(spacing: 8) {
Button("← Speichern ⌘N") { saveAndMove(-1) }
.keyboardShortcut("n", modifiers: .command)
.buttonStyle(LKButtonStyle())
.frame(maxWidth: .infinity)
Button("Speichern → ⌘B") { saveAndMove(1) }
.keyboardShortcut("b", modifiers: .command)
.buttonStyle(LKButtonStyle(primary: true))
.frame(maxWidth: .infinity)
}
.padding(14)
.disabled(item == nil || saving)
}
.background(LK.panel)
.onAppear { load(force: true) }
.onChange(of: state.cursorID) { _, _ in load(force: true) }
.onReceive(state.$items) { _ in if dirty.isEmpty { DispatchQueue.main.async { load(force: false) } } }
}
// MARK: Header: name, stars, color class
private var header: some View {
VStack(alignment: .leading, spacing: 10) {
HStack {
Text(item?.baseName ?? "–").font(LK.mono(13, .medium)).foregroundStyle(LK.text).lineLimit(1).truncationMode(.middle)
Spacer()
if let item {
HStack(spacing: 2) {
ForEach(1...5, id: \.self) { n in
Button { state.setRating(item.rating == n ? 0 : n, advance: false, only: item) } label: {
Image(systemName: n <= item.rating ? "star.fill" : "star")
.font(.system(size: 13))
.foregroundStyle(n <= item.rating ? LK.amber : LK.faint)
}
.buttonStyle(.plain)
.help("\(n) Stern(e) – ⌥\(n)")
}
}
}
}
if let item {
HStack(spacing: 6) {
ForEach(ColorLabel.allCases, id: \.self) { l in
let on = item.label == l
Button { state.setLabel(l, advance: false, only: item) } label: {
Capsule().fill(on ? l.lkColor : l.lkColor.opacity(0.25))
.frame(width: 26, height: on ? 8 : 6)
}
.buttonStyle(.plain)
.help("\(l.pmColorClass) – \(l.germanName)")
}
Spacer()
Button { state.toggleTag() } label: {
Label(item.tagged ? "Getaggt" : "Tag", systemImage: item.tagged ? "checkmark.square.fill" : "square")
.font(.system(size: 12, weight: .semibold))
.foregroundStyle(item.tagged ? LK.amber : LK.text2)
}
.buttonStyle(.plain)
.help("Tag (T)")
}
}
}
.padding(18)
}
// MARK: Player suggestion (jersey numbers)
@ViewBuilder
private var suggestions: some View {
let open = item.map { state.openSuggestions(for: $0.id) } ?? []
if let item, !open.isEmpty {
VStack(alignment: .leading, spacing: 8) {
ForEach(open) { s in
HStack(spacing: 10) {
if let c = s.measuredColor {
RoundedRectangle(cornerRadius: 3).fill(c.swiftUI).frame(width: 12, height: 12)
}
Text(s.code ?? "#\(s.number)").font(LK.mono(12, .semibold)).foregroundStyle(LK.amber)
Text(s.replacement.map { JerseyLogic.personName(replacement: $0, columns: []) } ?? "")
.font(.system(size: 13)).foregroundStyle(LK.text).lineLimit(1)
Text("\(Int(s.confidence * 100)) %").font(LK.mono(11)).foregroundStyle(LK.muted)
Spacer()
Button("Annehmen") { accept([s], item: item) }
.buttonStyle(LKButtonStyle(primary: true, compact: true))
.keyboardShortcut(s.id == open.first?.id ? KeyboardShortcut("j", modifiers: .command) : nil)
Button { state.dismissSuggestion(s, for: item.id) } label: { Image(systemName: "xmark") }
.buttonStyle(LKButtonStyle(compact: true))
.help("Falsch – verwerfen")
}
}
}
.padding(12)
.background(RoundedRectangle(cornerRadius: 10).fill(LK.amberSoft))
.overlay(RoundedRectangle(cornerRadius: 10).stroke(LK.amber.opacity(0.35)))
}
}
// MARK: Fields
private func binding(_ id: String) -> Binding<String> {
Binding(get: { texts[id] ?? "" }, set: { texts[id] = $0; dirty.insert(id) })
}
private func field(_ id: String, _ label: String, height: CGFloat? = nil) -> some View {
VStack(alignment: .leading, spacing: 5) {
HStack {
Text(label).font(.system(size: 12)).foregroundStyle(dirty.contains(id) ? LK.amber : LK.text2)
if let f = IPTCField.byID[id], f.kind == .list {
Text("Komma-getrennt").font(.system(size: 10)).foregroundStyle(LK.faint)
}
}
if let height {
CodeTextView(text: binding(id), codes: state.codes)
.frame(height: height)
.clipShape(RoundedRectangle(cornerRadius: 8))
.overlay(RoundedRectangle(cornerRadius: 8).stroke(LK.borderStrong))
} else {
CodeTextField(text: binding(id), codes: state.codes)
.frame(height: 22)
}
}
.frame(maxWidth: .infinity, alignment: .leading)
}
// MARK: Actions
private func load(force: Bool) {
guard let item else { texts = [:]; dirty = []; loadedID = nil; return }
if !force && loadedID == item.id && !dirty.isEmpty { return }
texts = item.iptc.texts()
dirty = []
loadedID = item.id
}
private func accept(_ s: [JerseySuggestion], item: PhotoItem) {
let updated = state.applying(s, to: IPTCValues(texts: texts)).texts()
for id in ["caption", "personInImage"] where (texts[id] ?? "") != (updated[id] ?? "") {
texts[id] = updated[id] ?? ""
dirty.insert(id)
}
state.markSuggestionsDone(s, for: item.id)
}
private func saveAndMove(_ delta: Int) {
Task {
if let item, !dirty.isEmpty {
saving = true
let fields = IPTCField.all.filter { dirty.contains($0.id) }
let ok = await state.applyIPTCAndWait(IPTCValues(texts: texts), fields: fields, to: [item])
saving = false
guard ok else { return }
dirty = []
}
state.moveCursor(by: delta)
}
}
}
@@ -0,0 +1,162 @@
import SwiftUI
import LichtkastenCore
/// Layout C in the Leuchttisch look: match header with both teams (kit colors from the jersey setup),
/// event + date from IPTC, counters and team filter chips.
struct MatchdayHeader: View {
@EnvironmentObject var state: AppState
var body: some View {
let teams = state.settings.jersey.teams
let info = state.matchdayEvent
VStack(spacing: 0) {
HStack(spacing: 24) {
if let home = teams.first {
teamBadge(home, alignTrailing: true).frame(maxWidth: .infinity, alignment: .trailing)
}
VStack(spacing: 2) {
Text(info.event.uppercased())
.font(.system(size: 11, weight: .bold)).tracking(1.4)
.foregroundStyle(LK.muted).lineLimit(1)
Text(info.date).font(.system(size: 22, weight: .heavy, design: .rounded)).foregroundStyle(LK.text)
}
.padding(.horizontal, 18).padding(.vertical, 6)
.background(RoundedRectangle(cornerRadius: 10).fill(LK.deep))
.overlay(RoundedRectangle(cornerRadius: 10).stroke(LK.border))
.frame(maxWidth: 420)
if teams.count > 1 {
teamBadge(teams[1], alignTrailing: false).frame(maxWidth: .infinity, alignment: .leading)
}
counters
}
.padding(.horizontal, 20)
.padding(.vertical, 12)
HStack(spacing: 8) {
chip("Alle", on: state.filter.team == nil && !state.filter.withoutPlayer && state.filter.person == nil) {
state.setTeamFilter(nil)
}
ForEach(teams) { t in
chip(t.name, color: t.shirtColor.swiftUI, on: state.filter.team == t.id) { state.setTeamFilter(t.id) }
}
chip("Ohne Spielerin", on: state.filter.withoutPlayer) {
state.setTeamFilter(nil); state.filter.withoutPlayer = true
}
if let p = state.filter.person {
chip("✕ " + p, on: true) { state.filter.person = nil }
}
Spacer()
Button("Trikot-Erkennung …") { state.showJerseySetup = true }
.buttonStyle(LKButtonStyle(compact: true))
Button("Nummern erkennen ⌘⇧J") { state.recognizeJerseys() }
.buttonStyle(LKButtonStyle(primary: true, compact: true))
.disabled(state.jerseyRunning)
}
.padding(.horizontal, 20)
.padding(.bottom, 10)
}
.background(LK.bar)
.overlay(alignment: .bottom) { Rectangle().fill(LK.border).frame(height: 1) }
}
private func teamBadge(_ t: JerseyTeam, alignTrailing: Bool) -> some View {
HStack(spacing: 12) {
if alignTrailing { name(t) }
RoundedRectangle(cornerRadius: 8)
.fill(t.shirtColor.swiftUI)
.frame(width: 32, height: 32)
.overlay(RoundedRectangle(cornerRadius: 8).stroke((t.shortsColor ?? t.shirtColor).swiftUI, lineWidth: 3))
.overlay(RoundedRectangle(cornerRadius: 8).stroke(LK.border, lineWidth: 1))
if !alignTrailing { name(t) }
}
}
private func name(_ t: JerseyTeam) -> some View {
Text(t.name.uppercased())
.font(.system(size: 22, weight: .heavy, design: .rounded))
.foregroundStyle(LK.text)
.lineLimit(1)
.minimumScaleFactor(0.6)
}
private var counters: some View {
let tagged = state.items.filter(\.tagged).count
let withPlayer = state.items.filter { state.playerInfo(for: $0)?.confirmed == true }.count
let open = state.items.filter { !state.openSuggestions(for: $0.id).isEmpty }.count
return HStack(spacing: 18) {
counter(tagged, "GETAGGT", highlight: true)
counter(withPlayer, "MIT SPIELERIN")
counter(open, "OFFEN")
}
}
private func counter(_ n: Int, _ label: String, highlight: Bool = false) -> some View {
VStack(alignment: .trailing, spacing: 0) {
Text("\(n)").font(.system(size: 22, weight: .heavy, design: .rounded)).foregroundStyle(highlight ? LK.amber : LK.text)
Text(label).font(.system(size: 10, weight: .bold)).tracking(1).foregroundStyle(LK.muted)
}
}
private func chip(_ title: String, color: Color? = nil, on: Bool, action: @escaping () -> Void) -> some View {
Button(action: action) {
HStack(spacing: 6) {
if let color { Circle().fill(color).frame(width: 9, height: 9).overlay(Circle().stroke(LK.border)) }
Text(title).font(.system(size: 12, weight: .bold))
}
.foregroundStyle(on ? LK.onAmber : LK.text2)
.padding(.horizontal, 12).frame(height: 28)
.background(Capsule().fill(on ? LK.amber : LK.raised))
.overlay(Capsule().stroke(on ? Color.clear : LK.borderStrong))
}
.buttonStyle(.plain)
}
}
/// Sidebar list of players in this folder with number of images – click filters.
struct MatchdayPlayerList: View {
@EnvironmentObject var state: AppState
var body: some View {
let players = state.playerCounts
ScrollView {
VStack(alignment: .leading, spacing: 2) {
if players.isEmpty {
Text("Noch keine Spielerinnen – Nummern erkennen (⌘⇧J) oder Vorschläge annehmen.")
.font(.system(size: 12)).foregroundStyle(LK.muted).padding(.horizontal, 16)
}
ForEach(players) { p in
let on = state.filter.person == p.name
Button {
state.filter.team = nil; state.filter.withoutPlayer = false
state.filter.person = on ? nil : p.name
} label: {
HStack(spacing: 10) {
Text(p.number.map(String.init) ?? "–")
.font(LK.mono(12, .bold))
.foregroundStyle(textColor(on: p.team?.shirtColor))
.frame(width: 28, height: 22)
.background(RoundedRectangle(cornerRadius: 5).fill(p.team?.shirtColor.swiftUI ?? LK.raised))
Text(p.name).font(.system(size: 13)).lineLimit(1)
Spacer()
Text("\(p.count)").font(LK.mono(12)).foregroundStyle(LK.muted)
}
.foregroundStyle(on ? LK.amber : LK.text)
.padding(.horizontal, 10).padding(.vertical, 5)
.background(RoundedRectangle(cornerRadius: 7).fill(on ? LK.selected : Color.clear))
.contentShape(Rectangle())
}
.buttonStyle(.plain)
.padding(.horizontal, 6)
}
}
.padding(.bottom, 8)
}
}
/// Readable number on the kit color (dark text on light kits).
private func textColor(on c: KitColor?) -> Color {
guard let c else { return LK.text }
let luminance = 0.299 * c.r + 0.587 * c.g + 0.114 * c.b
return luminance > 0.6 ? LK.onAmber : .white
}
}
+91 -30
View File
@@ -7,18 +7,28 @@ struct PreviewView: View {
@State private var fullResLoadedFor: String?
var body: some View {
ZStack(alignment: .bottom) {
Color.black
if let image {
ZoomableImageView(image: image, maxZoom: CGFloat(state.settings.maxZoom), request: state.zoomRequest) { mag, fit in
state.zoom100 = !fit
state.zoomPercent = Int((mag * 100).rounded())
if !fit { Task { await loadFullRes() } }
// Layout B: loupe · filmstrip · IPTC panel – in the Leuchttisch look
HStack(spacing: 0) {
VStack(spacing: 0) {
ZStack(alignment: .bottom) {
LK.deep
if let image {
ZoomableImageView(image: image, maxZoom: CGFloat(state.settings.maxZoom), request: state.zoomRequest) { mag, fit in
state.zoom100 = !fit
state.zoomPercent = Int((mag * 100).rounded())
if !fit { Task { await loadFullRes() } }
}
} else {
ProgressView()
}
if let item = state.cursorItem { infoBar(item) }
}
} else {
ProgressView()
Filmstrip()
}
if state.settings.loupePanel {
Divider().overlay(LK.border)
LoupeInspector().frame(width: 380)
}
if let item = state.cursorItem { infoBar(item) }
}
.task(id: state.cursorID) { await load() }
}
@@ -45,31 +55,82 @@ struct PreviewView: View {
}
private func infoBar(_ item: PhotoItem) -> some View {
HStack(spacing: 14) {
Image(systemName: item.tagged ? "checkmark.square.fill" : "square")
Text(item.filename).bold()
HStack(spacing: 1) {
ForEach(1...5, id: \.self) { n in Image(systemName: n <= item.rating ? "star.fill" : "star") }
}
.foregroundStyle(.yellow)
if let l = item.label { Circle().fill(l.color).frame(width: 10, height: 10) }
HStack(spacing: 12) {
Text([item.exif["FocalLength"], item.exif["FNumber"].map { "f/\($0)" },
item.exif["ExposureTime"].map { "\($0) s" }, item.exif["ISO"].map { "ISO \($0)" }]
.compactMap { $0 }.joined(separator: " "))
.font(LK.mono(12))
.foregroundStyle(LK.text2)
Spacer()
Text([item.exif["Model"], item.exif["LensModel"], item.exif["FocalLength"],
item.exif["ExposureTime"].map { "\($0) s" }, item.exif["FNumber"].map { "f/\($0)" },
item.exif["ISO"].map { "ISO \($0)" }].compactMap { $0 }.joined(separator: " · "))
.foregroundStyle(.secondary)
HStack(spacing: 4) {
HStack(spacing: 6) {
Button { state.zoom(.zoomOut) } label: { Image(systemName: "minus.magnifyingglass") }
Button { state.zoom(.fit) } label: { Text(state.zoom100 ? "\(state.zoomPercent) %" : "Einpassen").monospacedDigit().frame(minWidth: 70) }
.buttonStyle(LKButtonStyle(compact: true))
Button { state.zoom(.fit) } label: { Text(state.zoom100 ? "\(state.zoomPercent) %" : "Einpassen").font(LK.mono(12)) }
.buttonStyle(LKButtonStyle(compact: true))
.help("Einpassen (Z)")
Button { state.zoom(.actual) } label: { Text("100 %") }
Button { state.zoom(.actual) } label: { Text("100 %").font(LK.mono(12)) }
.buttonStyle(LKButtonStyle(compact: true))
Button { state.zoom(.zoomIn) } label: { Image(systemName: "plus.magnifyingglass") }
.buttonStyle(LKButtonStyle(compact: true))
Button { state.settings.loupePanel.toggle() } label: { Image(systemName: "sidebar.right") }
.buttonStyle(LKButtonStyle(compact: true))
.help("IPTC-Panel ein/aus")
}
.buttonStyle(.borderless)
}
.font(.callout)
.padding(.horizontal, 14)
.padding(.vertical, 8)
.background(.ultraThinMaterial)
.padding(.horizontal, 16)
.padding(.vertical, 10)
.background(LK.ground.opacity(0.85))
}
}
/// Filmstrip under the loupe (layout B): neighbours of the current image, click to jump.
struct Filmstrip: View {
@EnvironmentObject var state: AppState
var body: some View {
ScrollViewReader { proxy in
ScrollView(.horizontal, showsIndicators: false) {
LazyHStack(spacing: 8) {
ForEach(state.visible) { item in
FilmstripCell(item: item, url: state.previewURL(for: item), current: item.id == state.cursorID)
.equatable()
.id(item.id)
.onTapGesture { state.cursorID = item.id; state.selection = [item.id] }
}
}
.padding(.horizontal, 14)
.padding(.vertical, 12)
}
.frame(height: 104)
.background(LK.ground)
.overlay(alignment: .top) { Rectangle().fill(LK.border).frame(height: 1) }
.onChange(of: state.cursorID) { _, id in if let id { withAnimation(.easeOut(duration: 0.15)) { proxy.scrollTo(id, anchor: .center) } } }
.onAppear { if let id = state.cursorID { proxy.scrollTo(id, anchor: .center) } }
}
}
}
struct FilmstripCell: View, Equatable {
let item: PhotoItem
let url: URL
let current: Bool
@State private var image: NSImage?
static func == (a: FilmstripCell, b: FilmstripCell) -> Bool { a.item == b.item && a.url == b.url && a.current == b.current }
var body: some View {
ZStack(alignment: .leading) {
Rectangle().fill(LK.deep)
if let image { Image(nsImage: image).resizable().scaledToFill() }
Rectangle().fill(item.label?.lkColor ?? .clear).frame(width: 4)
}
.frame(width: 118, height: 78)
.clipShape(RoundedRectangle(cornerRadius: 6))
.overlay(RoundedRectangle(cornerRadius: 6).stroke(current ? LK.amber : Color.clear, lineWidth: 2))
.opacity(current ? 1 : 0.72)
.task(id: url) {
image = ImageLoader.shared.cachedThumbnail(url)
if image == nil { image = await ImageLoader.shared.thumbnail(for: url) }
}
}
}
+1 -1
View File
@@ -39,7 +39,7 @@ struct TasksWindow: View {
HStack {
Toggle("Einzelne Upload-Dateien", isOn: $showFiles).toggleStyle(.checkbox)
if uploads.rate > 0 {
Label(uploads.rateText, systemImage: "speedometer").monospacedDigit().foregroundStyle(Color.accentColor)
Label(uploads.rateText, systemImage: "speedometer").monospacedDigit().foregroundStyle(LK.amber)
}
Spacer()
Button("Fehlgeschlagene Uploads wiederholen") { uploads.retryFailed() }.disabled(uploads.failedCount == 0)
+140
View File
@@ -0,0 +1,140 @@
import SwiftUI
import LichtkastenCore
/// "Leuchttisch" design language: warm graphite ground, amber light as the single accent.
enum LK {
static func hex(_ v: UInt32) -> Color {
Color(red: Double((v >> 16) & 0xFF) / 255, green: Double((v >> 8) & 0xFF) / 255, blue: Double(v & 0xFF) / 255)
}
// grounds (dark → light)
static let deep = hex(0x120F0B) // inputs, wells
static let ground = hex(0x16130E) // window / contact sheet
static let panel = hex(0x1A1610) // sidebar, side panels
static let bar = hex(0x1C1812) // header bars
static let card = hex(0x1E1A14) // thumbnail cards
static let raised = hex(0x221D16) // buttons, boxes
static let selected = hex(0x2A2318) // selected card / row
static let border = hex(0x2A241B)
static let borderStrong = hex(0x2E271D)
// text
static let text = hex(0xEDE6DA)
static let text2 = hex(0xB8AE9E)
static let muted = hex(0x8C8272)
static let faint = hex(0x4A4235)
// accent: the light of the light table
static let amber = hex(0xF2B544)
static let amberSoft = hex(0xF2B544).opacity(0.18)
static let onAmber = hex(0x16130E)
static let green = hex(0x5DBB63)
static let red = hex(0xE0645A)
static let mono = Font.system(size: 12, design: .monospaced)
static func mono(_ size: CGFloat, _ weight: Font.Weight = .regular) -> Font { .system(size: size, weight: weight, design: .monospaced) }
}
extension ColorLabel {
/// Color classes in the Leuchttisch palette (same order as PM: 1 red … 8 gray).
var lkColor: Color {
switch self {
case .red: return LK.hex(0xE0645A)
case .yellow: return LK.hex(0xE4B34C)
case .green: return LK.hex(0x5DBB63)
case .blue: return LK.hex(0x4F8FE0)
case .purple: return LK.hex(0xC467D6)
case .cyan: return LK.hex(0x45BFC9)
case .orange: return LK.hex(0xE58A3B)
case .gray: return LK.hex(0x7A7166)
}
}
}
extension KitColor {
var swiftUI: Color { Color(red: r, green: g, blue: b) }
}
/// Small uppercase section label ("FAVORITEN").
struct LKSectionLabel: View {
let title: String
var body: some View {
Text(title.uppercased())
.font(.system(size: 11, weight: .bold))
.tracking(1.2)
.foregroundStyle(LK.muted)
}
}
/// Primary action (amber) and secondary (raised) buttons.
struct LKButtonStyle: ButtonStyle {
var primary = false
var compact = false
func makeBody(configuration: Configuration) -> some View {
configuration.label
.font(.system(size: compact ? 12 : 13, weight: primary ? .bold : .semibold))
.foregroundStyle(primary ? LK.onAmber : LK.text)
.padding(.horizontal, compact ? 10 : 14)
.frame(minHeight: compact ? 26 : 32)
.background(
RoundedRectangle(cornerRadius: compact ? 7 : 9)
.fill(primary ? LK.amber : LK.raised)
)
.overlay(
RoundedRectangle(cornerRadius: compact ? 7 : 9)
.stroke(primary ? Color.clear : LK.borderStrong, lineWidth: 1)
)
.opacity(configuration.isPressed ? 0.75 : 1)
.contentShape(Rectangle())
}
}
/// Segmented pill control ("Alle | Getaggt | Vorschläge").
struct LKSegmented<T: Hashable>: View {
let options: [(T, String)]
@Binding var selection: T
var body: some View {
HStack(spacing: 0) {
ForEach(options.indices, id: \.self) { i in
let opt = options[i]
let on = opt.0 == selection
Button { selection = opt.0 } label: {
Text(opt.1)
.font(.system(size: 12, weight: on ? .bold : .semibold))
.foregroundStyle(on ? LK.amber : LK.text2)
.padding(.horizontal, 12)
.frame(height: 26)
.background(RoundedRectangle(cornerRadius: 7).fill(on ? LK.selected : Color.clear))
.contentShape(Rectangle())
}
.buttonStyle(.plain)
}
}
.padding(3)
.background(RoundedRectangle(cornerRadius: 10).fill(LK.deep))
.overlay(RoundedRectangle(cornerRadius: 10).stroke(LK.border))
}
}
/// Text field look used in the Leuchttisch panels.
struct LKFieldBackground: ViewModifier {
func body(content: Content) -> some View {
content
.padding(.horizontal, 8)
.padding(.vertical, 6)
.background(RoundedRectangle(cornerRadius: 8).fill(LK.deep))
.overlay(RoundedRectangle(cornerRadius: 8).stroke(LK.borderStrong))
}
}
extension View {
func lkField() -> some View { modifier(LKFieldBackground()) }
/// Every window: dark Leuchttisch ground and amber accent.
func lkWindow() -> some View {
self.preferredColorScheme(.dark).tint(LK.amber).background(LK.ground)
}
}