misc: ProxyItemView select color

This commit is contained in:
mrFq1
2023-06-20 23:06:08 +08:00
parent e07050c08c
commit 87267f8e94
2 changed files with 11 additions and 4 deletions
@@ -10,13 +10,15 @@ struct ProxyItemView: View {
@ObservedObject var proxy: DBProxy
@State var selectable: Bool
@Binding var now: String?
@EnvironmentObject var hideProxyNames: HideProxyNames
init(proxy: DBProxy, selectable: Bool) {
init(proxy: DBProxy, selectable: Bool, now: Binding<String?> = .init(get: {nil}) { _ in }) {
self.proxy = proxy
self.selectable = selectable
self._now = now
self.isBuiltInProxy = [.pass, .direct, .reject].contains(proxy.type)
}
@@ -68,6 +70,7 @@ struct ProxyItemView: View {
.padding(1)
)
.background(now == proxy.name ? Color.accentColor.opacity(0.7) : Color(nsColor: .textBackgroundColor))
}
}