feat: hide proxy names

This commit is contained in:
mrFq1
2023-05-16 15:24:56 +08:00
parent adcfb183f9
commit 8e9bf8c6cc
4 changed files with 37 additions and 4 deletions
@@ -11,6 +11,8 @@ struct ProxyItemView: View {
@Binding var proxy: DBProxy
@State var selectable: Bool
@EnvironmentObject var hideProxyNames: HideProxyNames
init(proxy: Binding<DBProxy>, selectable: Bool) {
self._proxy = proxy
self.selectable = selectable
@@ -24,7 +26,9 @@ struct ProxyItemView: View {
var body: some View {
VStack {
HStack(alignment: .center) {
Text(proxy.name)
Text(hideProxyNames.hide
? String(proxy.id.prefix(8))
: proxy.name)
.truncationMode(.tail)
.lineLimit(1)
Spacer(minLength: 6)