mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
Working notification
This commit is contained in:
parent
fa1bd97d84
commit
bb2284bafc
10 changed files with 367 additions and 372 deletions
45
DynamicIsland/components/UI/FocusIndicator.swift
Normal file
45
DynamicIsland/components/UI/FocusIndicator.swift
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
//
|
||||
// FocusIndicator.swift
|
||||
// DynamicIsland
|
||||
//
|
||||
// Small purple moon badge shown while Focus mode is active.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct FocusIndicator: View {
|
||||
@ObservedObject var manager = DoNotDisturbManager.shared
|
||||
|
||||
private let focusColor = Color.purple
|
||||
|
||||
var body: some View {
|
||||
Capsule()
|
||||
.fill(Color.black)
|
||||
.overlay {
|
||||
ZStack {
|
||||
Circle()
|
||||
.fill(focusColor.opacity(0.2))
|
||||
.frame(width: 20, height: 20)
|
||||
|
||||
Image(systemName: focusSymbol)
|
||||
.font(.system(size: 12, weight: .semibold))
|
||||
.foregroundStyle(focusColor)
|
||||
}
|
||||
}
|
||||
.accessibilityElement(children: .ignore)
|
||||
.accessibilityLabel("Focus mode active")
|
||||
}
|
||||
|
||||
private var focusSymbol: String {
|
||||
if let symbol = FocusModeType(rawValue: manager.currentFocusModeIdentifier)?.sfSymbol {
|
||||
return symbol
|
||||
}
|
||||
return FocusModeType.doNotDisturb.sfSymbol
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
FocusIndicator()
|
||||
.frame(width: 30, height: 30)
|
||||
.background(Color.gray.opacity(0.2))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue