Skip to content

Commit

Permalink
✨ Add window animation settings in settings window
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKai77 committed Sep 2, 2023
1 parent 69dba55 commit 3ffc098
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Loop/Extensions/Defaults+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,7 @@ extension Defaults.Keys {
"rightThird",
default: [[.kVK_ANSI_L]]
)

// BETA
static let animateWindowResizes = Key<Bool>("animateWindowResizes", default: false)
}
30 changes: 30 additions & 0 deletions Loop/Helpers/Views/BetaIndicator.swift
Original file line number Diff line number Diff line change
@@ -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)
}
}
File renamed without changes.
8 changes: 8 additions & 0 deletions Loop/Settings/Views/GeneralSettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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") {
Expand Down

0 comments on commit 3ffc098

Please sign in to comment.