mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Move TabView into Settings block of app entrypoint to resolve Mac crash
This commit is contained in:
parent
e06025c654
commit
0460ca73ca
@ -4,6 +4,7 @@ import SwiftUI
|
||||
struct WriteFreely_MultiPlatformApp: App {
|
||||
@StateObject private var preferences = PreferencesModel()
|
||||
@StateObject private var account = AccountModel()
|
||||
@State private var selectedTab = 0
|
||||
|
||||
#if DEBUG
|
||||
@StateObject private var store = testPostStore
|
||||
@ -19,10 +20,30 @@ struct WriteFreely_MultiPlatformApp: App {
|
||||
|
||||
#if os(macOS)
|
||||
Settings {
|
||||
SettingsView(preferences: preferences, account: account)
|
||||
.frame(minWidth: 300, maxWidth: 300, minHeight: 200, maxHeight: 200)
|
||||
.padding()
|
||||
.preferredColorScheme(preferences.preferredColorScheme)
|
||||
TabView(selection: $selectedTab) {
|
||||
Form {
|
||||
Section(header: Text("Login Details")) {
|
||||
AccountView(account: account)
|
||||
}
|
||||
}
|
||||
.tabItem {
|
||||
Image(systemName: "person.crop.circle")
|
||||
Text("Account")
|
||||
}
|
||||
.tag(0)
|
||||
VStack {
|
||||
PreferencesView(preferences: preferences)
|
||||
Spacer()
|
||||
}
|
||||
.tabItem {
|
||||
Image(systemName: "gear")
|
||||
Text("Preferences")
|
||||
}
|
||||
.tag(1)
|
||||
}
|
||||
.frame(minWidth: 300, maxWidth: 300, minHeight: 200, maxHeight: 200)
|
||||
.padding()
|
||||
.preferredColorScheme(preferences.preferredColorScheme)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -7,12 +7,12 @@
|
||||
<key>WriteFreely-MultiPlatform (iOS).xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>1</integer>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
<key>WriteFreely-MultiPlatform (macOS).xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>0</integer>
|
||||
<integer>1</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
|
Loading…
Reference in New Issue
Block a user