Richer notifications (#68)

This commit is contained in:
Max Goedjen
2020-03-21 17:52:51 -07:00
committed by GitHub
parent f674d47507
commit a0052e8395
5 changed files with 36 additions and 10 deletions

View File

@@ -66,7 +66,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
@IBAction func runSetup(sender: AnyObject?) {
let setupWindow = NSWindow(
contentRect: NSRect(x: 0, y: 0, width: 480, height: 300),
contentRect: NSRect(x: 0, y: 0, width: 00, height: 00),
styleMask: [.titled, .closable, .miniaturizable, .resizable, .fullSizeContentView],
backing: .buffered, defer: false)
let setupView = SetupView() { success in
@@ -74,6 +74,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
self.agentStatusChecker.check()
}
setupWindow.contentView = NSHostingView(rootView: setupView)
setupWindow.setContentSize(setupWindow.contentView!.fittingSize)
window.beginSheet(setupWindow, completionHandler: nil)
}

View File

@@ -9,12 +9,12 @@ struct SetupView: View {
var body: some View {
Form {
SetupStepView<Spacer>(text: "Secretive needs to install a helper app to sign requests when the main app isn't running. This app is called \"SecretAgent\" and you might see it in Activity Manager from time to time.",
index: 1,
nestedView: nil,
actionText: "Install") {
index: 1,
nestedView: nil,
actionText: "Install") {
self.installLaunchAgent()
}
SetupStepView(text: "You need to add a line to your shell config (.bashrc or .zshrc) telling SSH to talk to SecretAgent when it wants to authenticate. Drag this into your config file.",
SetupStepView(text: "Add this line to your shell config (.bashrc or .zshrc) telling SSH to talk to SecretAgent when it wants to authenticate. Drag this into your config file.",
index: 2,
nestedView: SetupStepCommandView(text: Constants.socketPrompt),
actionText: "Added") {
@@ -22,9 +22,9 @@ struct SetupView: View {
}
HStack {
Spacer()
Button(action: { self.completion?(true) }) {
Text("Finish")
}
Button(action: { self.completion?(true) }) {
Text("Finish")
}
.padding()
}
}