fix: target dependancies

This commit is contained in:
Michael Freno
2026-01-13 16:00:33 -05:00
parent c357e02369
commit 3eac9a2767
2 changed files with 119 additions and 113 deletions

View File

@@ -42,47 +42,50 @@ struct GeneralSetupView: View {
.foregroundColor(.secondary)
}
Spacer()
Toggle("", isOn: Binding(
get: { settingsManager.settings.launchAtLogin },
set: { settingsManager.settings.launchAtLogin = $0 }
))
.labelsHidden()
.onChange(of: settingsManager.settings.launchAtLogin) { isEnabled in
applyLaunchAtLoginSetting(enabled: isEnabled)
}
Toggle(
"",
isOn: Binding(
get: { settingsManager.settings.launchAtLogin },
set: { settingsManager.settings.launchAtLogin = $0 }
)
)
.labelsHidden()
.onChange(of: settingsManager.settings.launchAtLogin) { isEnabled in
applyLaunchAtLoginSetting(enabled: isEnabled)
}
}
.padding()
.glassEffectIfAvailable(GlassStyle.regular, in: .rect(cornerRadius: 12))
// Software Updates Section
#if !APPSTORE
HStack {
VStack(alignment: .leading, spacing: 4) {
Text("Software Updates")
.font(.headline)
HStack {
VStack(alignment: .leading, spacing: 4) {
Text("Software Updates")
.font(.headline)
if let lastCheck = updateManager.lastUpdateCheckDate {
Text("Last checked: \(lastCheck, style: .relative)")
.font(.caption)
.foregroundColor(.secondary)
.italic()
} else {
Text("Never checked for updates")
.font(.caption)
.foregroundColor(.secondary)
.italic()
if let lastCheck = updateManager.lastUpdateCheckDate {
Text("Last checked: \(lastCheck, style: .relative)")
.font(.caption)
.foregroundColor(.secondary)
.italic()
} else {
Text("Never checked for updates")
.font(.caption)
.foregroundColor(.secondary)
.italic()
}
}
}
Spacer()
Spacer()
Button("Check for Updates Now") {
updateManager.checkForUpdates()
}
.buttonStyle(.bordered)
Button("Check for Updates Now") {
updateManager.checkForUpdates()
}
.buttonStyle(.bordered)
Toggle(
"Automatically check for updates",
Toggle(
"Automatically check for updates",
isOn: $updateManager.automaticallyChecksForUpdates
)
.labelsHidden()
@@ -119,10 +122,12 @@ struct GeneralSetupView: View {
Text(size.displayName)
.font(.caption)
.fontWeight(
settingsManager.settings.subtleReminderSize == size ? .semibold : .regular
settingsManager.settings.subtleReminderSize == size
? .semibold : .regular
)
.foregroundColor(
settingsManager.settings.subtleReminderSize == size ? .primary : .secondary)
settingsManager.settings.subtleReminderSize == size
? .primary : .secondary)
}
.frame(maxWidth: .infinity, minHeight: 60)
.padding(.vertical, 12)
@@ -139,75 +144,74 @@ struct GeneralSetupView: View {
.padding()
.glassEffectIfAvailable(GlassStyle.regular, in: .rect(cornerRadius: 12))
// Links Section
VStack(spacing: 12) {
Text("Support & Contribute")
.font(.headline)
.frame(maxWidth: .infinity, alignment: .leading)
#if !APPSTORE
VStack(spacing: 12) {
Text("Support & Contribute")
.font(.headline)
.frame(maxWidth: .infinity, alignment: .leading)
// GitHub Link
Button(action: {
if let url = URL(string: "https://github.com/mikefreno/Gaze") {
NSWorkspace.shared.open(url)
}
}) {
HStack {
Image(systemName: "chevron.left.forwardslash.chevron.right")
.font(.title3)
VStack(alignment: .leading, spacing: 2) {
Text("View on GitHub")
.font(.subheadline)
.fontWeight(.semibold)
Text("Star the repo, report issues, contribute")
.font(.caption)
.foregroundColor(.secondary)
// GitHub Link
Button(action: {
if let url = URL(string: "https://github.com/mikefreno/Gaze") {
NSWorkspace.shared.open(url)
}
Spacer()
Image(systemName: "arrow.up.right")
.font(.caption)
}) {
HStack {
Image(systemName: "chevron.left.forwardslash.chevron.right")
.font(.title3)
VStack(alignment: .leading, spacing: 2) {
Text("View on GitHub")
.font(.subheadline)
.fontWeight(.semibold)
Text("Star the repo, report issues, contribute")
.font(.caption)
.foregroundColor(.secondary)
}
Spacer()
Image(systemName: "arrow.up.right")
.font(.caption)
}
.padding()
.frame(maxWidth: .infinity)
.contentShape(RoundedRectangle(cornerRadius: 10))
}
.padding()
.frame(maxWidth: .infinity)
.contentShape(RoundedRectangle(cornerRadius: 10))
}
.buttonStyle(.plain)
.buttonStyle(.plain)
.glassEffectIfAvailable(
GlassStyle.regular.interactive(), in: .rect(cornerRadius: 10))
#if !APPSTORE
Button(action: {
if let url = URL(string: "https://buymeacoffee.com/mikefreno") {
NSWorkspace.shared.open(url)
}
}) {
HStack {
Image(systemName: "cup.and.saucer.fill")
.font(.title3)
.foregroundColor(.brown)
VStack(alignment: .leading, spacing: 2) {
Text("Buy Me a Coffee")
.font(.subheadline)
.fontWeight(.semibold)
Text("Support development of Gaze")
.font(.caption)
.foregroundColor(.secondary)
Button(action: {
if let url = URL(string: "https://buymeacoffee.com/mikefreno") {
NSWorkspace.shared.open(url)
}
Spacer()
Image(systemName: "arrow.up.right")
.font(.caption)
}) {
HStack {
Image(systemName: "cup.and.saucer.fill")
.font(.title3)
.foregroundColor(.brown)
VStack(alignment: .leading, spacing: 2) {
Text("Buy Me a Coffee")
.font(.subheadline)
.fontWeight(.semibold)
Text("Support development of Gaze")
.font(.caption)
.foregroundColor(.secondary)
}
Spacer()
Image(systemName: "arrow.up.right")
.font(.caption)
}
.padding()
.frame(maxWidth: .infinity)
.cornerRadius(10)
.contentShape(RoundedRectangle(cornerRadius: 10))
}
.padding()
.frame(maxWidth: .infinity)
.cornerRadius(10)
.contentShape(RoundedRectangle(cornerRadius: 10))
.buttonStyle(.plain)
.glassEffectIfAvailable(
GlassStyle.regular.tint(.orange).interactive(),
in: .rect(cornerRadius: 10))
}
.buttonStyle(.plain)
.glassEffectIfAvailable(
GlassStyle.regular.tint(.orange).interactive(),
in: .rect(cornerRadius: 10))
#endif
}
.padding()
.padding()
#endif
}
}
Spacer()

View File

@@ -14,7 +14,6 @@ struct UserTimersView: View {
var body: some View {
VStack(spacing: 0) {
// Fixed header section
VStack(spacing: 16) {
Image(systemName: "clock.badge.checkmark")
.font(.system(size: 60))
@@ -25,7 +24,6 @@ struct UserTimersView: View {
.padding(.top, 20)
.padding(.bottom, 30)
// Vertically centered content
Spacer()
VStack(spacing: 30) {
Text("Create your own reminder schedules")
@@ -40,22 +38,25 @@ struct UserTimersView: View {
.foregroundColor(.white)
}
.padding()
.glassEffectIfAvailable(GlassStyle.regular.tint(.purple), in: .rect(cornerRadius: 8))
.glassEffectIfAvailable(
GlassStyle.regular.tint(.purple), in: .rect(cornerRadius: 8))
VStack(alignment: .leading, spacing: 12) {
HStack {
Text("Active Timers (\(userTimers.count)/3)")
.font(.headline)
Spacer()
if userTimers.count < 3 {
Button(action: {
showingAddTimer = true
}) {
Label("Add Timer", systemImage: "plus.circle.fill")
#if APPSTORE
HStack {
Text("Active Timers (\(userTimers.count)/3)")
.font(.headline)
Spacer()
if userTimers.count < 3 {
Button(action: {
showingAddTimer = true
}) {
Label("Add Timer", systemImage: "plus.circle.fill")
}
.buttonStyle(.borderedProminent)
}
.buttonStyle(.borderedProminent)
}
}
#endif
if userTimers.isEmpty {
VStack(spacing: 12) {
@@ -156,9 +157,11 @@ struct UserTimerRow: View {
.font(.subheadline)
.fontWeight(.medium)
.lineLimit(1)
Text("\(timer.type.displayName)\(timer.timeOnScreenSeconds)s on screen • \(timer.intervalMinutes) min interval")
.font(.caption)
.foregroundColor(.secondary)
Text(
"\(timer.type.displayName)\(timer.timeOnScreenSeconds)s on screen • \(timer.intervalMinutes) min interval"
)
.font(.caption)
.foregroundColor(.secondary)
}
Spacer()
@@ -188,7 +191,8 @@ struct UserTimerRow: View {
}
Button("Cancel", role: .cancel) {}
} message: {
Text("Are you sure you want to delete this timer? This action cannot be undone.")
Text(
"Are you sure you want to delete this timer? This action cannot be undone.")
}
}
}
@@ -209,7 +213,7 @@ struct UserTimerEditSheet: View {
var onSave: (UserTimer) -> Void
var onCancel: () -> Void
@State private var title: String
@State private var title: String
@State private var message: String
@State private var type: UserTimerType
@State private var timeOnScreen: Int
@@ -297,11 +301,9 @@ struct UserTimerEditSheet: View {
}
.pickerStyle(.segmented)
.onChange(of: type) { newType in
// When switching to subtle, set timeOnScreen to 3 (not user-configurable)
if newType == .subtle {
timeOnScreen = 3
} else if timeOnScreen == 3 {
// When switching from subtle to overlay, set to default overlay duration
timeOnScreen = 10
}
}