From 9830a977a0908116c682162af7c55138d20cdaad Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Thu, 9 Jul 2020 16:58:04 +0800 Subject: [PATCH 1/3] Add Web Feed Colours Icons in the picker now use accent colour. --- Multiplatform/Shared/Add/AddWebFeedView.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Multiplatform/Shared/Add/AddWebFeedView.swift b/Multiplatform/Shared/Add/AddWebFeedView.swift index d4ae6d20b..7eeaf252e 100644 --- a/Multiplatform/Shared/Add/AddWebFeedView.swift +++ b/Multiplatform/Shared/Add/AddWebFeedView.swift @@ -134,14 +134,14 @@ struct AddWebFeedView: View { if viewModel.containers[index] is Folder { HStack(alignment: .top) { if let image = viewModel.smallIconImage(for: viewModel.containers[index]) { - Image(rsImage: image) + Image(rsImage: image).foregroundColor(.accentColor) } Text("\(containerName)").tag(index) }.padding(.leading, 16) } else { HStack(alignment: .top) { if let image = viewModel.smallIconImage(for: viewModel.containers[index]) { - Image(rsImage: image) + Image(rsImage: image).foregroundColor(.accentColor) } Text(containerName).tag(index) } From f4deab1361106615f66446b1c675da9cf6690889 Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Thu, 9 Jul 2020 17:04:04 +0800 Subject: [PATCH 2/3] Updates title to match current app --- Multiplatform/Shared/Add/AddWebFeedView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Multiplatform/Shared/Add/AddWebFeedView.swift b/Multiplatform/Shared/Add/AddWebFeedView.swift index 7eeaf252e..8b01617dc 100644 --- a/Multiplatform/Shared/Add/AddWebFeedView.swift +++ b/Multiplatform/Shared/Add/AddWebFeedView.swift @@ -123,7 +123,7 @@ struct AddWebFeedView: View { } var providedNameTextField: some View { - TextField("Optional", text: $viewModel.providedName) + TextField("Title (Optional)", text: $viewModel.providedName) } @ViewBuilder var folderPicker: some View { From 771fe21422087397685996167768e9406f453550 Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Thu, 9 Jul 2020 17:36:17 +0800 Subject: [PATCH 3/3] Tidy up --- Multiplatform/Shared/Add/AddWebFeedView.swift | 36 ++++++++++++------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/Multiplatform/Shared/Add/AddWebFeedView.swift b/Multiplatform/Shared/Add/AddWebFeedView.swift index 8b01617dc..2056baf9e 100644 --- a/Multiplatform/Shared/Add/AddWebFeedView.swift +++ b/Multiplatform/Shared/Add/AddWebFeedView.swift @@ -14,7 +14,7 @@ import RSCore struct AddWebFeedView: View { @Environment(\.presentationMode) private var presentationMode - @ObservedObject private var viewModel = AddWebFeedModel() + @StateObject private var viewModel = AddWebFeedModel() @ViewBuilder var body: some View { #if os(iOS) @@ -27,14 +27,15 @@ struct AddWebFeedView: View { presentationMode.wrappedValue.dismiss() } }) - #else macForm .onAppear { viewModel.pasteUrlFromPasteboard() }.alert(isPresented: $viewModel.showError) { - Alert(title: Text("Oops"), message: Text(viewModel.addFeedError!.localizedDescription), dismissButton: Alert.Button.cancel({ - viewModel.addFeedError = AddWebFeedError.none + Alert(title: Text("Oops"), + message: Text(viewModel.addFeedError!.localizedDescription), + dismissButton: Alert.Button.cancel({ + viewModel.addFeedError = AddWebFeedError.none })) }.onReceive(viewModel.$shouldDismiss, perform: { dismiss in if dismiss == true { @@ -59,7 +60,6 @@ struct AddWebFeedView: View { }.padding() LazyVGrid(columns: [GridItem(.fixed(75), spacing: 10, alignment: .trailing),GridItem(.fixed(400), spacing: 0, alignment: .leading) ], alignment: .leading, spacing: 10, pinnedViews: [], content:{ - Text("URL:").bold() urlTextField .textFieldStyle(RoundedBorderTextFieldStyle()) @@ -134,16 +134,20 @@ struct AddWebFeedView: View { if viewModel.containers[index] is Folder { HStack(alignment: .top) { if let image = viewModel.smallIconImage(for: viewModel.containers[index]) { - Image(rsImage: image).foregroundColor(.accentColor) + Image(rsImage: image) + .foregroundColor(.accentColor) } - Text("\(containerName)").tag(index) + Text("\(containerName)") + .tag(index) }.padding(.leading, 16) } else { HStack(alignment: .top) { if let image = viewModel.smallIconImage(for: viewModel.containers[index]) { - Image(rsImage: image).foregroundColor(.accentColor) + Image(rsImage: image) + .foregroundColor(.accentColor) } - Text(containerName).tag(index) + Text(containerName) + .tag(index) } } } @@ -159,13 +163,18 @@ struct AddWebFeedView: View { Image(rsImage: image) } Text("\(containerName)") - }.padding(.leading, 2).tag(index) + } + .padding(.leading, 2) + .tag(index) } else { - Text(containerName).padding(.leading, 2).tag(index) + Text(containerName) + .padding(.leading, 2) + .tag(index) } } }) - }).padding(.leading, -8) + }) + .padding(.leading, -8) #endif } @@ -188,7 +197,8 @@ struct AddWebFeedView: View { }) .disabled(!viewModel.providedURL.mayBeURL) .help("Add Feed") - }.padding(.trailing, 2) + } + .padding(.trailing, 2) }