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

View File

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

View File

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

View File

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