Fixes add account sheet sizing

Picker images don’t resize so they’ve been commented out
This commit is contained in:
Stuart Breckenridge 2020-08-13 12:20:22 +08:00
parent 13e28f6f3f
commit ffc5978a82
No known key found for this signature in database
GPG Key ID: 79BD673276AE83CE
3 changed files with 37 additions and 36 deletions

View File

@ -31,6 +31,8 @@ struct AccountsPreferencesView: View {
switch viewModel.sheetToShow {
case .add:
AddAccountView(preferencesModel: viewModel)
.frame(width: 300, height: 200)
.padding()
case .credentials:
EditAccountCredentialsView(viewModel: viewModel)
case .none:

View File

@ -15,12 +15,12 @@ struct AddAccountPickerRow: View {
var body: some View {
HStack {
if let img = AppAssets.image(for: accountType) {
Image(rsImage: img)
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 15, height: 15)
}
// if let img = AppAssets.image(for: accountType) {
// Image(rsImage: img)
// .resizable()
// .aspectRatio(contentMode: .fit)
// .frame(width: 15, height: 15)
// }
switch accountType {
case .onMyMac:

View File

@ -16,36 +16,35 @@ struct AddAccountView: View {
@StateObject private var viewModel = AddAccountModel()
var body: some View {
VStack(alignment: .leading) {
Form {
Text("Add an Account").font(.headline)
Form {
Picker("Account Type",
selection: $viewModel.selectedAddAccount,
content: {
ForEach(0..<viewModel.addableAccountTypes.count, content: { i in
AddAccountPickerRow(accountType: viewModel.addableAccountTypes[i]).tag(viewModel.addableAccountTypes[i])
})
})
switch viewModel.selectedAddAccount {
case .onMyMac:
addLocalAccountView
case .cloudKit:
iCloudAccountView
case .feedbin:
userNameAndPasswordView
case .feedWrangler:
userNameAndPasswordView
case .freshRSS:
userNamePasswordAndAPIUrlView
case .feedly:
oAuthView
case .newsBlur:
userNameAndPasswordView
}
Picker("Account Type",
selection: $viewModel.selectedAddAccount,
content: {
ForEach(0..<viewModel.addableAccountTypes.count, content: { i in
AddAccountPickerRow(accountType: viewModel.addableAccountTypes[i]).tag(viewModel.addableAccountTypes[i])
})
}).pickerStyle(MenuPickerStyle())
switch viewModel.selectedAddAccount {
case .onMyMac:
addLocalAccountView
case .cloudKit:
iCloudAccountView
case .feedbin:
userNameAndPasswordView
case .feedWrangler:
userNameAndPasswordView
case .freshRSS:
userNamePasswordAndAPIUrlView
case .feedly:
oAuthView
case .newsBlur:
userNameAndPasswordView
}
Spacer()
HStack {
if viewModel.accountIsAuthenticating {
@ -82,8 +81,8 @@ struct AddAccountView: View {
}
}
}
.frame(width: 300, height: 200, alignment: .top)
.padding()
.onChange(of: viewModel.selectedAddAccount) { _ in
viewModel.resetUserEntries()
}