mirror of
https://github.com/yattee/yattee.git
synced 2026-06-07 23:34:19 +00:00
Make source add/edit forms feel native on macOS
Use grouped Form style with LabeledContent rows and move primary actions into the sheet toolbar for SMB, WebDAV, Local Folder, Remote Server and the Edit sheet. iOS and tvOS branches unchanged.
This commit is contained in:
@@ -118,6 +118,11 @@ private struct EditRemoteServerContent: View {
|
||||
#if os(tvOS)
|
||||
TVSettingsTextField(title: String(localized: "sources.field.name"), text: $name)
|
||||
TVSettingsToggle(title: String(localized: "sources.field.enabled"), isOn: $isEnabled)
|
||||
#elseif os(macOS)
|
||||
LabeledContent(String(localized: "sources.field.name")) {
|
||||
TextField("", text: $name)
|
||||
}
|
||||
Toggle(String(localized: "sources.field.enabled"), isOn: $isEnabled)
|
||||
#else
|
||||
TextField(String(localized: "sources.field.name"), text: $name)
|
||||
Toggle(String(localized: "sources.field.enabled"), isOn: $isEnabled)
|
||||
@@ -128,6 +133,16 @@ private struct EditRemoteServerContent: View {
|
||||
#if os(tvOS)
|
||||
TVSettingsTextField(title: String(localized: "sources.field.username"), text: $basicAuthUsername)
|
||||
TVSettingsTextField(title: String(localized: "sources.field.password"), text: $basicAuthPassword, isSecure: true)
|
||||
#elseif os(macOS)
|
||||
LabeledContent(String(localized: "sources.field.username")) {
|
||||
TextField("", text: $basicAuthUsername)
|
||||
.textContentType(.username)
|
||||
.autocorrectionDisabled()
|
||||
}
|
||||
LabeledContent(String(localized: "sources.field.password")) {
|
||||
SecureField("", text: $basicAuthPassword)
|
||||
.textContentType(.password)
|
||||
}
|
||||
#else
|
||||
TextField(String(localized: "sources.field.username"), text: $basicAuthUsername)
|
||||
.textContentType(.username)
|
||||
@@ -321,6 +336,9 @@ private struct EditRemoteServerContent: View {
|
||||
#if os(iOS)
|
||||
.scrollDismissesKeyboard(.interactively)
|
||||
#endif
|
||||
#if os(macOS)
|
||||
.formStyle(.grouped)
|
||||
#endif
|
||||
.confirmationDialog(
|
||||
String(localized: "sources.delete.confirmation.single \(instance.displayName)"),
|
||||
isPresented: $showingDeleteConfirmation,
|
||||
@@ -564,6 +582,11 @@ private struct EditFileSourceContent: View {
|
||||
#if os(tvOS)
|
||||
TVSettingsTextField(title: String(localized: "sources.field.name"), text: $name)
|
||||
TVSettingsToggle(title: String(localized: "sources.field.enabled"), isOn: $isEnabled)
|
||||
#elseif os(macOS)
|
||||
LabeledContent(String(localized: "sources.field.name")) {
|
||||
TextField("", text: $name)
|
||||
}
|
||||
Toggle(String(localized: "sources.field.enabled"), isOn: $isEnabled)
|
||||
#else
|
||||
TextField(String(localized: "sources.field.name"), text: $name)
|
||||
Toggle(String(localized: "sources.field.enabled"), isOn: $isEnabled)
|
||||
@@ -615,6 +638,21 @@ private struct EditFileSourceContent: View {
|
||||
text: $password,
|
||||
isSecure: true
|
||||
)
|
||||
#elseif os(macOS)
|
||||
LabeledContent(String(localized: "sources.field.username")) {
|
||||
TextField("", text: $username)
|
||||
.textContentType(.username)
|
||||
.autocorrectionDisabled()
|
||||
}
|
||||
LabeledContent(String(localized: "sources.field.password")) {
|
||||
SecureField(
|
||||
hasExistingPassword
|
||||
? String(localized: "sources.field.passwordKeep")
|
||||
: String(localized: "sources.field.passwordRequired"),
|
||||
text: $password
|
||||
)
|
||||
.textContentType(.password)
|
||||
}
|
||||
#else
|
||||
TextField(String(localized: "sources.field.username"), text: $username)
|
||||
.textContentType(.username)
|
||||
@@ -718,6 +756,9 @@ private struct EditFileSourceContent: View {
|
||||
#if os(iOS)
|
||||
.scrollDismissesKeyboard(.interactively)
|
||||
#endif
|
||||
#if os(macOS)
|
||||
.formStyle(.grouped)
|
||||
#endif
|
||||
.confirmationDialog(
|
||||
String(localized: "sources.delete.confirmation.single \(source.name)"),
|
||||
isPresented: $showingDeleteConfirmation,
|
||||
|
||||
Reference in New Issue
Block a user