Skip to content

Commit ee783da

Browse files
committed
fix(settings): clean up native resolution toggle from PR jsattler#134
- Align default value pattern with existing codebase convention (as? Bool ?? true) - Remove unnecessary init() and registerDefaultSettings() from SettingsStore - Rename toggle label to 'Native Resolution' - Remove toggle from MenuBarSettingsView - Improve help text to clarify toggle behavior and non-Retina displays - Fix missing space in ternary expression
1 parent 595254b commit ee783da

4 files changed

Lines changed: 4 additions & 21 deletions

File tree

‎BetterCapture/Model/SettingsStore.swift‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -238,17 +238,6 @@ enum HDRPreset {
238238
@MainActor
239239
@Observable
240240
final class SettingsStore {
241-
242-
init() {
243-
registerDefaultSettings()
244-
}
245-
246-
func registerDefaultSettings() {
247-
// Add default values for settings here
248-
UserDefaults.standard.register(defaults: [
249-
"captureNativeResolution": true
250-
])
251-
}
252241

253242
// MARK: - Video Settings
254243

@@ -386,7 +375,7 @@ final class SettingsStore {
386375
var captureNativeResolution: Bool {
387376
get {
388377
access(keyPath: \.captureNativeResolution)
389-
return UserDefaults.standard.bool(forKey: "captureNativeResolution")
378+
return UserDefaults.standard.object(forKey: "captureNativeResolution") as? Bool ?? true
390379
}
391380
set {
392381
withMutation(keyPath: \.captureNativeResolution) {

‎BetterCapture/View/MenuBarSettingsView.swift‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -487,12 +487,6 @@ struct VideoSettingsSection: View {
487487
isOn: $settings.captureHDR,
488488
isDisabled: !settings.videoCodec.supportsHDR
489489
)
490-
491-
// Capture Native Resolution Toggle
492-
MenuBarToggle(
493-
name: "Capture Native Resolution",
494-
isOn: $settings.captureNativeResolution
495-
)
496490
}
497491
}
498492
}

‎BetterCapture/View/SettingsView.swift‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ struct VideoSettingsView: View {
6363
}
6464
}
6565

66-
private let captureNativeResHelpText = "Choose between the Native resolution of your display or the Logical (1x) resolution"
66+
private let captureNativeResHelpText = "When enabled, captures at the display's native pixel resolution. When disabled, captures at the logical (1x) resolution. Has no effect on non-Retina displays"
6767

6868
var body: some View {
6969
Form {
@@ -111,7 +111,7 @@ struct VideoSettingsView: View {
111111
.disabled(!settings.videoCodec.supportsHDR)
112112
.help(hdrHelpText)
113113

114-
Toggle("Capture Native Resolution", isOn: $settings.captureNativeResolution)
114+
Toggle("Native Resolution", isOn: $settings.captureNativeResolution)
115115
.help(captureNativeResHelpText)
116116
}
117117

‎BetterCapture/ViewModel/RecorderViewModel.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ final class RecorderViewModel {
386386
if rect.width > 0 && rect.height > 0 {
387387
return CGSize(
388388
width: applyScale ? rect.width * scale : rect.width,
389-
height: applyScale ? rect.height * scale: rect.height
389+
height: applyScale ? rect.height * scale : rect.height
390390
)
391391
}
392392

0 commit comments

Comments
 (0)