Added Private Icons

This commit is contained in:
Hariharan Mudaliar 2025-11-14 11:22:16 +05:30
commit 45df2bce99
4 changed files with 40 additions and 8 deletions

View file

@ -110,13 +110,13 @@ struct DoNotDisturbLiveActivity: View {
} }
} }
private var currentIconName: String { private var currentIcon: Image {
if manager.isDoNotDisturbActive { if manager.isDoNotDisturbActive {
return focusMode.sfSymbol return focusMode.activeIcon
} else if showInactiveIcon { } else if showInactiveIcon {
return focusMode.inactiveSymbol return Image(systemName: focusMode.inactiveSymbol)
} else { } else {
return focusMode.sfSymbol return focusMode.activeIcon
} }
} }
@ -136,7 +136,7 @@ struct DoNotDisturbLiveActivity: View {
Color.clear Color.clear
.overlay(alignment: .center) { .overlay(alignment: .center) {
if iconWingWidth > 0 { if iconWingWidth > 0 {
Image(systemName: currentIconName) currentIcon
.font(.system(size: 13, weight: .semibold)) .font(.system(size: 13, weight: .semibold))
.foregroundColor(currentIconColor) .foregroundColor(currentIconColor)
.contentTransition(.opacity) .contentTransition(.opacity)

View file

@ -14,7 +14,7 @@ struct FocusIndicator: View {
Capsule() Capsule()
.fill(Color.black) .fill(Color.black)
.overlay { .overlay {
Image(systemName: focusSymbol) focusIcon
.font(.system(size: 12, weight: .semibold)) .font(.system(size: 12, weight: .semibold))
.foregroundStyle(accentColor) .foregroundStyle(accentColor)
.frame(width: 24, height: 24) .frame(width: 24, height: 24)
@ -30,8 +30,8 @@ struct FocusIndicator: View {
) )
} }
private var focusSymbol: String { private var focusIcon: Image {
focusMode.sfSymbol focusMode.activeIcon
} }
private var accentColor: Color { private var accentColor: Color {

View file

@ -0,0 +1,14 @@
import SwiftUI
@_silgen_name("$s7SwiftUI5ImageV19_internalSystemNameACSS_tcfC")
private func _swiftUI_image(internalSystemName: String) -> Image?
extension Image {
init?(internalSystemName systemName: String) {
guard let systemImage = _swiftUI_image(internalSystemName: systemName) else {
return nil
}
self = systemImage
}
}

View file

@ -342,6 +342,24 @@ enum FocusModeType: String, CaseIterable {
} }
} }
var internalSymbolName: String? {
switch self {
case .work: return "person.lanyardcard.fill"
case .mindfulness: return "apple.mindfulness"
case .gaming: return "rocket.fill"
default: return nil
}
}
var activeIcon: Image {
if let internalSymbolName,
let image = Image(internalSystemName: internalSymbolName) {
return image
}
return Image(systemName: sfSymbol)
}
var accentColor: Color { var accentColor: Color {
switch self { switch self {
case .doNotDisturb: case .doNotDisturb: