diff --git a/Easydict/App/Assets.xcassets/Colors/service_cell_highlight_color.colorset/Contents.json b/Easydict/App/Assets.xcassets/Colors/service_cell_highlight_color.colorset/Contents.json deleted file mode 100644 index f6b481345..000000000 --- a/Easydict/App/Assets.xcassets/Colors/service_cell_highlight_color.colorset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "colors" : [ - { - "color" : { - "color-space" : "srgb", - "components" : { - "alpha" : "1.000", - "blue" : "1.000", - "green" : "0.847", - "red" : "0.706" - } - }, - "idiom" : "universal" - }, - { - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "color" : { - "color-space" : "srgb", - "components" : { - "alpha" : "1.000", - "blue" : "0.251", - "green" : "0.251", - "red" : "0.251" - } - }, - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/Easydict/NewApp/View/SettingView/Tabs/ServiceTab.swift b/Easydict/NewApp/View/SettingView/Tabs/ServiceTab.swift index 83a5f6398..77a0f5a1c 100644 --- a/Easydict/NewApp/View/SettingView/Tabs/ServiceTab.swift +++ b/Easydict/NewApp/View/SettingView/Tabs/ServiceTab.swift @@ -13,33 +13,20 @@ import SwiftUI struct ServiceTab: View { @StateObject private var viewModel: ServiceTabViewModel = .init() - @Environment(\.colorScheme) private var colorScheme - - var bgColor: Color { - Color(nsColor: colorScheme == .light ? .windowBackgroundColor : .controlBackgroundColor) - } - - var tableColor: Color { - Color(nsColor: colorScheme == .light ? .ez_tableRowViewBgLight() : .ez_tableRowViewBgDark()) - } - var body: some View { HStack { VStack { WindowTypePicker(windowType: $viewModel.windowType) .padding() - List { + List(selection: $viewModel.selectedService) { ServiceItems() } - .scrollContentBackground(.hidden) .listStyle(.plain) .scrollIndicators(.never) .clipShape(RoundedRectangle(cornerRadius: 10)) - .background(bgColor, in: RoundedRectangle(cornerRadius: 10)) .padding(.bottom) .padding(.horizontal) } - .background(bgColor) Group { if let service = viewModel.selectedService { // To provide configuration options for a service, follow these steps @@ -172,18 +159,6 @@ private struct ServiceItemView: View { .listRowSeparator(.hidden) .listRowInsets(.init()) .padding(10) - .listRowBackground(viewModel.selectedService == service ? Color("service_cell_highlight_color") : tableColor) - .overlay { - TapHandler { - viewModel.selectedService = service - } - } - } - - @Environment(\.colorScheme) private var colorScheme - - private var tableColor: Color { - Color(nsColor: colorScheme == .light ? .ez_tableRowViewBgLight() : .ez_tableRowViewBgDark()) } }