diff --git a/Loop/Extensions/Defaults+Extensions.swift b/Loop/Extensions/Defaults+Extensions.swift index f5814095..8acbabc3 100644 --- a/Loop/Extensions/Defaults+Extensions.swift +++ b/Loop/Extensions/Defaults+Extensions.swift @@ -98,4 +98,7 @@ extension Defaults.Keys { "rightThird", default: [[.kVK_ANSI_L]] ) + + // BETA + static let animateWindowResizes = Key("animateWindowResizes", default: false) } diff --git a/Loop/Helpers/Views/BetaIndicator.swift b/Loop/Helpers/Views/BetaIndicator.swift new file mode 100644 index 00000000..4b653995 --- /dev/null +++ b/Loop/Helpers/Views/BetaIndicator.swift @@ -0,0 +1,30 @@ +// +// BetaIndicator.swift +// Loop +// +// Created by Kai Azim on 2023-09-02. +// + +import SwiftUI + +struct BetaIndicator: View { + let text: String + let color: Color + + init(_ text: String, color: Color = .green) { + self.text = text + self.color = color + } + + var body: some View { + Text(text) + .font(.caption2) + .padding(.horizontal, 4) + .padding(.vertical, 2) + .background { + RoundedRectangle(cornerRadius: 50) + .stroke(lineWidth: 1) + } + .foregroundStyle(color) + } +} diff --git a/Loop/Helpers/VisualEffectView.swift b/Loop/Helpers/Views/VisualEffectView.swift similarity index 100% rename from Loop/Helpers/VisualEffectView.swift rename to Loop/Helpers/Views/VisualEffectView.swift diff --git a/Loop/Settings/Views/GeneralSettingsView.swift b/Loop/Settings/Views/GeneralSettingsView.swift index b2ce46a9..a70c9afb 100644 --- a/Loop/Settings/Views/GeneralSettingsView.swift +++ b/Loop/Settings/Views/GeneralSettingsView.swift @@ -20,6 +20,7 @@ struct GeneralSettingsView: View { @Default(.gradientColor) var gradientColor @Default(.currentIcon) var currentIcon @Default(.timesLooped) var timesLooped + @Default(.animateWindowResizes) var animateWindowResizes let iconManager = IconManager() @@ -37,6 +38,13 @@ struct GeneralSettingsView: View { try? SMAppService().unregister() } } + + Toggle(isOn: $animateWindowResizes, label: { + HStack { + Text("Animate windows being resized") + BetaIndicator("BETA") + } + }) } Section("Loop's icon") {