Merge pull request #20 from hkgood/cursor/settings-ui-polish-6baf
设置页与引导页 UI 简化
This commit is contained in:
@@ -757,35 +757,8 @@ private struct APISetupPage: View {
|
|||||||
.padding(.horizontal, Spacing.lg)
|
.padding(.horizontal, Spacing.lg)
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.isPolishScenarioRowVisible {
|
|
||||||
postProcessingSection
|
|
||||||
.padding(.horizontal, Spacing.lg)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.padding(.bottom, Spacing.xxxl)
|
.padding(.bottom, Spacing.xxxl)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Polish scenario + optional translation target for cloud onboarding.
|
|
||||||
private var postProcessingSection: some View {
|
|
||||||
VStack(alignment: .leading, spacing: SettingsListMetrics.sectionLabelSpacing) {
|
|
||||||
Text("settings.polishScenario.section")
|
|
||||||
.font(TypeStyle.caption2)
|
|
||||||
.foregroundStyle(palette.textSecondary)
|
|
||||||
.textCase(.uppercase)
|
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
|
||||||
VStack(spacing: 0) {
|
|
||||||
ScenarioPickerRow(config: config, isVisible: true)
|
|
||||||
if config.isTranslationRowVisible {
|
|
||||||
Divider().background(palette.divider)
|
|
||||||
TranslationPickerRow(config: config, isVisible: true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.background(palette.surface, in: RoundedRectangle(cornerRadius: Radius.large, style: .continuous))
|
|
||||||
.overlay(
|
|
||||||
RoundedRectangle(cornerRadius: Radius.large, style: .continuous)
|
|
||||||
.stroke(palette.divider, lineWidth: 0.5)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,8 @@ struct PersonalDictionaryView: View {
|
|||||||
list
|
list
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.background(palette.background.ignoresSafeArea())
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||||
|
.background(palette.surface.ignoresSafeArea())
|
||||||
.navigationTitle("settings.personalDictionary.title")
|
.navigationTitle("settings.personalDictionary.title")
|
||||||
.navigationBarTitleDisplayMode(.inline)
|
.navigationBarTitleDisplayMode(.inline)
|
||||||
.toolbar(.visible, for: .navigationBar)
|
.toolbar(.visible, for: .navigationBar)
|
||||||
@@ -56,7 +57,7 @@ struct PersonalDictionaryView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.toolbarBackground(palette.background, for: .navigationBar)
|
.toolbarBackground(palette.surface, for: .navigationBar)
|
||||||
.toolbarBackground(.visible, for: .navigationBar)
|
.toolbarBackground(.visible, for: .navigationBar)
|
||||||
.confirmationDialog(
|
.confirmationDialog(
|
||||||
AppL10n.string("settings.personalDictionary.clearAll.confirmTitle"),
|
AppL10n.string("settings.personalDictionary.clearAll.confirmTitle"),
|
||||||
@@ -180,7 +181,7 @@ struct PersonalDictionaryView: View {
|
|||||||
private var emptyState: some View {
|
private var emptyState: some View {
|
||||||
VStack(spacing: Spacing.sm) {
|
VStack(spacing: Spacing.sm) {
|
||||||
Spacer()
|
Spacer()
|
||||||
MaterialIcon(name: .bookmark, size: 36)
|
MaterialIcon(name: .menuBook, size: 36)
|
||||||
.foregroundStyle(palette.textTertiary.opacity(0.5))
|
.foregroundStyle(palette.textTertiary.opacity(0.5))
|
||||||
Text("settings.personalDictionary.empty.title")
|
Text("settings.personalDictionary.empty.title")
|
||||||
.font(TypeStyle.body)
|
.font(TypeStyle.body)
|
||||||
|
|||||||
@@ -304,34 +304,12 @@ struct SettingsView: View {
|
|||||||
}
|
}
|
||||||
.pickerStyle(.segmented)
|
.pickerStyle(.segmented)
|
||||||
.padding(.horizontal, Spacing.md)
|
.padding(.horizontal, Spacing.md)
|
||||||
|
.padding(.bottom, Spacing.sm)
|
||||||
Text(SharedL10n.string(config.polishIntensity.descriptionKey, language: config.uiLanguage))
|
|
||||||
.font(TypeStyle.caption2)
|
|
||||||
.foregroundStyle(palette.textSecondary)
|
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
|
||||||
.padding(.horizontal, Spacing.md)
|
|
||||||
.padding(.bottom, Spacing.sm)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private var personalDictionaryPreferenceRow: some View {
|
private var personalDictionaryPreferenceRow: some View {
|
||||||
HStack(spacing: Spacing.sm) {
|
footerNavigationRow(title: "settings.personalDictionary.title")
|
||||||
VStack(alignment: .leading, spacing: 2) {
|
|
||||||
Text("settings.personalDictionary.title")
|
|
||||||
.font(TypeStyle.body)
|
|
||||||
.foregroundStyle(palette.textPrimary)
|
|
||||||
Text("settings.personalDictionary.summary")
|
|
||||||
.font(TypeStyle.caption2)
|
|
||||||
.foregroundStyle(palette.textSecondary)
|
|
||||||
}
|
|
||||||
Spacer()
|
|
||||||
Image(systemName: "chevron.right")
|
|
||||||
.font(.system(size: 14, weight: .semibold))
|
|
||||||
.foregroundStyle(palette.textTertiary)
|
|
||||||
}
|
|
||||||
.padding(.horizontal, Spacing.md)
|
|
||||||
.frame(minHeight: SettingsListMetrics.doubleLineMinHeight)
|
|
||||||
.contentShape(Rectangle())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Footer links (tab settings only)
|
// MARK: - Footer links (tab settings only)
|
||||||
|
|||||||
Reference in New Issue
Block a user