mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
Fixed the width and color
This commit is contained in:
parent
bb2284bafc
commit
39c135cfd7
6 changed files with 217 additions and 73 deletions
|
|
@ -10,31 +10,39 @@ 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))
|
||||
.fill(accentColor.opacity(0.2))
|
||||
.frame(width: 20, height: 20)
|
||||
|
||||
Image(systemName: focusSymbol)
|
||||
.font(.system(size: 12, weight: .semibold))
|
||||
.foregroundStyle(focusColor)
|
||||
.foregroundStyle(accentColor)
|
||||
}
|
||||
}
|
||||
.accessibilityElement(children: .ignore)
|
||||
.accessibilityLabel("Focus mode active")
|
||||
.accessibilityLabel(accessibilityLabel)
|
||||
}
|
||||
|
||||
private var focusMode: FocusModeType {
|
||||
FocusModeType(rawValue: manager.currentFocusModeIdentifier) ?? .doNotDisturb
|
||||
}
|
||||
|
||||
private var focusSymbol: String {
|
||||
if let symbol = FocusModeType(rawValue: manager.currentFocusModeIdentifier)?.sfSymbol {
|
||||
return symbol
|
||||
}
|
||||
return FocusModeType.doNotDisturb.sfSymbol
|
||||
focusMode.sfSymbol
|
||||
}
|
||||
|
||||
private var accentColor: Color {
|
||||
focusMode.accentColor
|
||||
}
|
||||
|
||||
private var accessibilityLabel: String {
|
||||
let name = manager.currentFocusModeName.isEmpty ? focusMode.displayName : manager.currentFocusModeName
|
||||
return "Focus active: \(name)"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue