diff --git a/Sources/WeiBei/Support/Theme.swift b/Sources/WeiBei/Support/Theme.swift index acd8dd617..f4c69e733 100644 --- a/Sources/WeiBei/Support/Theme.swift +++ b/Sources/WeiBei/Support/Theme.swift @@ -1804,6 +1804,40 @@ struct WeiBeiDialogButtonStyle: ButtonStyle { } extension View { + /// One-line etched backdrop for upgrading existing flat-fill surfaces; + /// keeps call sites compact inside frozen files. + func weibeiEtchedBackground( + fill: Color, + stroke: Color, + cornerRadius: CGFloat, + contactShadow: Bool = false + ) -> some View { + background { + WeiBeiEtchedBackdrop( + shape: RoundedRectangle(cornerRadius: cornerRadius, style: .continuous), + fill: fill, + stroke: stroke, + showsContactShadow: contactShadow + ) + } + } + + /// Capsule variant of `weibeiEtchedBackground`. + func weibeiEtchedCapsuleBackground( + fill: Color, + stroke: Color, + contactShadow: Bool = false + ) -> some View { + background { + WeiBeiEtchedBackdrop( + shape: Capsule(), + fill: fill, + stroke: stroke, + showsContactShadow: contactShadow + ) + } + } + func weibeiPanel() -> some View { self .foregroundColor(WeiBeiTheme.ink) diff --git a/Sources/WeiBei/Views/ContentView.swift b/Sources/WeiBei/Views/ContentView.swift index d2768221e..7e73c80a2 100644 --- a/Sources/WeiBei/Views/ContentView.swift +++ b/Sources/WeiBei/Views/ContentView.swift @@ -362,12 +362,12 @@ private struct ImportProgressPill: View { } .padding(.horizontal, 12) .padding(.vertical, 8) - .background(WeiBeiTheme.paperRaised.opacity(0.97)) + .weibeiEtchedCapsuleBackground( + fill: WeiBeiTheme.paperRaised.opacity(0.97), + stroke: WeiBeiTheme.hairline.opacity(0.6), + contactShadow: true + ) .clipShape(Capsule()) - .overlay { - Capsule() - .stroke(WeiBeiTheme.hairline.opacity(0.6), lineWidth: 1) - } .shadow(color: WeiBeiTheme.ink.opacity(store.appearanceMode.isDark ? 0.3 : 0.1), radius: 12, y: 6) .accessibilityElement(children: .combine) .accessibilityLabel(Text(store.ui("正在导入文件", "Importing files"))) @@ -432,17 +432,17 @@ private struct WorkspaceStatusBanner: View { .padding(.horizontal, 12) .padding(.vertical, 9) .frame(maxWidth: 440, alignment: .leading) - .background(WeiBeiTheme.paperRaised.opacity(0.97)) - .clipShape(RoundedRectangle(cornerRadius: 8, style: .continuous)) - .overlay { - RoundedRectangle(cornerRadius: 8, style: .continuous) - .stroke( - isAlert - ? WeiBeiTheme.cinnabar.opacity(0.55) - : WeiBeiTheme.hairline.opacity(0.6), - lineWidth: 1 - ) + .background { + WeiBeiEtchedBackdrop( + shape: RoundedRectangle(cornerRadius: 8, style: .continuous), + fill: WeiBeiTheme.paperRaised.opacity(0.97), + stroke: isAlert + ? WeiBeiTheme.cinnabar.opacity(0.55) + : WeiBeiTheme.hairline.opacity(0.6), + showsContactShadow: true + ) } + .clipShape(RoundedRectangle(cornerRadius: 8, style: .continuous)) .shadow(color: WeiBeiTheme.ink.opacity(store.appearanceMode.isDark ? 0.3 : 0.1), radius: 12, y: 6) .allowsHitTesting(isAlert) .accessibilityElement(children: .contain) @@ -1257,7 +1257,12 @@ private struct PaneDropTargetView: View { .foregroundStyle(WeiBeiTheme.cinnabar) .padding(.horizontal, 10) .padding(.vertical, 6) - .background(WeiBeiTheme.paperRaised.opacity(0.72), in: Capsule()) + .weibeiEtchedCapsuleBackground( + fill: WeiBeiTheme.paperRaised.opacity(0.72), + stroke: WeiBeiTheme.hairline.opacity(0.4), + contactShadow: true + ) + .clipShape(Capsule()) .padding(14) } .allowsHitTesting(false) diff --git a/Sources/WeiBei/Views/CourseRelationPaperView.swift b/Sources/WeiBei/Views/CourseRelationPaperView.swift index 336ff6f9a..5c4b7ce99 100644 --- a/Sources/WeiBei/Views/CourseRelationPaperView.swift +++ b/Sources/WeiBei/Views/CourseRelationPaperView.swift @@ -154,7 +154,11 @@ struct CourseRelationPaperView: View { } .padding(.horizontal, 16) .frame(height: 40) - .background(WeiBeiTheme.paperRaised.opacity(0.22)) + .weibeiEtchedBackground( + fill: WeiBeiTheme.paperRaised.opacity(0.22), + stroke: WeiBeiTheme.hairline.opacity(0.24), + cornerRadius: 8 + ) } /// Left rail: courses as primary units (plus all / unassigned / unlinked). @@ -227,7 +231,11 @@ struct CourseRelationPaperView: View { } .frame(width: 212) .frame(maxHeight: .infinity) - .background(WeiBeiTheme.paperRaised.opacity(0.22)) + .weibeiEtchedBackground( + fill: WeiBeiTheme.paperRaised.opacity(0.22), + stroke: WeiBeiTheme.hairline.opacity(0.24), + cornerRadius: 8 + ) } private func courseScopeRow( @@ -298,7 +306,10 @@ struct CourseRelationPaperView: View { .foregroundStyle(WeiBeiTheme.ink) .padding(.horizontal, 10) .frame(height: 28) - .background(WeiBeiTheme.paperInset.opacity(0.34), in: Capsule()) + .weibeiEtchedCapsuleBackground( + fill: WeiBeiTheme.paperInset.opacity(0.34), + stroke: WeiBeiTheme.hairline.opacity(0.3) + ) } .menuStyle(.borderlessButton) .menuIndicator(.hidden) @@ -611,7 +622,11 @@ struct CourseRelationPaperView: View { } .padding(18) } - .background(WeiBeiTheme.paperRaised.opacity(0.18)) + .weibeiEtchedBackground( + fill: WeiBeiTheme.paperRaised.opacity(0.18), + stroke: WeiBeiTheme.hairline.opacity(0.22), + cornerRadius: 8 + ) } private func compactSection( diff --git a/Sources/WeiBei/Views/CourseWorkspaceComponents.swift b/Sources/WeiBei/Views/CourseWorkspaceComponents.swift index f7d86a99c..21dc940eb 100644 --- a/Sources/WeiBei/Views/CourseWorkspaceComponents.swift +++ b/Sources/WeiBei/Views/CourseWorkspaceComponents.swift @@ -465,7 +465,11 @@ struct CourseProjectEntrySheet: View { } .padding(14) .frame(maxWidth: .infinity, alignment: .leading) - .background(WeiBeiTheme.paperRaised.opacity(0.34), in: RoundedRectangle(cornerRadius: 10)) + .weibeiEtchedBackground( + fill: WeiBeiTheme.paperRaised.opacity(0.34), + stroke: WeiBeiTheme.hairline.opacity(0.3), + cornerRadius: 10 + ) } @ViewBuilder @@ -537,7 +541,11 @@ struct CourseProjectEntrySheet: View { } .padding(12) .frame(maxWidth: .infinity, alignment: .leading) - .background(WeiBeiTheme.paperRaised.opacity(0.30), in: RoundedRectangle(cornerRadius: 9)) + .weibeiEtchedBackground( + fill: WeiBeiTheme.paperRaised.opacity(0.30), + stroke: WeiBeiTheme.hairline.opacity(0.28), + cornerRadius: 9 + ) } private func pathLine(label: String, path: String) -> some View { @@ -555,7 +563,11 @@ struct CourseProjectEntrySheet: View { } .padding(12) .frame(maxWidth: .infinity, alignment: .leading) - .background(WeiBeiTheme.paperRaised.opacity(0.30), in: RoundedRectangle(cornerRadius: 9)) + .weibeiEtchedBackground( + fill: WeiBeiTheme.paperRaised.opacity(0.30), + stroke: WeiBeiTheme.hairline.opacity(0.28), + cornerRadius: 9 + ) } @ViewBuilder @@ -845,7 +857,11 @@ struct CourseRelationDetailHeader: View { } .padding(.horizontal, 24) .frame(minHeight: 88) - .background(WeiBeiTheme.paperRaised.opacity(0.28)) + .weibeiEtchedBackground( + fill: WeiBeiTheme.paperRaised.opacity(0.28), + stroke: WeiBeiTheme.hairline.opacity(0.26), + cornerRadius: 8 + ) } } @@ -1049,7 +1065,11 @@ struct CourseContextLine: View { } .padding(.horizontal, 12) .frame(minHeight: 44) - .background(WeiBeiTheme.paperRaised.opacity(0.30)) + .weibeiEtchedBackground( + fill: WeiBeiTheme.paperRaised.opacity(0.30), + stroke: WeiBeiTheme.hairline.opacity(0.28), + cornerRadius: 8 + ) } } @@ -1081,7 +1101,11 @@ struct CourseActionRow: View { } .padding(.horizontal, 12) .frame(minHeight: 50) - .background(WeiBeiTheme.paperRaised.opacity(0.24)) + .weibeiEtchedBackground( + fill: WeiBeiTheme.paperRaised.opacity(0.24), + stroke: WeiBeiTheme.hairline.opacity(0.24), + cornerRadius: 8 + ) } } @@ -1253,7 +1277,11 @@ func relationFooter( } .padding(.horizontal, 18) .frame(height: 46) - .background(WeiBeiTheme.paperRaised.opacity(0.36)) + .weibeiEtchedBackground( + fill: WeiBeiTheme.paperRaised.opacity(0.36), + stroke: WeiBeiTheme.hairline.opacity(0.3), + cornerRadius: 8 +) } func toggled(_ itemID: String, in values: Set) -> Set { diff --git a/Sources/WeiBei/Views/NotesAgentView.swift b/Sources/WeiBei/Views/NotesAgentView.swift index 2c6a1ad66..6c2030ade 100644 --- a/Sources/WeiBei/Views/NotesAgentView.swift +++ b/Sources/WeiBei/Views/NotesAgentView.swift @@ -1857,14 +1857,11 @@ struct AgentPaneView: View { .foregroundStyle(isAgentHistoryRevealButtonHovered ? WeiBeiTheme.link : WeiBeiTheme.secondaryInk) .padding(.vertical, 6) .padding(.horizontal, 12) - .background { - Capsule() - .fill(WeiBeiTheme.paperInset.opacity(isAgentHistoryRevealButtonHovered ? 0.42 : 0.24)) - } - .overlay { - Capsule() - .stroke(WeiBeiTheme.hairline.opacity(isAgentHistoryRevealButtonHovered ? 0.72 : 0.44), lineWidth: 1) - } + .weibeiEtchedCapsuleBackground( + fill: WeiBeiTheme.paperInset.opacity(isAgentHistoryRevealButtonHovered ? 0.42 : 0.24), + stroke: WeiBeiTheme.hairline.opacity(isAgentHistoryRevealButtonHovered ? 0.72 : 0.44), + contactShadow: isAgentHistoryRevealButtonHovered + ) } .buttonStyle(.plain) .scaleEffect(isAgentHistoryRevealButtonHovered ? 1.015 : 1) @@ -2119,12 +2116,13 @@ private struct AgentSelectionAttachmentPill: View { .padding(.leading, 10) .padding(.trailing, 6) .frame(height: 28) - .background(WeiBeiTheme.paperRaised.opacity(pillHovering ? 0.72 : 0.54)) + .weibeiEtchedBackground( + fill: WeiBeiTheme.paperRaised.opacity(pillHovering ? 0.72 : 0.54), + stroke: WeiBeiTheme.hairline.opacity(pillHovering ? 0.68 : 0.38), + cornerRadius: 8, + contactShadow: pillHovering + ) .clipShape(RoundedRectangle(cornerRadius: 8)) - .overlay { - RoundedRectangle(cornerRadius: 8) - .stroke(WeiBeiTheme.hairline.opacity(pillHovering ? 0.68 : 0.38), lineWidth: 1) - } .accessibilityLabel(Text(store.ui("\(interaction.selectionAttachments.count) 个已选文本片段", "\(interaction.selectionAttachments.count) selected text fragments"))) .help(store.ui("悬停查看选区", "Hover to preview selections")) } @@ -2220,12 +2218,12 @@ private struct AgentSelectionAttachmentPill: View { .padding(.leading, 1) } .padding(9) - .background(WeiBeiTheme.paperInset.opacity(0.32)) + .weibeiEtchedBackground( + fill: WeiBeiTheme.paperInset.opacity(0.32), + stroke: WeiBeiTheme.hairline.opacity(0.36), + cornerRadius: 7 + ) .clipShape(RoundedRectangle(cornerRadius: 7)) - .overlay { - RoundedRectangle(cornerRadius: 7) - .stroke(WeiBeiTheme.hairline.opacity(0.36), lineWidth: 1) - } } private func setPillHovering(_ value: Bool) { @@ -2938,17 +2936,14 @@ private struct SelectionFloatChrome: ViewModifier { content .foregroundColor(WeiBeiTheme.ink) .background { - RoundedRectangle(cornerRadius: expanded ? 12 : 9, style: .continuous) - .fill(WeiBeiTheme.paperRaised.opacity(0.98)) + WeiBeiEtchedBackdrop( + shape: RoundedRectangle(cornerRadius: expanded ? 12 : 9, style: .continuous), + fill: WeiBeiTheme.paperRaised.opacity(0.98), + stroke: WeiBeiTheme.hairline.opacity(0.65), + showsContactShadow: true + ) } .clipShape(RoundedRectangle(cornerRadius: expanded ? 12 : 9, style: .continuous)) - .overlay { - RoundedRectangle(cornerRadius: expanded ? 12 : 9, style: .continuous) - .strokeBorder( - WeiBeiTheme.hairline.opacity(0.65), - lineWidth: 1 - ) - } .shadow(color: WeiBeiTheme.ink.opacity(0.06), radius: 8, y: 3) } } @@ -3846,12 +3841,12 @@ private struct AgentReplyActionCard: View { alignment: .leading ) .background { - RoundedRectangle(cornerRadius: 10, style: .continuous) - .fill(WeiBeiTheme.paperRaised.opacity(0.82)) - } - .overlay { - RoundedRectangle(cornerRadius: 10, style: .continuous) - .strokeBorder(WeiBeiTheme.hairline.opacity(0.58), lineWidth: 1) + WeiBeiEtchedBackdrop( + shape: RoundedRectangle(cornerRadius: 10, style: .continuous), + fill: WeiBeiTheme.paperRaised.opacity(0.82), + stroke: WeiBeiTheme.hairline.opacity(0.58), + showsContactShadow: true + ) } } @@ -4032,7 +4027,11 @@ private struct AgentReplyActionCard: View { .lineLimit(1) .padding(.horizontal, 8) .frame(height: 28) - .background(WeiBeiTheme.paperInset.opacity(0.34)) + .weibeiEtchedBackground( + fill: WeiBeiTheme.paperInset.opacity(0.34), + stroke: WeiBeiTheme.hairline.opacity(0.3), + cornerRadius: 6 + ) .clipShape(RoundedRectangle(cornerRadius: 6)) } diff --git a/Sources/WeiBei/Views/ReaderView.swift b/Sources/WeiBei/Views/ReaderView.swift index ba0a8c681..df13859df 100644 --- a/Sources/WeiBei/Views/ReaderView.swift +++ b/Sources/WeiBei/Views/ReaderView.swift @@ -92,12 +92,12 @@ struct ImmersiveHoverTitleView: View { .padding(.horizontal, 12) .frame(height: 34) .background { - RoundedRectangle(cornerRadius: 7) - .fill(WeiBeiTheme.paperRaised.opacity(appearanceMode.isDark ? 0.88 : 0.92)) - .overlay { - RoundedRectangle(cornerRadius: 7) - .stroke(WeiBeiTheme.hairline.opacity(appearanceMode.isDark ? 0.42 : 0.48), lineWidth: 1) - } + WeiBeiEtchedBackdrop( + shape: RoundedRectangle(cornerRadius: 7, style: .continuous), + fill: WeiBeiTheme.paperRaised.opacity(appearanceMode.isDark ? 0.88 : 0.92), + stroke: WeiBeiTheme.hairline.opacity(appearanceMode.isDark ? 0.42 : 0.48), + showsContactShadow: true + ) } .shadow(color: WeiBeiTheme.ink.opacity(appearanceMode.isDark ? 0.28 : 0.08), radius: 9, y: 4) .padding(.top, 7) @@ -788,18 +788,18 @@ struct ReaderView: View { .padding(3) .background { ZStack { - RoundedRectangle(cornerRadius: 8) - .fill(WeiBeiTheme.paperRaised.opacity(PDFModeChipPresentation.fillOpacity(isExpanded: pdfControlsExpanded, isHovering: pdfControlsHovering))) + WeiBeiEtchedBackdrop( + shape: RoundedRectangle(cornerRadius: 8, style: .continuous), + fill: WeiBeiTheme.paperRaised.opacity(PDFModeChipPresentation.fillOpacity(isExpanded: pdfControlsExpanded, isHovering: pdfControlsHovering)), + stroke: WeiBeiTheme.hairline.opacity(PDFModeChipPresentation.strokeOpacity(isExpanded: pdfControlsExpanded, isHovering: pdfControlsHovering)), + showsContactShadow: pdfControlsExpanded + ) RoundedRectangle(cornerRadius: 8) .fill(.regularMaterial) .opacity(pdfControlsExpanded ? 0.055 : 0.0) } } .clipShape(RoundedRectangle(cornerRadius: 8)) - .overlay { - RoundedRectangle(cornerRadius: 8) - .stroke(WeiBeiTheme.hairline.opacity(PDFModeChipPresentation.strokeOpacity(isExpanded: pdfControlsExpanded, isHovering: pdfControlsHovering)), lineWidth: 1) - } .shadow(color: WeiBeiTheme.ink.opacity(pdfControlsExpanded ? 0.045 : 0.0), radius: 7, y: 3) .opacity(PDFModeChipPresentation.controlOpacity(isExpanded: pdfControlsExpanded, isHovering: pdfControlsHovering)) .offset(x: 0) @@ -834,12 +834,12 @@ struct ReaderView: View { .foregroundStyle(WeiBeiTheme.secondaryInk) .padding(.horizontal, 9) .frame(height: 26) - .background(WeiBeiTheme.paperRaised.opacity(0.34)) + .weibeiEtchedBackground( + fill: WeiBeiTheme.paperRaised.opacity(0.34), + stroke: WeiBeiTheme.hairline.opacity(0.24), + cornerRadius: 7 + ) .clipShape(RoundedRectangle(cornerRadius: 7)) - .overlay { - RoundedRectangle(cornerRadius: 7) - .stroke(WeiBeiTheme.hairline.opacity(0.24), lineWidth: 1) - } .allowsHitTesting(false) } @@ -911,13 +911,13 @@ struct ReaderView: View { .foregroundStyle(pdfModeForeground) .padding(.horizontal, showsPDFModeLabel ? 7 : 4) .frame(width: showsPDFModeLabel ? nil : 18, height: 24) - .background(WeiBeiTheme.paperInset.opacity(pdfControlsActive ? 0.16 : 0.08)) + .weibeiEtchedBackground( + fill: WeiBeiTheme.paperInset.opacity(pdfControlsActive ? 0.16 : 0.08), + stroke: WeiBeiTheme.hairline.opacity(pdfControlsActive ? 0.58 : 0.18), + cornerRadius: 6 + ) .contentShape(RoundedRectangle(cornerRadius: 6)) .clipShape(RoundedRectangle(cornerRadius: 6)) - .overlay { - RoundedRectangle(cornerRadius: 6) - .stroke(WeiBeiTheme.hairline.opacity(pdfControlsActive ? 0.58 : 0.18), lineWidth: 1) - } .animation(WeiBeiMotion.micro, value: showsPDFModeLabel) } .accessibilityLabel(Text(store.ui("切换 PDF 浏览方式,当前\(pdfBrowseMode.label(language: store.interfaceLanguage))", "Switch PDF browsing mode. Current: \(pdfBrowseMode.label(language: store.interfaceLanguage))"))) @@ -3582,14 +3582,11 @@ struct ContextualContentPicker: View { } .padding(.horizontal, 17) .frame(height: 54) - .background { - RoundedRectangle(cornerRadius: 14, style: .continuous) - .fill(WeiBeiTheme.paperRaised.opacity(0.58)) - } - .overlay { - RoundedRectangle(cornerRadius: 14, style: .continuous) - .stroke(WeiBeiTheme.hairline.opacity(0.62), lineWidth: 0.7) - } + .weibeiEtchedBackground( + fill: WeiBeiTheme.paperRaised.opacity(0.58), + stroke: WeiBeiTheme.hairline.opacity(0.62), + cornerRadius: 14 + ) .contentShape(RoundedRectangle(cornerRadius: 14, style: .continuous)) } .buttonStyle(.plain) diff --git a/Sources/WeiBei/Views/RichAnswerHost.swift b/Sources/WeiBei/Views/RichAnswerHost.swift index 8cf540cfa..7a526fdd8 100644 --- a/Sources/WeiBei/Views/RichAnswerHost.swift +++ b/Sources/WeiBei/Views/RichAnswerHost.swift @@ -705,7 +705,11 @@ private struct ProcessStateSceneView: View { } .padding(.vertical, 8) .padding(.horizontal, 10) - .background(WeiBeiTheme.paperRaised.opacity(0.34), in: RoundedRectangle(cornerRadius: 8, style: .continuous)) + .weibeiEtchedBackground( + fill: WeiBeiTheme.paperRaised.opacity(0.34), + stroke: WeiBeiTheme.hairline.opacity(0.3), + cornerRadius: 8 + ) } @ViewBuilder @@ -846,7 +850,11 @@ private struct RelationEvidenceSceneView: View { } .padding(.vertical, 7) .padding(.horizontal, 9) - .background(WeiBeiTheme.paperInset.opacity(0.22), in: RoundedRectangle(cornerRadius: 7, style: .continuous)) + .weibeiEtchedBackground( + fill: WeiBeiTheme.paperInset.opacity(0.22), + stroke: WeiBeiTheme.hairline.opacity(0.26), + cornerRadius: 7 + ) } } @@ -1456,7 +1464,11 @@ private struct CalculationConstraintSceneView: View { } .padding(.vertical, 9) .padding(.horizontal, 10) - .background(WeiBeiTheme.paperRaised.opacity(0.30), in: RoundedRectangle(cornerRadius: 8, style: .continuous)) + .weibeiEtchedBackground( + fill: WeiBeiTheme.paperRaised.opacity(0.30), + stroke: WeiBeiTheme.hairline.opacity(0.28), + cornerRadius: 8 + ) } private var parameterControls: some View { @@ -2146,23 +2158,26 @@ private extension View { func visualCanvasSurface() -> some View { self - .background(WeiBeiTheme.paperInset.opacity(0.11)) - .clipShape(RoundedRectangle(cornerRadius: 5, style: .continuous)) - .overlay { - RoundedRectangle(cornerRadius: 5, style: .continuous) - .stroke(WeiBeiTheme.hairline.opacity(0.42), lineWidth: 1) + .background { + WeiBeiEtchedBackdrop( + shape: RoundedRectangle(cornerRadius: 5, style: .continuous), + fill: WeiBeiTheme.paperInset.opacity(0.11), + stroke: WeiBeiTheme.hairline.opacity(0.42) + ) } + .clipShape(RoundedRectangle(cornerRadius: 5, style: .continuous)) } func operationControlSurface() -> some View { self .padding(.vertical, 5) .padding(.horizontal, 7) - .background(WeiBeiTheme.paperRaised.opacity(0.38), in: RoundedRectangle(cornerRadius: 7, style: .continuous)) - .overlay { - RoundedRectangle(cornerRadius: 7, style: .continuous) - .stroke(WeiBeiTheme.hairline.opacity(0.32), lineWidth: 1) - } + .weibeiEtchedBackground( + fill: WeiBeiTheme.paperRaised.opacity(0.38), + stroke: WeiBeiTheme.hairline.opacity(0.32), + cornerRadius: 7, + contactShadow: true + ) } } diff --git a/Sources/WeiBei/Views/Settings/SettingsView.swift b/Sources/WeiBei/Views/Settings/SettingsView.swift index d269dea2b..0e3eb4d60 100644 --- a/Sources/WeiBei/Views/Settings/SettingsView.swift +++ b/Sources/WeiBei/Views/Settings/SettingsView.swift @@ -788,7 +788,11 @@ struct SettingsView: View { .padding(12) } .frame(minHeight: 260, maxHeight: 420) - .background(WeiBeiTheme.paperRaised.opacity(0.52)) + .weibeiEtchedBackground( + fill: WeiBeiTheme.paperRaised.opacity(0.52), + stroke: WeiBeiTheme.hairline.opacity(0.3), + cornerRadius: 8 + ) Button(store.ui("关闭", "Close")) { showInspirationSourcesSheet = false @@ -870,7 +874,11 @@ struct SettingsView: View { .frame(minHeight: 140, maxHeight: 200) .padding(6) } - .background(WeiBeiTheme.paperRaised.opacity(0.52)) + .weibeiEtchedBackground( + fill: WeiBeiTheme.paperRaised.opacity(0.52), + stroke: WeiBeiTheme.hairline.opacity(0.3), + cornerRadius: 8 + ) .clipShape(RoundedRectangle(cornerRadius: 7)) .overlay { RoundedRectangle(cornerRadius: 7) @@ -1168,7 +1176,11 @@ struct SettingsView: View { .foregroundStyle(WeiBeiTheme.ink) .padding(.horizontal, 9) .frame(height: 26) - .background(WeiBeiTheme.paperRaised.opacity(0.52)) + .weibeiEtchedBackground( + fill: WeiBeiTheme.paperRaised.opacity(0.52), + stroke: WeiBeiTheme.hairline.opacity(0.3), + cornerRadius: 8 + ) .clipShape(RoundedRectangle(cornerRadius: 6)) .overlay { RoundedRectangle(cornerRadius: 6)