From 5197fd7efb5a8077b29c7f682ccc38091300566d Mon Sep 17 00:00:00 2001 From: li-li-wang Date: Wed, 4 Jun 2025 10:16:54 +0800 Subject: [PATCH] =?UTF-8?q?shadow=E9=98=B4=E5=BD=B1=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9=E4=B8=BA=E4=BD=BF=E7=94=A8=E5=9B=BA?= =?UTF-8?q?=E5=AE=9A=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-li-wang --- .../src/main/ets/common/utils/constant.ets | 4 ++++ .../src/main/ets/pages/securityToast.ets | 12 +++++++++++- .../src/main/resources/base/element/color.json | 8 ++++++++ .../src/main/resources/dark/element/color.json | 8 ++++++++ 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/permissionmanager/src/main/ets/common/utils/constant.ets b/permissionmanager/src/main/ets/common/utils/constant.ets index 8944753..8b95871 100644 --- a/permissionmanager/src/main/ets/common/utils/constant.ets +++ b/permissionmanager/src/main/ets/common/utils/constant.ets @@ -369,4 +369,8 @@ export default class Constants { public static TOAST_CONSTRAINT_SIZE_MIN_HEIGHT = 36; public static TOAST_COLUMN_WIDTH = '100%'; public static TOAST_COLUMN_HEIGHT = '100%'; + public static TOAST_FLEX_SHADOW_RADIUS_40 = 40; + public static TOAST_FLEX_SHADOW_RADIUS_60 = 60; + public static TOAST_FLEX_SHADOW_OFFSET_X = 0; + public static TOAST_FLEX_SHADOW_OFFSET_Y = 10; } diff --git a/permissionmanager/src/main/ets/pages/securityToast.ets b/permissionmanager/src/main/ets/pages/securityToast.ets index e137440..b9a3239 100644 --- a/permissionmanager/src/main/ets/pages/securityToast.ets +++ b/permissionmanager/src/main/ets/pages/securityToast.ets @@ -166,7 +166,17 @@ struct SecurityToast { bottom: Constants.PADDING_8, left: Constants.PADDING_16 }) - .shadow(DeviceUtil.isPC() ? ShadowStyle.OUTER_DEFAULT_SM : ShadowStyle.OUTER_DEFAULT_MD) + .shadow(DeviceUtil.isPC() ? { + radius: Constants.TOAST_FLEX_SHADOW_RADIUS_40, + color: $r('app.color.outerDefaultSMColor'), + offsetX: Constants.TOAST_FLEX_SHADOW_OFFSET_X, + offsetY: Constants.TOAST_FLEX_SHADOW_OFFSET_Y + } : { + radius: Constants.TOAST_FLEX_SHADOW_RADIUS_60, + color: $r('app.color.outerDefaultMDColor'), + offsetX: Constants.TOAST_FLEX_SHADOW_OFFSET_X, + offsetY: Constants.TOAST_FLEX_SHADOW_OFFSET_Y + }) .borderRadius(DeviceUtil.isPC() ? $r('sys.float.corner_radius_level4') : $r('sys.float.corner_radius_level9')) .backgroundBlurStyle(DeviceUtil.isPC() ? BlurStyle.COMPONENT_REGULAR : BlurStyle.COMPONENT_ULTRA_THICK) .border(DeviceUtil.isPC() ? { width: '1px', color: '#33ffffff' } : {}) diff --git a/permissionmanager/src/main/resources/base/element/color.json b/permissionmanager/src/main/resources/base/element/color.json index 656bdbb..52fa911 100644 --- a/permissionmanager/src/main/resources/base/element/color.json +++ b/permissionmanager/src/main/resources/base/element/color.json @@ -31,6 +31,14 @@ { "name": "outline", "value": "#1A000000" + }, + { + "name": "outerDefaultMDColor", + "value": "#33000000" + }, + { + "name": "outerDefaultSMColor", + "value": "#26000000" } ] } \ No newline at end of file diff --git a/permissionmanager/src/main/resources/dark/element/color.json b/permissionmanager/src/main/resources/dark/element/color.json index 41b7a03..aec87c7 100644 --- a/permissionmanager/src/main/resources/dark/element/color.json +++ b/permissionmanager/src/main/resources/dark/element/color.json @@ -3,6 +3,14 @@ { "name": "outline", "value": "#66000000" + }, + { + "name": "outerDefaultMDColor", + "value": "#7B050505" + }, + { + "name": "outerDefaultSMColor", + "value": "#52050505" } ] } \ No newline at end of file -- Gitee