Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change: simplify copy floor ui #357

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions DanXiUI/Forum/Sheet/TextSelectionSheet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
8 changes: 1 addition & 7 deletions DanXiUI/Forum/Views/FloorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
11 changes: 11 additions & 0 deletions DanXiUI/Resouces/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,16 @@
}
}
},
"Copy All" : {
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "复制全部"
}
}
}
},
"Copy Ciphertext" : {
"localizations" : {
"zh-Hans" : {
Expand Down Expand Up @@ -2572,6 +2582,7 @@
}
},
"Select Text" : {
"extractionState" : "stale",
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
Expand Down