From f4a65f7cc0b7f944dd9b89bcc8aaf85463639c89 Mon Sep 17 00:00:00 2001 From: singularity <12184989+singularity-s0@users.noreply.github.com> Date: Sun, 8 Dec 2024 16:58:39 +0800 Subject: [PATCH] change: simplify copy floor ui --- DanXiUI/Forum/Sheet/TextSelectionSheet.swift | 12 +++--------- DanXiUI/Forum/Views/FloorView.swift | 8 +------- DanXiUI/Resouces/Localizable.xcstrings | 11 +++++++++++ 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/DanXiUI/Forum/Sheet/TextSelectionSheet.swift b/DanXiUI/Forum/Sheet/TextSelectionSheet.swift index a709a743..dc317c3d 100644 --- a/DanXiUI/Forum/Sheet/TextSelectionSheet.swift +++ b/DanXiUI/Forum/Sheet/TextSelectionSheet.swift @@ -8,21 +8,15 @@ struct TextSelectionSheet: View { NavigationStack { SelectableText(text: text) .padding(.horizontal) - .navigationTitle(String(localized: "Select Text", bundle: .module)) + .navigationTitle(String(localized: "Copy Text", bundle: .module)) .navigationBarTitleDisplayMode(.inline) .toolbar { - ToolbarItem(placement: .status) { + ToolbarItem(placement: .confirmationAction) { Button { UIPasteboard.general.string = text dismiss() } label: { - Label { - Text("Copy Full Text", bundle: .module) - .bold() - } icon: { - Image(systemName: "doc.on.doc") - } - .labelStyle(.titleAndIcon) + Text("Copy All", bundle: .module) } } ToolbarItem(placement: .cancellationAction) { diff --git a/DanXiUI/Forum/Views/FloorView.swift b/DanXiUI/Forum/Views/FloorView.swift index 0c10b484..43534ce5 100644 --- a/DanXiUI/Forum/Views/FloorView.swift +++ b/DanXiUI/Forum/Views/FloorView.swift @@ -232,16 +232,10 @@ private struct FloorActions: View { private var menu: some View { Menu { - Button { - UIPasteboard.general.string = NSAttributedString(floor.content.inlineAttributed()).string - } label: { - Label(String(localized: "Copy Full Text", bundle: .module), systemImage: "doc.on.doc") - } - Button { holeModel.textSelectionSheet = floor } label: { - Label(String(localized: "Select Text", bundle: .module), systemImage: "character.cursor.ibeam") + Label(String(localized: "Copy Text", bundle: .module), systemImage: "doc.on.doc") } Divider() diff --git a/DanXiUI/Resouces/Localizable.xcstrings b/DanXiUI/Resouces/Localizable.xcstrings index 169d41e3..f321623c 100644 --- a/DanXiUI/Resouces/Localizable.xcstrings +++ b/DanXiUI/Resouces/Localizable.xcstrings @@ -558,6 +558,16 @@ } } }, + "Copy All" : { + "localizations" : { + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "复制全部" + } + } + } + }, "Copy Ciphertext" : { "localizations" : { "zh-Hans" : { @@ -2572,6 +2582,7 @@ } }, "Select Text" : { + "extractionState" : "stale", "localizations" : { "zh-Hans" : { "stringUnit" : {