Restored files from old Mac, force pushing

This commit is contained in:
Hariharan Mudaliar 2025-07-13 20:26:03 +05:30
commit 5040381840
126 changed files with 10431 additions and 67 deletions

View file

@ -0,0 +1,54 @@
//
// EditPanelView.swift
// boringNotch
//
// Created by Richard Kunkli on 12/08/2024.
//
import SwiftUI
struct EditPanelView: View {
@State var wallpaperPath: URL?
var body: some View {
VStack {
HStack {
Text("Edit layout")
.font(.system(.largeTitle, design: .rounded))
.foregroundColor(.white.opacity(0.5))
Spacer()
Button {
exit(0)
} label: {
Label("Close", systemImage: "xmark")
}
.controlSize(.extraLarge)
.buttonStyle(AccessoryBarButtonStyle())
}
.padding()
}
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top)
}
}
#Preview {
EditPanelView()
}
struct VisualEffectView: NSViewRepresentable {
let material: NSVisualEffectView.Material
let blendingMode: NSVisualEffectView.BlendingMode
func makeNSView(context _: Context) -> NSVisualEffectView {
let visualEffectView = NSVisualEffectView()
visualEffectView.material = material
visualEffectView.blendingMode = blendingMode
visualEffectView.state = NSVisualEffectView.State.active
visualEffectView.isEmphasized = true
return visualEffectView
}
func updateNSView(_ visualEffectView: NSVisualEffectView, context _: Context) {
visualEffectView.material = material
visualEffectView.blendingMode = blendingMode
}
}

View file

@ -0,0 +1,28 @@
//
// ListItemPopover.swift
// boringNotch
//
// Created by Richard Kunkli on 15/09/2024.
//
import SwiftUI
struct ListItemPopover<Content: View>: View {
let content: () -> Content
@State private var isPresented: Bool = false
var body: some View {
Button {
isPresented.toggle()
} label: {
Image(systemName: "info.circle")
.foregroundStyle(.secondary)
}
.controlSize(.regular)
.popover(isPresented: $isPresented, attachmentAnchor: .rect(.bounds), arrowEdge: .trailing, content: {
content()
.padding()
})
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,67 @@
//
// SoftwareUpdater.swift
// boringNotch
//
// Created by Richard Kunkli on 09/08/2024.
//
import SwiftUI
import Sparkle
final class CheckForUpdatesViewModel: ObservableObject {
@Published var canCheckForUpdates = false
init(updater: SPUUpdater) {
updater.publisher(for: \.canCheckForUpdates)
.assign(to: &$canCheckForUpdates)
}
}
struct CheckForUpdatesView: View {
@ObservedObject private var checkForUpdatesViewModel: CheckForUpdatesViewModel
private let updater: SPUUpdater
init(updater: SPUUpdater) {
self.updater = updater
// Create our view model for our CheckForUpdatesView
self.checkForUpdatesViewModel = CheckForUpdatesViewModel(updater: updater)
}
var body: some View {
Button("Check for Updates…", action: updater.checkForUpdates)
.disabled(!checkForUpdatesViewModel.canCheckForUpdates)
}
}
struct UpdaterSettingsView: View {
private let updater: SPUUpdater
@State private var automaticallyChecksForUpdates: Bool
@State private var automaticallyDownloadsUpdates: Bool
init(updater: SPUUpdater) {
self.updater = updater
self.automaticallyChecksForUpdates = updater.automaticallyChecksForUpdates
self.automaticallyDownloadsUpdates = updater.automaticallyDownloadsUpdates
}
var body: some View {
Section {
Toggle("Automatically check for updates", isOn: $automaticallyChecksForUpdates)
.onChange(of: automaticallyChecksForUpdates) { _, newValue in
updater.automaticallyChecksForUpdates = newValue
}
Toggle("Automatically download updates", isOn: $automaticallyDownloadsUpdates)
.disabled(!automaticallyChecksForUpdates)
.onChange(of: automaticallyDownloadsUpdates) { _, newValue in
updater.automaticallyDownloadsUpdates = newValue
}
} header: {
HStack {
Text("Software updates")
}
}
}
}