From 8b5096ab69ae2b73818b6b2682306be5fc7e2fae Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Sat, 5 Oct 2024 00:17:08 +0200 Subject: [PATCH] Make copiable text multiline by default --- .../Library/Sources/AppUI/Views/Modules/IPView.swift | 2 +- .../Sources/AppUI/Views/ProfileEditor/ModuleSection.swift | 6 +++--- .../Library/Sources/AppUI/Views/Theme/Theme+UI.swift | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Passepartout/Library/Sources/AppUI/Views/Modules/IPView.swift b/Passepartout/Library/Sources/AppUI/Views/Modules/IPView.swift index 3ed8365e..f8f8a306 100644 --- a/Passepartout/Library/Sources/AppUI/Views/Modules/IPView.swift +++ b/Passepartout/Library/Sources/AppUI/Views/Modules/IPView.swift @@ -130,7 +130,7 @@ private extension IPView { func row(forRoute route: Route, removeAction: @escaping () -> Void) -> some View { ThemeRemovableItemRow(isEditing: true) { - ThemeCopiableText(value: route.localizedDescription, isMultiLine: true) + ThemeCopiableText(value: route.localizedDescription) } removeAction: { removeAction() } diff --git a/Passepartout/Library/Sources/AppUI/Views/ProfileEditor/ModuleSection.swift b/Passepartout/Library/Sources/AppUI/Views/ProfileEditor/ModuleSection.swift index 84698e51..e772b5bd 100644 --- a/Passepartout/Library/Sources/AppUI/Views/ProfileEditor/ModuleSection.swift +++ b/Passepartout/Library/Sources/AppUI/Views/ProfileEditor/ModuleSection.swift @@ -45,7 +45,7 @@ enum ModuleRow: Hashable { case textList(caption: String, values: [String]) - case copiableText(caption: String? = nil, value: String) + case copiableText(caption: String? = nil, value: String, multiline: Bool = true) case longContent(caption: String, value: String) @@ -112,8 +112,8 @@ private extension View { .withTrailingText(Strings.Global.empty) } - case .copiableText(let caption, let value): - ThemeCopiableText(title: caption, value: value) + case .copiableText(let caption, let value, let multiline): + ThemeCopiableText(title: caption, value: value, isMultiLine: multiline) case .longContent(let title, let content): LongContentLink(title, content: .constant(content)) { diff --git a/Passepartout/Library/Sources/AppUI/Views/Theme/Theme+UI.swift b/Passepartout/Library/Sources/AppUI/Views/Theme/Theme+UI.swift index bb44f878..2f90f1c0 100644 --- a/Passepartout/Library/Sources/AppUI/Views/Theme/Theme+UI.swift +++ b/Passepartout/Library/Sources/AppUI/Views/Theme/Theme+UI.swift @@ -386,7 +386,7 @@ struct ThemeCopiableText: View { let value: String - var isMultiLine = false + var isMultiLine = true var body: some View { HStack {