delete navigation.more

Signed-off-by: yuzhicheng <yuzhicheng4@huawei.com>
Change-Id: I837e19e3546bbcda20407873f2bb66adf1fad8de
This commit is contained in:
yuzhicheng 2024-11-15 17:06:01 +08:00
parent bcec66de0f
commit 9a350681ea
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

@ -65,7 +65,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
@ -338,7 +338,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);
@ -557,7 +559,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

@ -342,7 +342,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

@ -163,7 +163,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);