just 2 small features

This commit is contained in:
delli 2026-01-08 16:51:12 +01:00
commit 53f8b297c9
9 changed files with 139 additions and 4 deletions

View file

@ -128,6 +128,12 @@ struct InlineHUD: View {
.symbolRenderingMode(.hierarchical)
.contentTransition(.interpolate)
.frame(width: 20, height: 15, alignment: .center)
case .capsLock:
Image(systemName: "capslock.fill")
.symbolRenderingMode(.hierarchical)
.contentTransition(.interpolate)
.frame(width: 20, height: 15, alignment: .center)
.foregroundStyle(Defaults[.capsLockIndicatorUseGreenColor] ? .green : .white)
default:
EmptyView()
}
@ -147,7 +153,7 @@ struct InlineHUD: View {
frameWidth: infoWidth
)
}
} else {
} else if type != .capsLock {
Text(Type2Name(type))
.font(.subheadline)
.fontWeight(.medium)
@ -180,6 +186,16 @@ struct InlineHUD: View {
.multilineTextAlignment(.trailing)
.frame(maxWidth: .infinity, alignment: .trailing)
.contentTransition(.interpolate)
} else if (type == .capsLock) {
Text("Caps Lock")
.foregroundStyle(Defaults[.capsLockIndicatorUseGreenColor] ? .green : .white)
.font(.subheadline)
.fontWeight(.medium)
.lineLimit(1)
.allowsTightening(true)
.multilineTextAlignment(.trailing)
.frame(maxWidth: .infinity, alignment: .trailing)
.contentTransition(.interpolate)
} else if (type == .bluetoothAudio) {
if hasBatteryLevel {
let indicatorSpacing: CGFloat = {
@ -374,6 +390,8 @@ struct InlineHUD: View {
return "Mic"
case .bluetoothAudio:
return BluetoothAudioManager.shared.lastConnectedDevice?.name ?? "Bluetooth"
case .capsLock:
return "Caps Lock"
default:
return ""
}

View file

@ -26,6 +26,8 @@ struct LockScreenLiveActivityOverlay: View {
Self.collapsedScale(for: notchSize)
}
@State private var isHovering: Bool = false
var body: some View {
HStack(spacing: 0) {
Color.clear
@ -52,8 +54,18 @@ struct LockScreenLiveActivityOverlay: View {
)
)
.frame(width: totalWidth, height: notchSize.height)
.scaleEffect(x: max(model.scale, collapsedScale), y: 1, anchor: .center)
.scaleEffect(x: max(model.scale, collapsedScale) * (isHovering ? 1.03 : 1.0),
y: 1 * (isHovering ? 1.03 : 1.0),
anchor: .center)
.opacity(model.opacity)
.onHover { hovering in
withAnimation(.smooth(duration: 0.2)) {
isHovering = hovering
}
if hovering {
NSHapticFeedbackManager.defaultPerformer.perform(.alignment, performanceTime: .default)
}
}
}
}

View file

@ -1735,6 +1735,11 @@ private struct DevicesSettingsView: View {
Section {
Defaults.Toggle("Show Bluetooth device connections", key: .showBluetoothDeviceConnections)
.settingsHighlight(id: highlightID("Show Bluetooth device connections"))
Defaults.Toggle("Show Caps Lock Indicator", key: .enableCapsLockIndicator)
.settingsHighlight(id: highlightID("Show Caps Lock Indicator"))
Defaults.Toggle("Use green color for Caps Lock text", key: .capsLockIndicatorUseGreenColor)
.disabled(!Defaults[.enableCapsLockIndicator])
.settingsHighlight(id: highlightID("Use green color for Caps Lock text"))
Defaults.Toggle("Use circular battery indicator", key: .useCircularBluetoothBatteryIndicator)
.settingsHighlight(id: highlightID("Use circular battery indicator"))
Defaults.Toggle("Show battery percentage text in HUD", key: .showBluetoothBatteryPercentageText)