diff --git a/.gitee/CODEOWNERS b/.gitee/CODEOWNERS index 80bb14ffbef345beed7aaa304a095aabcae6f74e..bff9688e7c2d96cc012a7accc9892f04085a06ae 100644 --- a/.gitee/CODEOWNERS +++ b/.gitee/CODEOWNERS @@ -1319,6 +1319,8 @@ frameworks/bridge/declarative_frontend/jsview/js_video_controller.cpp @arkuilayo frameworks/bridge/declarative_frontend/jsview/js_video_controller.h @arkuilayout frameworks/bridge/declarative_frontend/jsview/js_video.cpp @arkuilayout frameworks/bridge/declarative_frontend/jsview/js_video.h @arkuilayout +frameworks/bridge/declarative_frontend/jsview/js_view_abstract_bridge.cpp @arkuievent +frameworks/bridge/declarative_frontend/jsview/js_view_abstract_bridge.h @arkuievent frameworks/bridge/declarative_frontend/jsview/js_view_abstract.cpp @arkuievent frameworks/bridge/declarative_frontend/jsview/js_view_abstract.h @arkuievent frameworks/bridge/declarative_frontend/jsview/js_view_common_def.h @arkuievent @@ -1920,6 +1922,7 @@ frameworks/core/components/common/properties/animatable_path.h @arkuiframework frameworks/core/components/common/properties/animation_option.h @arkuiframework frameworks/core/components/common/properties/blend_mode.h @arkuiframework frameworks/core/components/common/properties/blur_parameter.h @arkuiframework +frameworks/core/components/common/properties/blur_style_option.h @arkuievent frameworks/core/components/common/properties/border.cpp @arkuilayout frameworks/core/components/common/properties/border_edge.cpp @arkuilayout frameworks/core/components/common/properties/border_edge.h @arkuilayout diff --git a/frameworks/bridge/declarative_frontend/BUILD.gn b/frameworks/bridge/declarative_frontend/BUILD.gn index a5852d3acf9d41fb2c48892b236840e83685fff4..80899eaa80767f10298b9a1d5271de7663ee32b8 100644 --- a/frameworks/bridge/declarative_frontend/BUILD.gn +++ b/frameworks/bridge/declarative_frontend/BUILD.gn @@ -400,6 +400,7 @@ template("declarative_js_engine") { "jsview/js_utils.cpp", "jsview/js_view.cpp", "jsview/js_view_abstract.cpp", + "jsview/js_view_abstract_bridge.cpp", "jsview/js_view_context.cpp", "jsview/js_view_functions.cpp", "jsview/js_view_measure_layout.cpp", @@ -962,6 +963,7 @@ template("declarative_js_engine_ng") { "jsview/js_utils.cpp", "jsview/js_view.cpp", "jsview/js_view_abstract.cpp", + "jsview/js_view_abstract_bridge.cpp", "jsview/js_view_context.cpp", "jsview/menu/js_context_menu.cpp", "jsview/scroll_bar/js_scroll_bar.cpp", diff --git a/frameworks/bridge/declarative_frontend/frontend_delegate_declarative.cpp b/frameworks/bridge/declarative_frontend/frontend_delegate_declarative.cpp index fe0884d86e81a0991a7918ea01d6c689813d93a7..591cd0ee37b92df269b4abd681432c07610d1cfb 100644 --- a/frameworks/bridge/declarative_frontend/frontend_delegate_declarative.cpp +++ b/frameworks/bridge/declarative_frontend/frontend_delegate_declarative.cpp @@ -1793,6 +1793,8 @@ void FrontendDelegateDeclarative::ShowDialog(const PromptDialogAttr& dialogAttr, .dialogLevelMode = dialogAttr.dialogLevelMode, .dialogLevelUniqueId = dialogAttr.dialogLevelUniqueId, .dialogImmersiveMode = dialogAttr.dialogImmersiveMode, + .blurStyleOption = dialogAttr.blurStyleOption, + .effectOption = dialogAttr.effectOption }; #if defined(PREVIEW) if (dialogProperties.isShowInSubWindow) { @@ -1882,7 +1884,9 @@ DialogProperties FrontendDelegateDeclarative::ParsePropertiesFromAttr(const Prom .dialogLevelMode = dialogAttr.dialogLevelMode, .dialogLevelUniqueId = dialogAttr.dialogLevelUniqueId, .isUserCreatedDialog = dialogAttr.isUserCreatedDialog, - .dialogImmersiveMode = dialogAttr.dialogImmersiveMode + .dialogImmersiveMode = dialogAttr.dialogImmersiveMode, + .blurStyleOption = dialogAttr.blurStyleOption, + .effectOption = dialogAttr.effectOption }; #if defined(PREVIEW) if (dialogProperties.isShowInSubWindow) { diff --git a/frameworks/bridge/declarative_frontend/jsview/action_sheet/js_action_sheet.cpp b/frameworks/bridge/declarative_frontend/jsview/action_sheet/js_action_sheet.cpp index e981a3df17141ffde34aa62a9d4b591ec9e4733c..e079498683a2f477ef99314765837e818d2c37f1 100644 --- a/frameworks/bridge/declarative_frontend/jsview/action_sheet/js_action_sheet.cpp +++ b/frameworks/bridge/declarative_frontend/jsview/action_sheet/js_action_sheet.cpp @@ -533,6 +533,8 @@ void JSActionSheet::Show(const JSCallbackInfo& args) ParseLevelOrder(properties, obj); JSViewAbstract::SetDialogProperties(obj, properties); JSViewAbstract::SetDialogHoverModeProperties(obj, properties); + JSViewAbstract::SetDialogBlurStyleOption(obj, properties); + JSViewAbstract::SetDialogEffectOption(obj, properties); ActionSheetModel::GetInstance()->ShowActionSheet(properties); args.SetReturnValue(args.This()); #endif diff --git a/frameworks/bridge/declarative_frontend/jsview/dialog/js_alert_dialog.cpp b/frameworks/bridge/declarative_frontend/jsview/dialog/js_alert_dialog.cpp index 45d2a48291d19adeab0b4f8305c5f2fa78934497..b03f11e3ea12765fcb96a34afab8d9459239c755 100644 --- a/frameworks/bridge/declarative_frontend/jsview/dialog/js_alert_dialog.cpp +++ b/frameworks/bridge/declarative_frontend/jsview/dialog/js_alert_dialog.cpp @@ -540,6 +540,8 @@ void JSAlertDialog::Show(const JSCallbackInfo& args) ParseAlertLevelOrder(properties, obj); JSViewAbstract::SetDialogProperties(obj, properties); JSViewAbstract::SetDialogHoverModeProperties(obj, properties); + JSViewAbstract::SetDialogBlurStyleOption(obj, properties); + JSViewAbstract::SetDialogEffectOption(obj, properties); AlertDialogModel::GetInstance()->SetShowDialog(properties); } } diff --git a/frameworks/bridge/declarative_frontend/jsview/dialog/js_custom_dialog_controller.cpp b/frameworks/bridge/declarative_frontend/jsview/dialog/js_custom_dialog_controller.cpp index b3dff08f5dd672ba153323f887fc0c4e525821c5..4739720defc9a4de25ba64bc218b2320271241c0 100644 --- a/frameworks/bridge/declarative_frontend/jsview/dialog/js_custom_dialog_controller.cpp +++ b/frameworks/bridge/declarative_frontend/jsview/dialog/js_custom_dialog_controller.cpp @@ -314,6 +314,8 @@ void JSCustomDialogController::ConstructorCallback(const JSCallbackInfo& info) instance->dialogProperties_.controllerId = controllerId.fetch_add(1, std::memory_order_relaxed); JSViewAbstract::SetDialogProperties(constructorArg, instance->dialogProperties_); JSViewAbstract::SetDialogHoverModeProperties(constructorArg, instance->dialogProperties_); + JSViewAbstract::SetDialogBlurStyleOption(constructorArg, instance->dialogProperties_); + JSViewAbstract::SetDialogEffectOption(constructorArg, instance->dialogProperties_); instance->IncRefCount(); info.SetReturnValue(AceType::RawPtr(instance)); } diff --git a/frameworks/bridge/declarative_frontend/jsview/js_calendar_picker.cpp b/frameworks/bridge/declarative_frontend/jsview/js_calendar_picker.cpp index ab0695de1e8b0da66dc79d55f9921bb43a46ae70..1a8ba3895603b8334bbfe88becf67e90b79945ee 100644 --- a/frameworks/bridge/declarative_frontend/jsview/js_calendar_picker.cpp +++ b/frameworks/bridge/declarative_frontend/jsview/js_calendar_picker.cpp @@ -875,6 +875,8 @@ void JSCalendarPickerDialog::CalendarPickerDialogShow(const JSRef& par properties.borderRadius = dialogRadius; } JSViewAbstract::SetDialogHoverModeProperties(paramObj, properties); + JSViewAbstract::SetDialogBlurStyleOption(paramObj, properties); + JSViewAbstract::SetDialogEffectOption(paramObj, properties); auto context = AccessibilityManager::DynamicCast(pipelineContext); auto overlayManager = context ? context->GetOverlayManager() : nullptr; diff --git a/frameworks/bridge/declarative_frontend/jsview/js_datepicker.cpp b/frameworks/bridge/declarative_frontend/jsview/js_datepicker.cpp index 01b7f31f521842350c0271a31242776643b79639..7b7412b54959e50e1aab339b9d6c694fa56ca7a1 100644 --- a/frameworks/bridge/declarative_frontend/jsview/js_datepicker.cpp +++ b/frameworks/bridge/declarative_frontend/jsview/js_datepicker.cpp @@ -278,6 +278,28 @@ void ParseDatePickerHoverMode(PickerDialogInfo& pickerDialog, const JSRef& paramObject) +{ + auto blurStyleValue = paramObject->GetProperty("backgroundBlurStyleOptions"); + if (blurStyleValue->IsObject()) { + if (!pickerDialog.blurStyleOption.has_value()) { + pickerDialog.blurStyleOption.emplace(); + } + JSViewAbstract::ParseBlurStyleOption(blurStyleValue, pickerDialog.blurStyleOption.value()); + } +} + +void ParseDatePickerEffectOption(PickerDialogInfo& pickerDialog, const JSRef& paramObject) +{ + auto effectOptionValue = paramObject->GetProperty("backgroundEffect"); + if (effectOptionValue->IsObject()) { + if (!pickerDialog.effectOption.has_value()) { + pickerDialog.effectOption.emplace(); + } + JSViewAbstract::ParseEffectOption(effectOptionValue, pickerDialog.effectOption.value()); + } +} } // namespace void JSDatePicker::JSBind(BindingTarget globalObj) @@ -1166,6 +1188,8 @@ void JSDatePickerDialog::UpdatePickerDialogInfo(const JSRef& paramObje } ParseDatePickerHoverMode(pickerDialog, paramObject); + ParseDatePickerBlurStyleOption(pickerDialog, paramObject); + ParseDatePickerEffectOption(pickerDialog, paramObject); } void JSDatePickerDialog::Show(const JSCallbackInfo& info) @@ -1905,6 +1929,8 @@ void JSTimePickerDialog::Show(const JSCallbackInfo& info) } ParseDatePickerHoverMode(pickerDialog, paramObject); + ParseDatePickerBlurStyleOption(pickerDialog, paramObject); + ParseDatePickerEffectOption(pickerDialog, paramObject); auto buttonInfos = ParseButtonStyles(paramObject); diff --git a/frameworks/bridge/declarative_frontend/jsview/js_popups.cpp b/frameworks/bridge/declarative_frontend/jsview/js_popups.cpp index ff3008b36678d25779a65789e41f878f87b2266e..410c5b0c57fb1e66657db9bbaef7cfdd0ea8fe2d 100644 --- a/frameworks/bridge/declarative_frontend/jsview/js_popups.cpp +++ b/frameworks/bridge/declarative_frontend/jsview/js_popups.cpp @@ -2004,4 +2004,26 @@ void JSViewAbstract::SetDialogHoverModeProperties(const JSRef& obj, Di } } } + +void JSViewAbstract::SetDialogBlurStyleOption(const JSRef& obj, DialogProperties& properties) +{ + auto blurStyleValue = obj->GetProperty("backgroundBlurStyleOptions"); + if (blurStyleValue->IsObject()) { + if (!properties.blurStyleOption.has_value()) { + properties.blurStyleOption.emplace(); + } + JSViewAbstract::ParseBlurStyleOption(blurStyleValue, properties.blurStyleOption.value()); + } +} + +void JSViewAbstract::SetDialogEffectOption(const JSRef& obj, DialogProperties& properties) +{ + auto effectOptionValue = obj->GetProperty("backgroundEffect"); + if (effectOptionValue->IsObject()) { + if (!properties.effectOption.has_value()) { + properties.effectOption.emplace(); + } + JSViewAbstract::ParseEffectOption(effectOptionValue, properties.effectOption.value()); + } +} } \ No newline at end of file diff --git a/frameworks/bridge/declarative_frontend/jsview/js_textpicker.cpp b/frameworks/bridge/declarative_frontend/jsview/js_textpicker.cpp index 3291069db5b42585013ad4dd657e180f8c7610ae..58fef0d6d7789b68e06769b4943d580aa5a76568 100644 --- a/frameworks/bridge/declarative_frontend/jsview/js_textpicker.cpp +++ b/frameworks/bridge/declarative_frontend/jsview/js_textpicker.cpp @@ -1701,6 +1701,22 @@ void JSTextPickerDialog::Show(const JSCallbackInfo& info) } } + auto blurStyleValue = paramObject->GetProperty("backgroundBlurStyleOptions"); + if (blurStyleValue->IsObject()) { + if (!textPickerDialog.blurStyleOption.has_value()) { + textPickerDialog.blurStyleOption.emplace(); + } + JSViewAbstract::ParseBlurStyleOption(blurStyleValue, textPickerDialog.blurStyleOption.value()); + } + + auto effectOptionValue = paramObject->GetProperty("backgroundEffect"); + if (effectOptionValue->IsObject()) { + if (!textPickerDialog.effectOption.has_value()) { + textPickerDialog.effectOption.emplace(); + } + JSViewAbstract::ParseEffectOption(effectOptionValue, textPickerDialog.effectOption.value()); + } + auto buttonInfos = ParseButtonStyles(paramObject); TextPickerDialogEvent textPickerDialogEvent { nullptr, nullptr, nullptr, nullptr }; diff --git a/frameworks/bridge/declarative_frontend/jsview/js_view_abstract.h b/frameworks/bridge/declarative_frontend/jsview/js_view_abstract.h index 7a765375f8e1ef7cafe1c44f1dc6b2c559c379d7..28d045aa0603e86c76c29458f3a335d11bca8d5e 100755 --- a/frameworks/bridge/declarative_frontend/jsview/js_view_abstract.h +++ b/frameworks/bridge/declarative_frontend/jsview/js_view_abstract.h @@ -668,6 +668,8 @@ public: NG::OnMenuItemClickCallback& onMenuItemClick); static void SetDialogProperties(const JSRef& obj, DialogProperties& properties); static void SetDialogHoverModeProperties(const JSRef& obj, DialogProperties& properties); + static void SetDialogBlurStyleOption(const JSRef& obj, DialogProperties& properties); + static void SetDialogEffectOption(const JSRef& obj, DialogProperties& properties); static std::function GetDrawCallback( const RefPtr& jsDraw, const JSExecutionContext& execCtx); diff --git a/frameworks/bridge/declarative_frontend/jsview/js_view_abstract_bridge.cpp b/frameworks/bridge/declarative_frontend/jsview/js_view_abstract_bridge.cpp new file mode 100644 index 0000000000000000000000000000000000000000..32e563538bdc087d7e470dc1bca43fd6ce780738 --- /dev/null +++ b/frameworks/bridge/declarative_frontend/jsview/js_view_abstract_bridge.cpp @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "bridge/declarative_frontend/jsview/js_view_abstract_bridge.h" + +#include "bridge/declarative_frontend/engine/js_converter.h" +#include "bridge/declarative_frontend/jsview/js_view_abstract.h" + +namespace OHOS::Ace::Framework { + +void JSViewAbstractBridge::GetBackgroundBlurStyleOption(napi_value napiVal, BlurStyleOption& styleOption) +{ + JSRef value = JsConverter::ConvertNapiValueToJsVal(napiVal); + if (value.IsEmpty() || !value->IsObject()) { + return; + } + JSRef obj = JSRef::Cast(value); + + auto blurStyleValue = obj->GetProperty("backgroundBlurStyleOptions"); + if (blurStyleValue->IsObject()) { + JSViewAbstract::ParseBlurStyleOption(blurStyleValue, styleOption); + } +} + +void JSViewAbstractBridge::GetBackgroundEffect(napi_value napiVal, EffectOption& styleOption) +{ + JSRef value = JsConverter::ConvertNapiValueToJsVal(napiVal); + if (value.IsEmpty() || !value->IsObject()) { + return; + } + JSRef obj = JSRef::Cast(value); + + auto effectOptionValue = obj->GetProperty("backgroundEffect"); + if (effectOptionValue->IsObject()) { + JSViewAbstract::ParseEffectOption(effectOptionValue, styleOption); + } +} +} // namespace OHOS::Ace::Framework \ No newline at end of file diff --git a/frameworks/bridge/declarative_frontend/jsview/js_view_abstract_bridge.h b/frameworks/bridge/declarative_frontend/jsview/js_view_abstract_bridge.h new file mode 100644 index 0000000000000000000000000000000000000000..7818f8590943cd63b6bc1b6a8fde1ee682e0c5b9 --- /dev/null +++ b/frameworks/bridge/declarative_frontend/jsview/js_view_abstract_bridge.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_JS_VIEW_ABSTRACT_BRIDGE_H +#define FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_JS_VIEW_ABSTRACT_BRIDGE_H + +#include "base/want/want_wrap.h" +#include "core/components/common/properties/blur_style_option.h" + +namespace OHOS::Ace::Framework { + +class JSViewAbstractBridge { +public: + static void GetBackgroundBlurStyleOption(napi_value value, BlurStyleOption& styleOption); + static void GetBackgroundEffect(napi_value value, EffectOption& styleOption); +}; +} // namespace OHOS::Ace::Framework +#endif // RAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_JS_VIEW_ABSTRACT_BRIDGE_H diff --git a/frameworks/bridge/declarative_frontend/ng/frontend_delegate_declarative_ng.cpp b/frameworks/bridge/declarative_frontend/ng/frontend_delegate_declarative_ng.cpp index 5fe8d3f4c1d478a179659260f626da792a07254e..f93fd5edd4dc9efa04b73dd75427e0eac9e0e0a7 100644 --- a/frameworks/bridge/declarative_frontend/ng/frontend_delegate_declarative_ng.cpp +++ b/frameworks/bridge/declarative_frontend/ng/frontend_delegate_declarative_ng.cpp @@ -746,6 +746,12 @@ void FrontendDelegateDeclarativeNG::ShowDialog(const PromptDialogAttr& dialogAtt if (dialogAttr.backgroundBlurStyle.has_value()) { dialogProperties.backgroundBlurStyle = dialogAttr.backgroundBlurStyle.value(); } + if (dialogAttr.blurStyleOption.has_value()) { + dialogProperties.blurStyleOption = dialogAttr.blurStyleOption.value(); + } + if (dialogAttr.effectOption.has_value()) { + dialogProperties.effectOption = dialogAttr.effectOption.value(); + } if (dialogAttr.hoverModeArea.has_value()) { dialogProperties.hoverModeArea = dialogAttr.hoverModeArea.value(); } @@ -798,7 +804,9 @@ DialogProperties FrontendDelegateDeclarativeNG::ParsePropertiesFromAttr(const Pr .dialogLevelMode = dialogAttr.dialogLevelMode, .dialogLevelUniqueId = dialogAttr.dialogLevelUniqueId, .isUserCreatedDialog = dialogAttr.isUserCreatedDialog, - .dialogImmersiveMode = dialogAttr.dialogImmersiveMode + .dialogImmersiveMode = dialogAttr.dialogImmersiveMode, + .blurStyleOption = dialogAttr.blurStyleOption, + .effectOption = dialogAttr.effectOption }; #if defined(PREVIEW) if (dialogProperties.isShowInSubWindow) { diff --git a/frameworks/bridge/js_frontend/frontend_delegate.h b/frameworks/bridge/js_frontend/frontend_delegate.h index 8622733fadded3b1144106719c1e3a834ff1b6e7..48558778c00b3417514e4f233f0477fd0df7dadc 100644 --- a/frameworks/bridge/js_frontend/frontend_delegate.h +++ b/frameworks/bridge/js_frontend/frontend_delegate.h @@ -31,6 +31,7 @@ #include "core/pipeline/pipeline_base.h" #include "frameworks/bridge/common/media_query/media_query_info.h" #include "frameworks/bridge/common/utils/componentInfo.h" +#include "frameworks/bridge/declarative_frontend/jsview/js_view_abstract_bridge.h" #include "frameworks/bridge/js_frontend/engine/common/group_js_bridge.h" #include "frameworks/bridge/js_frontend/engine/common/js_constants.h" #include "interfaces/inner_api/ace/constants.h" @@ -372,6 +373,15 @@ public: virtual void CallNativeHandler(const std::string& event, const std::string& params) {} + virtual void GetBackgroundBlurStyleOption(napi_value value, BlurStyleOption& styleOption) + { + JSViewAbstractBridge::GetBackgroundBlurStyleOption(value, styleOption); + } + virtual void GetBackgroundEffect(napi_value value, EffectOption& styleOption) + { + JSViewAbstractBridge::GetBackgroundEffect(value, styleOption); + } + protected: RefPtr assetManager_; bool disallowPopLastPage_ = false; diff --git a/frameworks/core/components/common/properties/blur_style_option.h b/frameworks/core/components/common/properties/blur_style_option.h new file mode 100644 index 0000000000000000000000000000000000000000..fc3998e80c24bd3cb0690eefecf32ca7434b2b73 --- /dev/null +++ b/frameworks/core/components/common/properties/blur_style_option.h @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_BASE_PROPERTIES_BLUR_STYLE_OPTION_H +#define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_BASE_PROPERTIES_BLUR_STYLE_OPTION_H + +#include "base/json/json_util.h" +#include "core/components/common/properties/color.h" +#include "core/components/common/properties/common_decoration.h" +#include "core/components_ng/base/inspector_filter.h" + +namespace OHOS::Ace { +enum class ThemeColorMode { + SYSTEM = 0, + LIGHT, + DARK, +}; + +struct BlurStyleOption { + BlurStyle blurStyle = BlurStyle::NO_MATERIAL; + ThemeColorMode colorMode = ThemeColorMode::SYSTEM; + AdaptiveColor adaptiveColor = AdaptiveColor::DEFAULT; + double scale = 1.0; + BlurOption blurOption; + BlurStyleActivePolicy policy = BlurStyleActivePolicy::ALWAYS_ACTIVE; + BlurType blurType = BlurType::WITHIN_WINDOW; + Color inactiveColor { Color::TRANSPARENT }; + bool isValidColor = false; + bool isWindowFocused = true; + bool operator==(const BlurStyleOption& other) const + { + return blurStyle == other.blurStyle && colorMode == other.colorMode && adaptiveColor == other.adaptiveColor && + NearEqual(scale, other.scale) && policy == other.policy && blurType == other.blurType && + inactiveColor == other.inactiveColor && isValidColor == other.isValidColor && + isWindowFocused == other.isWindowFocused; + } + void ToJsonValue(std::unique_ptr& json, const NG::InspectorFilter& filter) const + { + /* no fixed attr below, just return */ + if (filter.IsFastFilter()) { + return; + } + static const char* STYLE[] = { "BlurStyle.NONE", "BlurStyle.Thin", "BlurStyle.Regular", "BlurStyle.Thick", + "BlurStyle.BACKGROUND_THIN", "BlurStyle.BACKGROUND_REGULAR", "BlurStyle.BACKGROUND_THICK", + "BlurStyle.BACKGROUND_ULTRA_THICK", "BlurStyle.COMPONENT_ULTRA_THIN", "BlurStyle.COMPONENT_THIN", + "BlurStyle.COMPONENT_REGULAR", "BlurStyle.COMPONENT_THICK", "BlurStyle.COMPONENT_ULTRA_THICK" }; + static const char* COLOR_MODE[] = { "ThemeColorMode.System", "ThemeColorMode.Light", "ThemeColorMode.Dark" }; + static const char* ADAPTIVE_COLOR[] = { "AdaptiveColor.Default", "AdaptiveColor.Average" }; + static const char* POLICY[] = { "BlurStyleActivePolicy.FOLLOWS_WINDOW_ACTIVE_STATE", + "BlurStyleActivePolicy.ALWAYS_ACTIVE", "BlurStyleActivePolicy.ALWAYS_INACTIVE" }; + static const char* BLUR_TYPE[] = { "BlurType.WITHIN_WINDOW", "BlurType.BEHIND_WINDOW" }; + auto jsonBlurStyle = JsonUtil::Create(true); + jsonBlurStyle->Put("value", STYLE[static_cast(blurStyle)]); + auto jsonBlurStyleOption = JsonUtil::Create(true); + jsonBlurStyleOption->Put("colorMode", COLOR_MODE[static_cast(colorMode)]); + jsonBlurStyleOption->Put("adaptiveColor", ADAPTIVE_COLOR[static_cast(adaptiveColor)]); + jsonBlurStyleOption->Put("policy", POLICY[static_cast(policy)]); + jsonBlurStyleOption->Put("type", BLUR_TYPE[static_cast(blurType)]); + jsonBlurStyleOption->Put("inactiveColor", inactiveColor.ColorToString().c_str()); + jsonBlurStyleOption->Put("scale", scale); + jsonBlurStyle->Put("options", jsonBlurStyleOption); + + json->PutExtAttr("backgroundBlurStyle", jsonBlurStyle, filter); + } +}; +} // namespace OHOS::Ace +#endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_BASE_PROPERTIES_BLUR_STYLE_OPTION_H diff --git a/frameworks/core/components/common/properties/decoration.h b/frameworks/core/components/common/properties/decoration.h index 48522e73092fdeac2d64008c180f3cde3bec895b..0f86ad71e74d0c97677b6782a45a54260d66587a 100755 --- a/frameworks/core/components/common/properties/decoration.h +++ b/frameworks/core/components/common/properties/decoration.h @@ -30,6 +30,7 @@ #include "core/components/common/properties/alignment.h" #include "core/components/common/properties/animatable_color.h" #include "core/components/common/properties/blend_mode.h" +#include "core/components/common/properties/blur_style_option.h" #include "core/components/common/properties/border.h" #include "core/components/common/properties/border_image.h" #include "core/components/common/properties/color.h" @@ -91,13 +92,6 @@ enum class SpreadMethod { REPEAT, }; - -enum class ThemeColorMode { - SYSTEM = 0, - LIGHT, - DARK, -}; - struct MotionBlurAnchor { float x = 0.0f; float y = 0.0f; @@ -124,54 +118,6 @@ struct MotionBlurOption { } }; -struct BlurStyleOption { - BlurStyle blurStyle = BlurStyle::NO_MATERIAL; - ThemeColorMode colorMode = ThemeColorMode::SYSTEM; - AdaptiveColor adaptiveColor = AdaptiveColor::DEFAULT; - double scale = 1.0; - BlurOption blurOption; - BlurStyleActivePolicy policy = BlurStyleActivePolicy::ALWAYS_ACTIVE; - BlurType blurType = BlurType::WITHIN_WINDOW; - Color inactiveColor { Color::TRANSPARENT }; - bool isValidColor = false; - bool isWindowFocused = true; - bool operator==(const BlurStyleOption& other) const - { - return blurStyle == other.blurStyle && colorMode == other.colorMode && adaptiveColor == other.adaptiveColor && - NearEqual(scale, other.scale) && policy == other.policy && blurType == other.blurType && - inactiveColor == other.inactiveColor && isValidColor == other.isValidColor && - isWindowFocused == other.isWindowFocused; - } - void ToJsonValue(std::unique_ptr& json, const NG::InspectorFilter& filter) const - { - /* no fixed attr below, just return */ - if (filter.IsFastFilter()) { - return; - } - static const char* STYLE[] = { "BlurStyle.NONE", "BlurStyle.Thin", "BlurStyle.Regular", "BlurStyle.Thick", - "BlurStyle.BACKGROUND_THIN", "BlurStyle.BACKGROUND_REGULAR", "BlurStyle.BACKGROUND_THICK", - "BlurStyle.BACKGROUND_ULTRA_THICK", "BlurStyle.COMPONENT_ULTRA_THIN", "BlurStyle.COMPONENT_THIN", - "BlurStyle.COMPONENT_REGULAR", "BlurStyle.COMPONENT_THICK", "BlurStyle.COMPONENT_ULTRA_THICK" }; - static const char* COLOR_MODE[] = { "ThemeColorMode.System", "ThemeColorMode.Light", "ThemeColorMode.Dark" }; - static const char* ADAPTIVE_COLOR[] = { "AdaptiveColor.Default", "AdaptiveColor.Average" }; - static const char* POLICY[] = { "BlurStyleActivePolicy.FOLLOWS_WINDOW_ACTIVE_STATE", - "BlurStyleActivePolicy.ALWAYS_ACTIVE", "BlurStyleActivePolicy.ALWAYS_INACTIVE" }; - static const char* BLUR_TYPE[] = { "BlurType.WITHIN_WINDOW", "BlurType.BEHIND_WINDOW" }; - auto jsonBlurStyle = JsonUtil::Create(true); - jsonBlurStyle->Put("value", STYLE[static_cast(blurStyle)]); - auto jsonBlurStyleOption = JsonUtil::Create(true); - jsonBlurStyleOption->Put("colorMode", COLOR_MODE[static_cast(colorMode)]); - jsonBlurStyleOption->Put("adaptiveColor", ADAPTIVE_COLOR[static_cast(adaptiveColor)]); - jsonBlurStyleOption->Put("policy", POLICY[static_cast(policy)]); - jsonBlurStyleOption->Put("type", BLUR_TYPE[static_cast(blurType)]); - jsonBlurStyleOption->Put("inactiveColor", inactiveColor.ColorToString().c_str()); - jsonBlurStyleOption->Put("scale", scale); - jsonBlurStyle->Put("options", jsonBlurStyleOption); - - json->PutExtAttr("backgroundBlurStyle", jsonBlurStyle, filter); - } -}; - struct MenuPreviewAnimationOptions { float scaleFrom { -1.0f }; float scaleTo { -1.0f }; diff --git a/frameworks/core/components/dialog/dialog_properties.h b/frameworks/core/components/dialog/dialog_properties.h index 24dad12a8f07597ef685ec7be74e723f07df2daf..0d5d812dd46e82f7516ce14e4ac833f4015cf9a8 100644 --- a/frameworks/core/components/dialog/dialog_properties.h +++ b/frameworks/core/components/dialog/dialog_properties.h @@ -20,6 +20,7 @@ #include "base/geometry/dimension_offset.h" #include "base/geometry/dimension.h" +#include "core/components/common/properties/blur_style_option.h" #include "core/components/common/properties/color.h" #include "core/components/common/properties/shadow.h" #include "core/components_ng/event/click_event.h" @@ -252,6 +253,8 @@ struct DialogProperties { std::function customBuilder; std::function customBuilderWithId; std::optional backgroundBlurStyle; + std::optional blurStyleOption; + std::optional effectOption; std::optional borderWidth; std::optional borderColor; std::optional borderStyle; @@ -315,6 +318,8 @@ struct PromptDialogAttr { std::optional maskRect; std::optional backgroundColor; std::optional backgroundBlurStyle; + std::optional blurStyleOption; + std::optional effectOption; std::optional borderWidth; std::optional borderColor; std::optional borderStyle; diff --git a/frameworks/core/components_ng/pattern/calendar_picker/calendar_dialog_view.cpp b/frameworks/core/components_ng/pattern/calendar_picker/calendar_dialog_view.cpp index 24dc3fbaa86235b9d97adfb5400aa726ac11d9e7..ce8df4e2d4bd2f64b03b0dcb6cdab4bde8de1d76 100644 --- a/frameworks/core/components_ng/pattern/calendar_picker/calendar_dialog_view.cpp +++ b/frameworks/core/components_ng/pattern/calendar_picker/calendar_dialog_view.cpp @@ -173,7 +173,7 @@ void CalendarDialogView::CreateChildNode(const RefPtr& contentColumn, renderContext->UpdateBackShadow(shadowTheme->GetShadow(ShadowStyle::OuterDefaultSM, colorMode)); } } - UpdateBackgroundStyle(renderContext, dialogProperties, theme); + UpdateBackgroundStyle(renderContext, dialogProperties, theme, childNode); } void CalendarDialogView::OperationsToPattern( @@ -1007,14 +1007,41 @@ void CalendarDialogView::OnSelectedChangeEvent(int32_t calendarNodeId, const std } void CalendarDialogView::UpdateBackgroundStyle(const RefPtr& renderContext, - const DialogProperties& dialogProperties, const RefPtr& calendarTheme) + const DialogProperties& dialogProperties, const RefPtr& calendarTheme, + const RefPtr& dialogNode) { if (Container::GreatOrEqualAPIVersion(PlatformVersion::VERSION_ELEVEN) && renderContext->IsUniRenderEnabled()) { CHECK_NULL_VOID(calendarTheme); + auto contentRenderContext = dialogNode->GetRenderContext(); + CHECK_NULL_VOID(contentRenderContext); + auto pipeLineContext = dialogNode->GetContext(); + CHECK_NULL_VOID(pipeLineContext); BlurStyleOption styleOption; + if (dialogProperties.blurStyleOption.has_value()) { + styleOption = dialogProperties.blurStyleOption.value(); + if (styleOption.policy == BlurStyleActivePolicy::FOLLOWS_WINDOW_ACTIVE_STATE) { + pipeLineContext->AddWindowFocusChangedCallback(dialogNode->GetId()); + } else { + pipeLineContext->RemoveWindowFocusChangedCallback(dialogNode->GetId()); + } + } styleOption.blurStyle = static_cast( dialogProperties.backgroundBlurStyle.value_or(calendarTheme->GetCalendarPickerDialogBlurStyle())); + if (dialogProperties.blurStyleOption.has_value() && contentRenderContext->GetBackgroundEffect().has_value()) { + contentRenderContext->UpdateBackgroundEffect(std::nullopt); + } renderContext->UpdateBackBlurStyle(styleOption); + if (dialogProperties.effectOption.has_value()) { + if (dialogProperties.effectOption->policy == BlurStyleActivePolicy::FOLLOWS_WINDOW_ACTIVE_STATE) { + pipeLineContext->AddWindowFocusChangedCallback(dialogNode->GetId()); + } else { + pipeLineContext->RemoveWindowFocusChangedCallback(dialogNode->GetId()); + } + if (contentRenderContext->GetBackBlurStyle().has_value()) { + contentRenderContext->UpdateBackBlurStyle(std::nullopt); + } + contentRenderContext->UpdateBackgroundEffect(dialogProperties.effectOption.value()); + } renderContext->UpdateBackgroundColor(dialogProperties.backgroundColor.value_or(Color::TRANSPARENT)); } } diff --git a/frameworks/core/components_ng/pattern/calendar_picker/calendar_dialog_view.h b/frameworks/core/components_ng/pattern/calendar_picker/calendar_dialog_view.h index 61a3a09bf9b9667cf4a85cf0ab28bf0e20e2026c..1f292f5f1b06595403c712e55e371daedcc844ea 100644 --- a/frameworks/core/components_ng/pattern/calendar_picker/calendar_dialog_view.h +++ b/frameworks/core/components_ng/pattern/calendar_picker/calendar_dialog_view.h @@ -96,7 +96,8 @@ private: static void OnSelectedChangeEvent(int32_t calendarNodeId, const std::string& callbackInfo, const DialogEvent& onChange, const CalendarSettingData& settingData); static void UpdateBackgroundStyle(const RefPtr& renderContext, - const DialogProperties& dialogProperties, const RefPtr& calendarTheme); + const DialogProperties& dialogProperties, const RefPtr& calendarTheme, + const RefPtr& dialogNode); static void UpdateButtonStyleAndRole(const std::vector& buttonInfos, size_t index, const RefPtr& buttonLayoutProperty, const RefPtr& buttonRenderContext, const RefPtr& buttonTheme); diff --git a/frameworks/core/components_ng/pattern/dialog/dialog_pattern.cpp b/frameworks/core/components_ng/pattern/dialog/dialog_pattern.cpp index bd4346b8ff15fa264b20971fbc9325f4a5199a9f..d566d51162a4571de33eba6a911fd2eca57ea3f4 100644 --- a/frameworks/core/components_ng/pattern/dialog/dialog_pattern.cpp +++ b/frameworks/core/components_ng/pattern/dialog/dialog_pattern.cpp @@ -331,12 +331,36 @@ void DialogPattern::UpdateContentRenderContext(const RefPtr& contentN auto contentRenderContext = contentNode->GetRenderContext(); CHECK_NULL_VOID(contentRenderContext); contentRenderContext_ = contentRenderContext; + auto pipeLineContext = contentNode->GetContextWithCheck(); + CHECK_NULL_VOID(pipeLineContext); if (Container::GreatOrEqualAPIVersion(PlatformVersion::VERSION_ELEVEN) && contentRenderContext->IsUniRenderEnabled() && props.isSysBlurStyle) { BlurStyleOption styleOption; + if (props.blurStyleOption.has_value()) { + styleOption = props.blurStyleOption.value(); + if (styleOption.policy == BlurStyleActivePolicy::FOLLOWS_WINDOW_ACTIVE_STATE) { + pipeLineContext->AddWindowFocusChangedCallback(contentNode->GetId()); + } else { + pipeLineContext->RemoveWindowFocusChangedCallback(contentNode->GetId()); + } + } styleOption.blurStyle = static_cast( props.backgroundBlurStyle.value_or(dialogTheme_->GetDialogBackgroundBlurStyle())); + if (props.blurStyleOption.has_value() && contentRenderContext->GetBackgroundEffect().has_value()) { + contentRenderContext->UpdateBackgroundEffect(std::nullopt); + } contentRenderContext->UpdateBackBlurStyle(styleOption); + if (props.effectOption.has_value()) { + if (props.effectOption->policy == BlurStyleActivePolicy::FOLLOWS_WINDOW_ACTIVE_STATE) { + pipeLineContext->AddWindowFocusChangedCallback(contentNode->GetId()); + } else { + pipeLineContext->RemoveWindowFocusChangedCallback(contentNode->GetId()); + } + if (contentRenderContext->GetBackBlurStyle().has_value()) { + contentRenderContext->UpdateBackBlurStyle(std::nullopt); + } + contentRenderContext->UpdateBackgroundEffect(props.effectOption.value()); + } contentRenderContext->UpdateBackgroundColor(props.backgroundColor.value_or(dialogTheme_->GetColorBgWithBlur())); } else { contentRenderContext->UpdateBackgroundColor(props.backgroundColor.value_or(dialogTheme_->GetBackgroundColor())); diff --git a/frameworks/core/components_ng/pattern/picker/datepicker_model_ng.cpp b/frameworks/core/components_ng/pattern/picker/datepicker_model_ng.cpp index 3b1547fdb2a0bdd210d75df5b31d3cef18df4199..b76b32a82d1dee59d0fa32f0ce4417f60728948b 100644 --- a/frameworks/core/components_ng/pattern/picker/datepicker_model_ng.cpp +++ b/frameworks/core/components_ng/pattern/picker/datepicker_model_ng.cpp @@ -750,6 +750,12 @@ void DatePickerDialogModelNG::SetDatePickerDialogShow(PickerDialogInfo& pickerDi if (pickerDialog.backgroundBlurStyle.has_value()) { properties.backgroundBlurStyle = pickerDialog.backgroundBlurStyle.value(); } + if (pickerDialog.blurStyleOption.has_value()) { + properties.blurStyleOption = pickerDialog.blurStyleOption.value(); + } + if (pickerDialog.effectOption.has_value()) { + properties.effectOption = pickerDialog.effectOption.value(); + } if (pickerDialog.shadow.has_value()) { properties.shadow = pickerDialog.shadow.value(); } diff --git a/frameworks/core/components_ng/pattern/picker/picker_model.h b/frameworks/core/components_ng/pattern/picker/picker_model.h index 96448210adb80c333162bfdb304b430f840c312d..5ef0afede660040fd0afff7135807aa9262034d0 100644 --- a/frameworks/core/components_ng/pattern/picker/picker_model.h +++ b/frameworks/core/components_ng/pattern/picker/picker_model.h @@ -44,6 +44,8 @@ struct PickerDialogInfo { std::optional maskRect; std::optional backgroundColor; std::optional backgroundBlurStyle; + std::optional blurStyleOption; + std::optional effectOption; std::optional shadow; std::optional hoverModeArea; }; diff --git a/frameworks/core/components_ng/pattern/text_picker/textpicker_model.h b/frameworks/core/components_ng/pattern/text_picker/textpicker_model.h index 71faf47171430fa53043a76a020f8a97db81d1a7..89625ab857658d6fc4b1e70984152f914023c567 100644 --- a/frameworks/core/components_ng/pattern/text_picker/textpicker_model.h +++ b/frameworks/core/components_ng/pattern/text_picker/textpicker_model.h @@ -36,6 +36,8 @@ struct TextPickerDialog { std::optional maskRect; std::optional backgroundColor; std::optional backgroundBlurStyle; + std::optional blurStyleOption; + std::optional effectOption; std::optional shadow; std::optional hoverModeArea; }; diff --git a/frameworks/core/components_ng/pattern/text_picker/textpicker_model_ng.cpp b/frameworks/core/components_ng/pattern/text_picker/textpicker_model_ng.cpp index 957201262fcacd3f9700f2f1065bab15857f22ba..338a0db5dcbff88cdbf2cb4e7235ba1ef39ee31f 100644 --- a/frameworks/core/components_ng/pattern/text_picker/textpicker_model_ng.cpp +++ b/frameworks/core/components_ng/pattern/text_picker/textpicker_model_ng.cpp @@ -55,6 +55,12 @@ void SetDialogProperties(DialogProperties& properties, TextPickerDialog& textPic if (textPickerDialog.backgroundBlurStyle.has_value()) { properties.backgroundBlurStyle = textPickerDialog.backgroundBlurStyle.value(); } + if (textPickerDialog.blurStyleOption.has_value()) { + properties.blurStyleOption = textPickerDialog.blurStyleOption.value(); + } + if (textPickerDialog.effectOption.has_value()) { + properties.effectOption = textPickerDialog.effectOption.value(); + } if (textPickerDialog.shadow.has_value()) { properties.shadow = textPickerDialog.shadow.value(); } diff --git a/frameworks/core/components_ng/pattern/time_picker/timepicker_model_ng.cpp b/frameworks/core/components_ng/pattern/time_picker/timepicker_model_ng.cpp index f4f09dcf03c3cc605d4333c531ec2e705b964707..3556686ac4489a5fa9a37ddbe285ef5f24f16191 100644 --- a/frameworks/core/components_ng/pattern/time_picker/timepicker_model_ng.cpp +++ b/frameworks/core/components_ng/pattern/time_picker/timepicker_model_ng.cpp @@ -508,6 +508,12 @@ void TimePickerDialogModelNG::SetTimePickerDialogShow(PickerDialogInfo& pickerDi if (pickerDialog.backgroundBlurStyle.has_value()) { properties.backgroundBlurStyle = pickerDialog.backgroundBlurStyle.value(); } + if (pickerDialog.blurStyleOption.has_value()) { + properties.blurStyleOption = pickerDialog.blurStyleOption.value(); + } + if (pickerDialog.effectOption.has_value()) { + properties.effectOption = pickerDialog.effectOption.value(); + } if (pickerDialog.shadow.has_value()) { properties.shadow = pickerDialog.shadow.value(); } diff --git a/interfaces/napi/kits/promptaction/prompt_action.cpp b/interfaces/napi/kits/promptaction/prompt_action.cpp index ad8218f9735f012ee5415e30b80562777a40c7b2..bc9df4d877b19499334a58d2a584dc01b5501432 100644 --- a/interfaces/napi/kits/promptaction/prompt_action.cpp +++ b/interfaces/napi/kits/promptaction/prompt_action.cpp @@ -646,6 +646,8 @@ struct PromptAsyncContext { napi_value onWillDismiss = nullptr; napi_value backgroundColorApi = nullptr; napi_value backgroundBlurStyleApi = nullptr; + napi_value blurStyleOptionApi = nullptr; + napi_value effectOptionApi = nullptr; napi_value enableHoverMode = nullptr; napi_value hoverModeAreaApi = nullptr; napi_value borderWidthApi = nullptr; @@ -896,6 +898,42 @@ void GetNapiBlurStyleAndHoverModeProps(napi_env env, const std::shared_ptr& asyncContext, + std::optional& blurStyleOption) +{ + napi_valuetype valueType = napi_undefined; + napi_typeof(env, asyncContext->blurStyleOptionApi, &valueType); + if (valueType == napi_object) { + BlurStyleOption styleOption; + auto delegate = EngineHelper::GetCurrentDelegateSafely(); + if (delegate) { + delegate->GetBackgroundBlurStyleOption(asyncContext->blurStyleOptionApi, styleOption); + } + if (!blurStyleOption.has_value()) { + blurStyleOption.emplace(); + } + blurStyleOption.value() = styleOption; + } +} + +void GetBackgroundEffect( + napi_env env, const std::shared_ptr& asyncContext, std::optional& effectOption) +{ + napi_valuetype valueType = napi_undefined; + napi_typeof(env, asyncContext->effectOptionApi, &valueType); + if (valueType == napi_object) { + EffectOption styleOption; + auto delegate = EngineHelper::GetCurrentDelegateSafely(); + if (delegate) { + delegate->GetBackgroundEffect(asyncContext->effectOptionApi, styleOption); + } + if (!effectOption.has_value()) { + effectOption.emplace(); + } + effectOption.value() = styleOption; + } +} + void CheckNapiDimension(CalcDimension value) { if (value.IsNegative()) { @@ -1329,6 +1367,8 @@ void GetNapiNamedProperties(napi_env env, napi_value* argv, size_t index, napi_get_named_property(env, argv[index], "builder", &asyncContext->builder); napi_get_named_property(env, argv[index], "backgroundColor", &asyncContext->backgroundColorApi); napi_get_named_property(env, argv[index], "backgroundBlurStyle", &asyncContext->backgroundBlurStyleApi); + napi_get_named_property(env, argv[index], "backgroundBlurStyleOptions", &asyncContext->blurStyleOptionApi); + napi_get_named_property(env, argv[index], "backgroundEffect", &asyncContext->effectOptionApi); napi_get_named_property(env, argv[index], "hoverModeArea", &asyncContext->hoverModeAreaApi); napi_get_named_property(env, argv[index], "cornerRadius", &asyncContext->borderRadiusApi); napi_get_named_property(env, argv[index], "borderWidth", &asyncContext->borderWidthApi); @@ -1501,6 +1541,8 @@ napi_value JSPromptShowDialog(napi_env env, napi_callback_info info) std::optional shadowProps; std::optional backgroundColor; std::optional backgroundBlurStyle; + std::optional blurStyleOption; + std::optional effectOption; std::optional hoverModeArea; LevelMode dialogLevelMode = LevelMode::OVERLAY; int32_t dialogLevelUniqueId = -1; @@ -1525,6 +1567,8 @@ napi_value JSPromptShowDialog(napi_env env, napi_callback_info info) napi_get_named_property(env, argv[0], "shadow", &asyncContext->shadowApi); napi_get_named_property(env, argv[0], "backgroundColor", &asyncContext->backgroundColorApi); napi_get_named_property(env, argv[0], "backgroundBlurStyle", &asyncContext->backgroundBlurStyleApi); + napi_get_named_property(env, argv[0], "backgroundBlurStyleOptions", &asyncContext->blurStyleOptionApi); + napi_get_named_property(env, argv[0], "backgroundEffect", &asyncContext->effectOptionApi); napi_get_named_property(env, argv[0], "enableHoverMode", &asyncContext->enableHoverMode); napi_get_named_property(env, argv[0], "hoverModeArea", &asyncContext->hoverModeAreaApi); napi_get_named_property(env, argv[0], "levelMode", &asyncContext->dialogLevelModeApi); @@ -1536,6 +1580,8 @@ napi_value JSPromptShowDialog(napi_env env, napi_callback_info info) backgroundColor = GetColorProps(env, asyncContext->backgroundColorApi); shadowProps = GetShadowProps(env, asyncContext); GetNapiBlurStyleAndHoverModeProps(env, asyncContext, backgroundBlurStyle, hoverModeArea); + GetBackgroundBlurStyleOption(env, asyncContext, blurStyleOption); + GetBackgroundEffect(env, asyncContext, effectOption); if (!ParseButtonsPara(env, asyncContext, SHOW_DIALOG_BUTTON_NUM_MAX, false)) { return nullptr; } @@ -1687,6 +1733,8 @@ napi_value JSPromptShowDialog(napi_env env, napi_callback_info info) .maskRect = maskRect, .backgroundColor = backgroundColor, .backgroundBlurStyle = backgroundBlurStyle, + .blurStyleOption = blurStyleOption, + .effectOption = effectOption, .shadow = shadowProps, .hoverModeArea = hoverModeArea, .onLanguageChange = onLanguageChange, @@ -2131,8 +2179,12 @@ PromptDialogAttr GetPromptActionDialog(napi_env env, const std::shared_ptr maskRect; std::optional backgroundBlurStyle; std::optional hoverModeArea; + std::optional blurStyleOption; + std::optional effectOption; GetNapiDialogProps(env, asyncContext, alignment, offset, maskRect); GetNapiBlurStyleAndHoverModeProps(env, asyncContext, backgroundBlurStyle, hoverModeArea); + GetBackgroundBlurStyleOption(env, asyncContext, blurStyleOption); + GetBackgroundEffect(env, asyncContext, effectOption); auto borderWidthProps = GetBorderWidthProps(env, asyncContext); std::optional borderColorProps; std::optional borderStyleProps; @@ -2159,6 +2211,8 @@ PromptDialogAttr GetPromptActionDialog(napi_env env, const std::shared_ptrhoverModeAreaApi); GetLevelOrderApi(env, arg, asyncContext); + napi_get_named_property(env, arg, "backgroundBlurStyleOptions", &asyncContext->blurStyleOptionApi); + napi_get_named_property(env, arg, "backgroundEffect", &asyncContext->effectOptionApi); napi_get_named_property(env, arg, "levelMode", &asyncContext->dialogLevelModeApi); napi_get_named_property(env, arg, "levelUniqueId", &asyncContext->dialogLevelUniqueId); napi_get_named_property(env, arg, "immersiveMode", &asyncContext->dialogImmersiveModeApi);