!48647 [Bug]: 删除navigation.more字符串

Merge pull request !48647 from yuzhicheng/moreMessage
This commit is contained in:
openharmony_ci 2024-11-20 04:21:15 +00:00 committed by Gitee
commit 87c0500536
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
6 changed files with 17 additions and 6 deletions

View File

@ -84,6 +84,7 @@ static const std::set<std::string> stringAttrs = {
"dialog_icon_primary",
"dialog_font_primary",
"menu_has_filter",
"navigation_general_more",
"calendar_picker_dialog_button_transparent",
"calendar_picker_dialog_divider_transparent",
"textfield_accessibility_property_clear",

View File

@ -84,6 +84,7 @@ public:
theme->navBarUnfocusColor_ = pattern->GetAttr<Color>("color_panel_bg", Color::TRANSPARENT);
theme->titlebarBackgroundBlurStyle_ = pattern->GetAttr<int>("titlebar_background_blur_style", 0);
theme->toolbarBackgroundBlurStyle_ = pattern->GetAttr<int>("toolbar_background_blur_style", 0);
theme->moreMessage_ = pattern->GetAttr<std::string>("navigation_general_more", "null");
}
ParsePattern(themeConstants, theme);
return theme;
@ -585,6 +586,10 @@ public:
{
return dividerGradientDarkBlue_;
}
const std::string& GetMoreMessage() const
{
return moreMessage_;
}
protected:
NavigationBarTheme() = default;
@ -647,6 +652,7 @@ private:
Dimension toolbarItemBottomPadding_ = 4.0_vp;
Dimension toolbarItemMargin_ = 4.0_vp;
Dimension toolbarItemSpecialMargin_ = 0.0_vp;
std::string moreMessage_ = "";
uint32_t toolbarLimitGridCount_ = 8;
uint32_t dividerShadowEnable_ = 0;
Color navigationDividerColor_;

View File

@ -195,7 +195,7 @@ RefPtr<FrameNode> CreateMenuItems(const int32_t menuNodeId, const std::vector<NG
NavigationTitleUtil::InitTitleBarButtonEvent(menuItemNode, iconNode, true);
// read navigation "more" button
std::string message = Localization::GetInstance()->GetEntryLetters("navigation.more");
std::string message = theme->GetMoreMessage();
NavigationTitleUtil::SetAccessibility(menuItemNode, message);
// set navigation titleBar "more" button inspectorId

View File

@ -66,7 +66,7 @@ bool NavigationTitleUtil::BuildMoreButton(bool isButtonEnabled, const RefPtr<Nav
InitTitleBarButtonEvent(menuItemNode, iconNode, true);
// read navdestination "more" button
std::string message = Localization::GetInstance()->GetEntryLetters("navigation.more");
std::string message = theme ? theme->GetMoreMessage() : "";
SetAccessibility(menuItemNode, message);
// set navdestination titleBar "more" button inspectorId
@ -344,7 +344,9 @@ void NavigationTitleUtil::InitTitleBarButtonEvent(const RefPtr<FrameNode>& butto
auto targetNode = weakTargetNode.Upgrade();
CHECK_NULL_VOID(targetNode);
auto popupParam = AceType::MakeRefPtr<PopupParam>();
popupParam->SetMessage(Localization::GetInstance()->GetEntryLetters("common.more"));
auto theme = NavigationGetTheme();
CHECK_NULL_VOID(theme);
popupParam->SetMessage(theme->GetMoreMessage());
popupParam->SetIsShow(isHover);
popupParam->SetBlockEvent(false);
ViewAbstract::BindPopup(popupParam, targetNode, nullptr);
@ -498,7 +500,7 @@ RefPtr<FrameNode> NavigationTitleUtil::CreatePopupDialogNode(
if (barItemNode->IsMoreItemNode()) {
auto theme = NavigationGetTheme();
CHECK_NULL_RETURN(theme, nullptr);
message = Localization::GetInstance()->GetEntryLetters("common.more");
message = theme->GetMoreMessage();
if (message.empty()) {
message = accessibilityProperty->GetAccessibilityText();
}

View File

@ -343,7 +343,9 @@ void BuildToolbarMoreItemNode(const RefPtr<BarItemNode>& barItemNode, bool enabl
} else {
BuildImageToolbarMoreItemNode(barItemNode, enabled);
}
auto textNode = CreateToolbarItemTextNode(Localization::GetInstance()->GetEntryLetters("common.more"));
auto theme = NavigationGetTheme();
CHECK_NULL_VOID(theme);
auto textNode = CreateToolbarItemTextNode(theme->GetMoreMessage());
CHECK_NULL_VOID(textNode);
barItemNode->SetTextNode(textNode);
barItemNode->SetBarItemUsedInToolbarConfiguration(true);

View File

@ -164,7 +164,7 @@ void NavToolbarPattern::ShowDialogWithNode(const RefPtr<BarItemNode>& barItemNod
if (barItemNode->IsMoreItemNode()) {
auto theme = NavigationGetTheme();
CHECK_NULL_VOID(theme);
message = Localization::GetInstance()->GetEntryLetters("common.more");
message = theme->GetMoreMessage();
if (AceApplicationInfo::GetInstance().GreatOrEqualTargetAPIVersion(PlatformVersion::VERSION_TWELVE)) {
auto symbolNode = AceType::DynamicCast<FrameNode>(barItemNode->GetFirstChild());
CHECK_NULL_VOID(symbolNode);