Skip to content

Commit

Permalink
Switched snapshot host app to mainScene/tweaked for opening settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
grigorye committed Jun 25, 2023
1 parent f3117e4 commit 31afed9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import Accessibility
@available(macOS 13.0, *)
@main
struct TMBuddySnapshotHostApp: App {

@NSApplicationDelegateAdaptor private var appDelegate: AppDelegate

@AppStorage("appStateSampleJsonBase64") var appStateSampleJsonBase64: String?

var appStateSample: AppStateSample {
Expand All @@ -16,11 +17,17 @@ struct TMBuddySnapshotHostApp: App {
}

var body: some Scene {
WindowGroup {
mainWindowContentView().fixedSize()
mainScene {
mainWindowContentView()
.appStateSample(appStateSample)
.snapshottingUITestWindow()
}
.windowResizability(.contentSize)
}
}

class AppDelegate: NSObject, NSApplicationDelegate {

func applicationDidFinishLaunching(_ aNotification: Notification) {
openSettings()
}
}
1 change: 1 addition & 0 deletions XcodeGen/Base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ targets:
- Targets/TMBuddyUITestSnapshotsHost/Sources
- Targets/TMBuddyUITestSnapshotsHost/Resources
- Targets/OtherTesting/Snapshotting
- Targets/TMBuddy/Sources/Utilities/OpeningSettings.swift
settings:
PRODUCT_MODULE_NAME: $(TARGET_NAME)
PRODUCT_NAME: $(TARGET_NAME)$(GE_PRODUCT_NAME_EXTRA)
Expand Down

0 comments on commit 31afed9

Please sign in to comment.