diff --git a/frameworks/core/components_ng/pattern/indexer/indexer_pattern.cpp b/frameworks/core/components_ng/pattern/indexer/indexer_pattern.cpp index f8b9a322598..059e37a5bbf 100644 --- a/frameworks/core/components_ng/pattern/indexer/indexer_pattern.cpp +++ b/frameworks/core/components_ng/pattern/indexer/indexer_pattern.cpp @@ -849,7 +849,7 @@ void IndexerPattern::UpdateBubbleView() auto currentListData = popListData ? popListData(actualChildIndex >= 0 ? actualChildIndex : actualIndex) : std::vector(); UpdateBubbleListView(currentListData); - UpdateBubbleLetterView(!currentListData.empty()); + UpdateBubbleLetterView(!currentListData.empty(), currentListData); auto columnRenderContext = popupNode_->GetRenderContext(); CHECK_NULL_VOID(columnRenderContext); if (Container::GreatOrEqualAPITargetVersion(PlatformVersion::VERSION_TWELVE)) { @@ -953,7 +953,7 @@ void IndexerPattern::UpdateBubbleSize() popupNode_->MarkDirtyNode(); } -void IndexerPattern::UpdateBubbleLetterView(bool showDivider) +void IndexerPattern::UpdateBubbleLetterView(bool showDivider, std::vector& currentListData) { CHECK_NULL_VOID(popupNode_); auto host = GetHost(); @@ -981,8 +981,8 @@ void IndexerPattern::UpdateBubbleLetterView(bool showDivider) ? paintProperty->GetPopupItemBorderRadiusValue() : Dimension(BUBBLE_ITEM_RADIUS, DimensionUnit::VP); letterContext->UpdateBorderRadius({ radius, radius, radius, radius }); - letterNodeRenderContext->UpdateBackgroundColor( - paintProperty->GetPopupTitleBackground().value_or(indexerTheme->GetPopupTitleBackground())); + letterNodeRenderContext->UpdateBackgroundColor(paintProperty->GetPopupTitleBackground().value_or( + currentListData.size() > 0 ? indexerTheme->GetPopupTitleBackground() : Color(POPUP_TITLE_BG_COLOR_SINGLE))); } else { auto bubbleSize = Dimension(BUBBLE_BOX_SIZE, DimensionUnit::VP).ConvertToPx(); letterLayoutProperty->UpdateUserDefinedIdealSize(CalcSize(CalcLength(bubbleSize), CalcLength(bubbleSize))); diff --git a/frameworks/core/components_ng/pattern/indexer/indexer_pattern.h b/frameworks/core/components_ng/pattern/indexer/indexer_pattern.h index 11f8629fcd0..a8b71324aa0 100644 --- a/frameworks/core/components_ng/pattern/indexer/indexer_pattern.h +++ b/frameworks/core/components_ng/pattern/indexer/indexer_pattern.h @@ -142,7 +142,7 @@ private: RefPtr CreatePopupNode(); void UpdateBubbleView(); void UpdateBubbleSize(); - void UpdateBubbleLetterView(bool showDivider); + void UpdateBubbleLetterView(bool showDivider, std::vector& currentListData); void CreateBubbleListView(std::vector& currentListData); void UpdateBubbleListView(std::vector& currentListData); void UpdatePopupOpacity(float ratio); diff --git a/frameworks/core/components_ng/pattern/indexer/indexer_theme.h b/frameworks/core/components_ng/pattern/indexer/indexer_theme.h index 60e2360970a..d657fed5a4e 100644 --- a/frameworks/core/components_ng/pattern/indexer/indexer_theme.h +++ b/frameworks/core/components_ng/pattern/indexer/indexer_theme.h @@ -97,6 +97,7 @@ inline constexpr float BUBBLE_COLLAPSE_LIST_MAX_SIZE = 178.0f; inline constexpr double GRADIENT_COVER_HEIGHT = 16.0; inline constexpr uint32_t INDEXER_BUBBLE_MAXSIZE_COLLAPSED_API_TWELVE = 3; // 2 items + 1 letter inline constexpr float INDEXER_PADDING_TOP_API_TWELVE = 4.0f; +inline constexpr uint32_t POPUP_TITLE_BG_COLOR_SINGLE = 0x00ffffff; enum class AlignStyle { LEFT = 0,