Minimum frames (#69)

This commit is contained in:
Max Goedjen 2020-03-21 18:10:37 -07:00 committed by GitHub
parent 2e9a3eb90d
commit 0a9ecb039e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 7 deletions

View File

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

View File

@ -72,7 +72,7 @@ struct ContentView<UpdaterType: UpdaterProtocol, AgentStatusCheckerType: AgentSt
} else { } else {
NoStoresView() NoStoresView()
} }
} }.frame(minWidth: 640, minHeight: 320)
} }
func updateNotice() -> some View { func updateNotice() -> some View {

View File

@ -27,7 +27,7 @@ struct SetupView: View {
} }
.padding() .padding()
} }
} }.frame(minWidth: 640, minHeight: 400)
} }
} }
@ -64,10 +64,8 @@ struct SetupStepView<NestedViewType: View>: View {
Text(text) Text(text)
.opacity(completed ? 0.5 : 1) .opacity(completed ? 0.5 : 1)
.lineLimit(nil) .lineLimit(nil)
.frame(idealHeight: 0, maxHeight: .infinity)
if nestedView != nil { if nestedView != nil {
Spacer() nestedView!.padding()
nestedView!
} }
} }
.padding() .padding()
@ -92,6 +90,7 @@ struct SetupStepCommandView: View {
.lineLimit(nil) .lineLimit(nil)
.font(.system(.caption, design: .monospaced)) .font(.system(.caption, design: .monospaced))
.multilineTextAlignment(.leading) .multilineTextAlignment(.leading)
.frame(minHeight: 50)
HStack { HStack {
Spacer() Spacer()
Button(action: copy) { Button(action: copy) {