mirror of
https://github.com/sudosylabs/vnidrop.git
synced 2026-08-05 10:29:58 +02:00
refactor(apple): tidy the receive-folder preference row
The "Save received transfers to" section was a gray folder label that read like a disabled field, stacked above two full-width buttons. Replace it with the standard macOS "label · value · inline action" row: a folder icon + the current folder name with a trailing "Choose folder" button, long names truncated in the middle. "Use default" now shows only when a custom folder is actually set (hidden when already on the default, where it'd be a no-op).
This commit is contained in:
@@ -14,10 +14,20 @@ struct PreferencesSettings: View {
|
||||
}
|
||||
if model.state.supportsCustomReceiveFolders {
|
||||
Section(String(localized: L10n.Preferences.receiveFolderTitle)) {
|
||||
Text(model.state.receiveFolder?.displayName ?? String(localized: L10n.Value.unavailable))
|
||||
.foregroundStyle(.secondary)
|
||||
Button(String(localized: L10n.Button.chooseFolder), action: model.chooseReceiveFolder)
|
||||
Button(String(localized: L10n.Button.resetDefault), action: model.resetReceiveFolder)
|
||||
LabeledContent {
|
||||
Button(String(localized: L10n.Button.chooseFolder), action: model.chooseReceiveFolder)
|
||||
} label: {
|
||||
Label {
|
||||
Text(model.state.receiveFolder?.displayName ?? String(localized: L10n.Value.unavailable))
|
||||
.lineLimit(1)
|
||||
.truncationMode(.middle)
|
||||
} icon: {
|
||||
Image(systemSymbol: .folder)
|
||||
}
|
||||
}
|
||||
if !model.isUsingDefaultReceiveFolder {
|
||||
Button(String(localized: L10n.Button.resetDefault), role: .cancel, action: model.resetReceiveFolder)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user