From df0364b5e1bef317caeb2e1ff25dc3d933dd4ef6 Mon Sep 17 00:00:00 2001 From: Joshua Sattler <34030048+jsattler@users.noreply.github.com> Date: Sun, 8 Feb 2026 10:32:15 +0100 Subject: [PATCH] feat: improve settings view Align structure and prepare for automatic updates. --- BetterCapture/Model/SettingsStore.swift | 14 ++++++ BetterCapture/View/SettingsView.swift | 60 ++++++++++++++++--------- 2 files changed, 54 insertions(+), 20 deletions(-) diff --git a/BetterCapture/Model/SettingsStore.swift b/BetterCapture/Model/SettingsStore.swift index 108562b..5aa61c6 100644 --- a/BetterCapture/Model/SettingsStore.swift +++ b/BetterCapture/Model/SettingsStore.swift @@ -368,6 +368,20 @@ final class SettingsStore { } } + // MARK: - Update Settings + + var automaticallyCheckForUpdates: Bool { + get { + access(keyPath: \.automaticallyCheckForUpdates) + return UserDefaults.standard.object(forKey: "automaticallyCheckForUpdates") as? Bool ?? true + } + set { + withMutation(keyPath: \.automaticallyCheckForUpdates) { + UserDefaults.standard.set(newValue, forKey: "automaticallyCheckForUpdates") + } + } + } + // MARK: - Output Settings /// The default output directory (Movies/BetterCapture) diff --git a/BetterCapture/View/SettingsView.swift b/BetterCapture/View/SettingsView.swift index 7e99baf..ab17064 100644 --- a/BetterCapture/View/SettingsView.swift +++ b/BetterCapture/View/SettingsView.swift @@ -25,12 +25,8 @@ struct SettingsView: View { Tab("Audio", systemImage: "waveform") { AudioSettingsView(settings: settings) } - - Tab("Content", systemImage: "rectangle.dashed") { - ContentFilterSettingsView(settings: settings) - } } - .frame(width: 450, height: 300) + .frame(width: 500, height: 420) } } @@ -96,6 +92,19 @@ struct VideoSettingsView: View { .disabled(!settings.videoCodec.supportsHDR) .help(hdrHelpText) } + + Section("Display Elements") { + Toggle("Show Cursor", isOn: $settings.showCursor) + Toggle("Show Wallpaper", isOn: $settings.showWallpaper) + Toggle("Show Menu Bar", isOn: $settings.showMenuBar) + Toggle("Show Dock", isOn: $settings.showDock) + Toggle("Show BetterCapture", isOn: $settings.showBetterCapture) + } + + Section("Window Capture") { + Toggle("Show Window Shadows", isOn: $settings.showWindowShadows) + .help("Include window shadows when capturing individual windows") + } } .formStyle(.grouped) .padding() @@ -185,6 +194,16 @@ struct GeneralSettingsView: View { } } } + + Section("Software Updates") { + Toggle("Automatically check for updates", isOn: $settings.automaticallyCheckForUpdates) + + LabeledContent("Updates") { + Button("Check for Update") {} + } + } + + AboutSection() } .formStyle(.grouped) .padding() @@ -207,28 +226,29 @@ struct GeneralSettingsView: View { } } -// MARK: - Content Filter Settings +// MARK: - About Section -struct ContentFilterSettingsView: View { - @Bindable var settings: SettingsStore +struct AboutSection: View { + private var appVersion: String { + Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Unknown" + } + + private var buildNumber: String { + Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? "Unknown" + } var body: some View { - Form { - Section("Display Elements") { - Toggle("Show Cursor", isOn: $settings.showCursor) - Toggle("Show Wallpaper", isOn: $settings.showWallpaper) - Toggle("Show Menu Bar", isOn: $settings.showMenuBar) - Toggle("Show Dock", isOn: $settings.showDock) - Toggle("Show BetterCapture", isOn: $settings.showBetterCapture) + Section("About") { + LabeledContent("Version", value: "\(appVersion) (\(buildNumber))") + + LabeledContent("Website") { + Link("bettercapture.app", destination: URL(string: "https://bettercapture.app")!) } - Section("Window Capture") { - Toggle("Show Window Shadows", isOn: $settings.showWindowShadows) - .help("Include window shadows when capturing individual windows") + LabeledContent("Source Code") { + Link("github.com/jsattler/BetterCapture", destination: URL(string: "https://github.com/jsattler/BetterCapture")!) } } - .formStyle(.grouped) - .padding() } }