Skip to content

Commit

Permalink
🗑️ Delete useless code
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKai77 committed Aug 17, 2023
1 parent efc484a commit 8c98492
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 28 deletions.
25 changes: 3 additions & 22 deletions Loop/About Window/AboutView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ struct AboutView: View {
@Environment(\.openURL) private var openURL

@State private var isShowingAcknowledgements = false
@State private var isHoveringOverIcon = false

let packages: [PackageDescription] = [
PackageDescription(
Expand All @@ -42,31 +41,13 @@ struct AboutView: View {
)
]

var iconAnimation: Animation {
Animation.snappy
.speed(0.5)
}

var body: some View {
VStack {
VStack(spacing: 5) {

// When user puts their cursor at the center of the icon, the icon will spin
ZStack {
Image(nsImage: NSApplication.shared.applicationIconImage)
.resizable()
.frame(width: 120, height: 120)
.rotationEffect(Angle.degrees(isHoveringOverIcon ? 360 : 0))
.animation(iconAnimation, value: isHoveringOverIcon)

// This is what the user needs to hover over
Circle()
.foregroundColor(.clear)
.frame(width: 30, height: 30)
.onHover { hover in
self.isHoveringOverIcon = hover
}
}
Image(nsImage: NSApplication.shared.applicationIconImage)
.resizable()
.frame(width: 120, height: 120)

Text("\(Bundle.main.appName)")
.font(.title)
Expand Down
6 changes: 0 additions & 6 deletions Loop/Helpers/IconManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,6 @@ class IconManager {

func checkIfUnlockedNewIcon() {
for icon in icons where icon.unlockTime == Defaults[.timesLooped] {
if #available(macOS 14.0, *) {
NSApp.activate()
} else {
NSApp.activate(ignoringOtherApps: true)
}

let alert = NSAlert()
alert.icon = NSImage(named: icon.name)
if let message = icon.unlockMessage {
Expand Down
1 change: 1 addition & 0 deletions Loop/Settings/Views/PreviewSettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ struct PreviewSettingsView: View {
PreviewView(previewMode: true)
}
.frame(height: 150)
.opacity(previewVisibility ? 1 : 0.5)

Section {
Slider(
Expand Down

0 comments on commit 8c98492

Please sign in to comment.