@@ -182,25 +182,25 @@ fun APatchTheme(
182182 }
183183
184184 val colorScheme = baseColorScheme.copy(
185- background = if (BackgroundConfig .isCustomBackgroundEnabled && ! isSettingsScreen ) Color .Transparent else baseColorScheme.background,
186- surface = if (BackgroundConfig .isCustomBackgroundEnabled && ! isSettingsScreen ) {
185+ background = if (BackgroundConfig .isCustomBackgroundEnabled) Color .Transparent else baseColorScheme.background,
186+ surface = if (BackgroundConfig .isCustomBackgroundEnabled) {
187187 // 在自定义背景模式下,为surface添加半透明效果
188188 baseColorScheme.surface.copy(alpha = 0.75f )
189189 } else {
190190 baseColorScheme.surface
191191 },
192192 // 同样处理primary和secondary颜色,确保KStatusCard也有半透明效果
193- primary = if (BackgroundConfig .isCustomBackgroundEnabled && ! isSettingsScreen ) {
193+ primary = if (BackgroundConfig .isCustomBackgroundEnabled) {
194194 baseColorScheme.primary.copy(alpha = 0.75f )
195195 } else {
196196 baseColorScheme.primary
197197 },
198- secondary = if (BackgroundConfig .isCustomBackgroundEnabled && ! isSettingsScreen ) {
198+ secondary = if (BackgroundConfig .isCustomBackgroundEnabled) {
199199 baseColorScheme.secondary.copy(alpha = 0.75f )
200200 } else {
201201 baseColorScheme.secondary
202202 },
203- secondaryContainer = if (BackgroundConfig .isCustomBackgroundEnabled && ! isSettingsScreen ) {
203+ secondaryContainer = if (BackgroundConfig .isCustomBackgroundEnabled) {
204204 baseColorScheme.secondaryContainer.copy(alpha = 0.75f )
205205 } else {
206206 baseColorScheme.secondaryContainer
@@ -240,11 +240,10 @@ fun APatchThemeWithBackground(
240240
241241 APatchTheme (isSettingsScreen = isSettingsScreen) {
242242 Box (modifier = Modifier .fillMaxSize()) {
243- // 只有不在设置页面时才显示背景层
244- if (! isSettingsScreen) {
245- BackgroundLayer ()
246- }
247- // 内容层 - 添加zIndex确保在背景之上
243+ // Always show background layer if enabled
244+ BackgroundLayer ()
245+
246+ // Content layer - add zIndex to ensure it's above the background
248247 Box (modifier = Modifier .fillMaxSize().zIndex(1f )) {
249248 content()
250249 }
@@ -299,22 +298,5 @@ fun BackgroundLayer() {
299298 .zIndex(- 1f )
300299 .paint(painter = painter, contentScale = ContentScale .Crop )
301300 )
302-
303- // 只在暗色模式下添加半透明遮罩层,白天模式下不添加
304- if (darkTheme) {
305- Box (
306- modifier = Modifier
307- .fillMaxSize()
308- .zIndex(- 1f )
309- .background(
310- Brush .verticalGradient(
311- colors = listOf (
312- Color .Black .copy(alpha = 0.4f ),
313- Color .Black .copy(alpha = 0.2f )
314- )
315- )
316- )
317- )
318- }
319301 }
320302}
0 commit comments