This commit is contained in:
Michael Freno
2026-01-29 19:03:20 -05:00
parent 3425a2cdbb
commit 1a43a2a1a0
4 changed files with 105 additions and 81 deletions

View File

@@ -13,7 +13,9 @@ enum SettingsSection: Int, CaseIterable, Identifiable {
case blink = 2
case posture = 3
case userTimers = 4
#if ENFORCE_READY
case enforceMode = 5
#endif
case smartMode = 6
var id: Int { rawValue }
@@ -24,7 +26,9 @@ enum SettingsSection: Int, CaseIterable, Identifiable {
case .lookAway: return "Look Away"
case .blink: return "Blink"
case .posture: return "Posture"
#if ENFORCE_READY
case .enforceMode: return "Enforce Mode"
#endif
case .userTimers: return "User Timers"
case .smartMode: return "Smart Mode"
}
@@ -36,7 +40,9 @@ enum SettingsSection: Int, CaseIterable, Identifiable {
case .lookAway: return "eye.fill"
case .blink: return "eye.circle.fill"
case .posture: return "figure.stand"
#if ENFORCE_READY
case .enforceMode: return "video.fill"
#endif
case .userTimers: return "plus.circle"
case .smartMode: return "brain.fill"
}

View File

@@ -39,15 +39,22 @@ struct AdditionalModifiersView: View {
.font(isCompact ? .subheadline : .title3)
.foregroundStyle(.secondary)
.multilineTextAlignment(.center)
#if !ENFORCE_READY
Text("More to come soon")
.font(isCompact ? .subheadline : .title3)
.foregroundStyle(.secondary)
.multilineTextAlignment(.center)
#endif
Spacer()
ZStack {
#if ENFORCE_READY
cardView(for: 0, width: cardWidth, height: cardHeight)
.zIndex(zIndex(for: 0))
.scaleEffect(scale(for: 0))
.offset(x: xOffset(for: 0), y: yOffset(for: 0))
#endif
cardView(for: 1, width: cardWidth, height: cardHeight)
.zIndex(zIndex(for: 1))
.scaleEffect(scale(for: 1))
@@ -58,7 +65,7 @@ struct AdditionalModifiersView: View {
Spacer()
// Navigation controls
#if ENFORCE_READY
HStack(spacing: isCompact ? 12 : 20) {
Button(action: { swapCards() }) {
Image(systemName: "chevron.left")
@@ -93,6 +100,7 @@ struct AdditionalModifiersView: View {
.disabled(frontCardIndex == 1)
}
.padding(.bottom, isCompact ? 6 : 10)
#endif
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.padding()
@@ -254,11 +262,13 @@ struct AdditionalModifiersView: View {
}
}
Spacer()
Toggle("", isOn: Binding(
Toggle(
"",
isOn: Binding(
get: {
settingsManager.isTimerEnabled(for: .lookAway) ||
settingsManager.isTimerEnabled(for: .blink) ||
settingsManager.isTimerEnabled(for: .posture)
settingsManager.isTimerEnabled(for: .lookAway)
|| settingsManager.isTimerEnabled(for: .blink)
|| settingsManager.isTimerEnabled(for: .posture)
},
set: { newValue in
if newValue {
@@ -267,7 +277,8 @@ struct AdditionalModifiersView: View {
}
}
}
))
)
)
.labelsHidden()
.disabled(!cameraService.hasCameraHardware)
.controlSize(isCompact ? .small : .regular)
@@ -364,6 +375,7 @@ struct AdditionalModifiersView: View {
isOn: $settingsManager.settings.smartMode.autoPauseOnIdle
)
#if TRACK_READY
smartModeToggle(
icon: "chart.line.uptrend.xyaxis",
iconColor: .green,
@@ -371,6 +383,7 @@ struct AdditionalModifiersView: View {
subtitle: "Monitor active and idle time",
isOn: $settingsManager.settings.smartMode.trackUsage
)
#endif
}
Spacer()

View File

@@ -42,7 +42,8 @@ struct SettingsWindowView: View {
)
.onReceive(tabSwitchPublisher) { notification in
if let tab = notification.object as? Int,
let section = SettingsSection(rawValue: tab) {
let section = SettingsSection(rawValue: tab)
{
selectedSection = section
}
}
@@ -78,8 +79,10 @@ struct SettingsWindowView: View {
BlinkSetupView(settingsManager: settingsManager)
case .posture:
PostureSetupView(settingsManager: settingsManager)
#if ENFORCE_READY
case .enforceMode:
EnforceModeSetupView(settingsManager: settingsManager)
#endif
case .userTimers:
UserTimersView(
userTimers: Binding(

View File

@@ -25,7 +25,9 @@ struct SmartModeSetupView: View {
VStack(spacing: 24) {
fullscreenSection
idleSection
#if TRACK_READY
usageTrackingSection
#endif
}
.frame(maxWidth: 600)