mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Add Done button to Setting modal
This commit is contained in:
@@ -859,9 +859,9 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
|
||||
// settingsViewController.presentingParentController = rootSplitViewController
|
||||
// rootSplitViewController.present(settingsNavViewController, animated: true)
|
||||
|
||||
let settings = UIHostingController(rootView: SettingsView(viewModel: SettingsView.ViewModel()))
|
||||
settings.modalPresentationStyle = .formSheet
|
||||
rootSplitViewController.present(settings, animated: true)
|
||||
rootSplitViewController.present(style: .formSheet) {
|
||||
SettingsView(viewModel: SettingsView.ViewModel())
|
||||
}
|
||||
}
|
||||
|
||||
func showAdd(_ type: AddControllerType) {
|
||||
|
||||
@@ -10,18 +10,21 @@ import SwiftUI
|
||||
import Combine
|
||||
import Account
|
||||
|
||||
|
||||
struct SettingsView : View {
|
||||
|
||||
@ObservedObject var viewModel: ViewModel
|
||||
|
||||
@Environment(\.viewController) private var viewController: UIViewController?
|
||||
|
||||
@State var isWebsitePresented: Bool = false
|
||||
@State var website: String? = nil
|
||||
@State private var isWebsitePresented: Bool = false
|
||||
@State private var website: String? = nil
|
||||
|
||||
@State var isOPMLImportPresented: Bool = false
|
||||
@State var isOPMLImportDocPickerPresented: Bool = false
|
||||
@State var isOPMLExportPresented: Bool = false
|
||||
@State var isOPMLExportDocPickerPresented: Bool = false
|
||||
@State var opmlAccount: Account? = nil
|
||||
@State private var isOPMLImportPresented: Bool = false
|
||||
@State private var isOPMLImportDocPickerPresented: Bool = false
|
||||
@State private var isOPMLExportPresented: Bool = false
|
||||
@State private var isOPMLExportDocPickerPresented: Bool = false
|
||||
@State private var opmlAccount: Account? = nil
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
@@ -123,6 +126,7 @@ struct SettingsView : View {
|
||||
|
||||
}
|
||||
.navigationBarTitle(Text("Settings"), displayMode: .inline)
|
||||
.navigationBarItems(leading: Button(action: { self.viewController?.dismiss(animated: true) }) { Text("Done") } )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Submodule submodules/RSCore updated: 7a48956576...3e0dbb1c0a
Reference in New Issue
Block a user