mirror of
https://github.com/maxgoedjen/secretive.git
synced 2026-03-07 02:07:22 +01:00
Lots of UI quality of life changes.
This commit is contained in:
@@ -91,8 +91,12 @@ struct ContentView<UpdaterType: UpdaterProtocol, AgentStatusCheckerType: AgentSt
|
||||
}
|
||||
|
||||
func updateNotice() -> ToolbarItem<Void, AnyView> {
|
||||
let update = updater.update ?? Release(name: "", html_url: URL(string:"https://example.com")!, body: "")
|
||||
// guard let update = updater.update else { fatalError() }
|
||||
// let update = updater.update ?? Release(name: "", html_url: URL(string:"https://example.com")!, body: "")
|
||||
guard let update = updater.update else {
|
||||
return ToolbarItem {
|
||||
AnyView(Spacer())
|
||||
}
|
||||
}
|
||||
let color: Color
|
||||
let text: String
|
||||
if update.critical {
|
||||
|
||||
@@ -33,16 +33,14 @@ struct CreateSecretView: View {
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
.onExitCommand(perform: dismissalBlock)
|
||||
}
|
||||
HStack {
|
||||
Spacer()
|
||||
Button(action: dismissalBlock) {
|
||||
Text("Cancel")
|
||||
}
|
||||
Button(action: save) {
|
||||
Text("Create")
|
||||
}.disabled(name.isEmpty)
|
||||
Button("Cancel", action: dismissalBlock)
|
||||
.keyboardShortcut(.cancelAction)
|
||||
Button("Create", action: save)
|
||||
.disabled(name.isEmpty)
|
||||
.keyboardShortcut(.defaultAction)
|
||||
}
|
||||
}.padding()
|
||||
}
|
||||
|
||||
@@ -43,14 +43,16 @@ struct DeleteSecretView<StoreType: SecretStoreModifiable>: View {
|
||||
}
|
||||
HStack {
|
||||
Spacer()
|
||||
Button(action: delete) {
|
||||
Text("Delete")
|
||||
}.disabled(confirm != secret.name)
|
||||
Button(action: { self.dismissalBlock(false) }) {
|
||||
Text("Don't Delete")
|
||||
Button("Delete", action: delete)
|
||||
.disabled(confirm != secret.name)
|
||||
.keyboardShortcut(.delete)
|
||||
Button("Don't Delete") {
|
||||
self.dismissalBlock(false)
|
||||
}
|
||||
.keyboardShortcut(.cancelAction)
|
||||
}
|
||||
}.padding()
|
||||
}
|
||||
.padding()
|
||||
.frame(minWidth: 400)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
import SwiftUI
|
||||
import Brief
|
||||
|
||||
//struct UpdateView<UpdaterType: UpdaterProtocol>: View {
|
||||
//
|
||||
//
|
||||
//}
|
||||
|
||||
struct UpdateDetailView: View {
|
||||
struct UpdateDetailView<UpdaterType: Updater>: View {
|
||||
|
||||
private let update: Release
|
||||
@EnvironmentObject var updater: UpdaterType
|
||||
|
||||
init(update: Release) {
|
||||
self.update = update
|
||||
@@ -22,11 +18,19 @@ struct UpdateDetailView: View {
|
||||
attributedBody
|
||||
}
|
||||
}
|
||||
Button(action: {
|
||||
NSWorkspace.shared.open(update.html_url)
|
||||
}, label: {
|
||||
Text("Update")
|
||||
})
|
||||
HStack {
|
||||
if !update.critical {
|
||||
Button("Ignore") {
|
||||
updater.ignore(release: update)
|
||||
}
|
||||
Spacer()
|
||||
}
|
||||
Button("Update") {
|
||||
NSWorkspace.shared.open(update.html_url)
|
||||
}
|
||||
.keyboardShortcut(.defaultAction)
|
||||
}
|
||||
|
||||
}
|
||||
.padding()
|
||||
.frame(maxWidth: 500)
|
||||
|
||||
Reference in New Issue
Block a user