mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Improve appearance of settings views between platforms
This commit is contained in:
parent
8f9d1746fb
commit
35f4762b35
@ -16,17 +16,40 @@ struct AccountLoginView: View {
|
||||
HStack {
|
||||
Image(systemName: "person.circle")
|
||||
.foregroundColor(.gray)
|
||||
#if os(iOS)
|
||||
TextField("Username", text: $username)
|
||||
.keyboardType(.emailAddress)
|
||||
.autocapitalization(.none)
|
||||
.disableAutocorrection(true)
|
||||
.textFieldStyle(RoundedBorderTextFieldStyle())
|
||||
#else
|
||||
TextField("Username", text: $username)
|
||||
#endif
|
||||
}
|
||||
HStack {
|
||||
Image(systemName: "lock.circle")
|
||||
.foregroundColor(.gray)
|
||||
#if os(iOS)
|
||||
SecureField("Password", text: $password)
|
||||
.autocapitalization(.none)
|
||||
.disableAutocorrection(true)
|
||||
.textFieldStyle(RoundedBorderTextFieldStyle())
|
||||
#else
|
||||
SecureField("Password", text: $password)
|
||||
#endif
|
||||
}
|
||||
HStack {
|
||||
Image(systemName: "link.circle")
|
||||
.foregroundColor(.gray)
|
||||
#if os(iOS)
|
||||
TextField("Server URL", text: $server)
|
||||
.keyboardType(.URL)
|
||||
.autocapitalization(.none)
|
||||
.disableAutocorrection(true)
|
||||
.textFieldStyle(RoundedBorderTextFieldStyle())
|
||||
#else
|
||||
TextField("Server URL", text: $server)
|
||||
#endif
|
||||
}
|
||||
Spacer()
|
||||
if isLoggingIn {
|
||||
|
@ -7,7 +7,11 @@ struct AccountView: View {
|
||||
|
||||
var body: some View {
|
||||
if isLoggedIn {
|
||||
AccountLogoutView(accountModel: $accountModel, isLoggedIn: $isLoggedIn, isLoggingIn: $isLoggingIn)
|
||||
HStack {
|
||||
Spacer()
|
||||
AccountLogoutView(accountModel: $accountModel, isLoggedIn: $isLoggedIn, isLoggingIn: $isLoggingIn)
|
||||
Spacer()
|
||||
}
|
||||
} else {
|
||||
AccountLoginView(accountModel: $accountModel, isLoggedIn: $isLoggedIn, isLoggingIn: $isLoggingIn)
|
||||
}
|
||||
|
@ -12,12 +12,11 @@ struct PreferencesView: View {
|
||||
}
|
||||
.pickerStyle(SegmentedPickerStyle())
|
||||
#elseif os(macOS)
|
||||
Picker(selection: $appearance, label: EmptyView()) {
|
||||
Picker(selection: $appearance, label: Text("Appearance")) {
|
||||
Text("System").tag(0)
|
||||
Text("Light Mode").tag(1)
|
||||
Text("Dark Mode").tag(2)
|
||||
}
|
||||
.pickerStyle(RadioGroupPickerStyle())
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ struct SettingsView: View {
|
||||
var body: some View {
|
||||
TabView(selection: $selectedView) {
|
||||
Form {
|
||||
Section(header: Text("Log in to your account")) {
|
||||
Section(header: Text("Login Details")) {
|
||||
AccountView()
|
||||
}
|
||||
}
|
||||
@ -15,11 +15,9 @@ struct SettingsView: View {
|
||||
Text("Account")
|
||||
}
|
||||
.tag(0)
|
||||
Form {
|
||||
Section(header: Text("Appearance")) {
|
||||
PreferencesView()
|
||||
Spacer()
|
||||
}
|
||||
VStack {
|
||||
PreferencesView()
|
||||
Spacer()
|
||||
}
|
||||
.tabItem {
|
||||
Image(systemName: "gear")
|
||||
|
Loading…
Reference in New Issue
Block a user