Files

24 lines
1.3 KiB
Swift

import SwiftUI
/// `⑂ branch │ project`, centred for half a second when the window becomes key again. No fade.
struct FocusFlash: View {
let model: WorkspaceModel
var body: some View {
HStack(spacing: 11) {
Image(systemName: "arrow.triangle.branch").font(.system(size: 18, weight: .light)).foregroundStyle(Palette.amber)
Text(model.sourceControl?.state.branch ?? "—").typeRole(Typography.focusFlash).foregroundStyle(Palette.amber)
Rectangle().fill(Palette.raised).frame(width: 1, height: 17).padding(.horizontal, 1)
Text(model.name).typeRole(Typography.focusFlashName).foregroundStyle(Palette.text1).lineLimit(1)
}
.padding(.horizontal, 22)
.padding(.vertical, 15)
.background(Palette.panel, in: RoundedRectangle(cornerRadius: Metrics.radiusMedium))
.overlay(RoundedRectangle(cornerRadius: Metrics.radiusMedium).strokeBorder(Palette.raised, lineWidth: Metrics.hairline))
.overlay(alignment: .leading) { Rectangle().fill(Palette.amber).frame(width: Metrics.accentRule) }
.shadow(color: Palette.overlayShadow, radius: Metrics.overlayShadowRadius / 2, y: Metrics.overlayShadowY)
.frame(maxWidth: .infinity, maxHeight: .infinity)
.allowsHitTesting(false)
}
}