mirror of
https://github.com/openharmony/ace_ace_engine.git
synced 2026-07-19 14:43:36 -04:00
fix tabbar
Signed-off-by: wzztoone <wangzezhen@huawei.com> Change-Id: Icc4f4cee0206752356b8422e9cb41da0f2e52061
This commit is contained in:
@@ -1438,6 +1438,10 @@ void DOMNode::UpdateBoxComponent()
|
||||
UpdateBoxBorder(borderStyle.border);
|
||||
}
|
||||
auto& backDecoration = declaration_->GetBackDecoration();
|
||||
if (!declaration_->HasBackGroundColor() && boxComponent_->GetBackDecoration() &&
|
||||
boxComponent_->HasBackgroundColor()) {
|
||||
backDecoration->SetBackgroundColor(boxComponent_->GetBackDecoration()->GetBackgroundColor());
|
||||
}
|
||||
auto& backgroundStyle =
|
||||
static_cast<CommonBackgroundStyle&>(declaration_->GetStyle(StyleTag::COMMON_BACKGROUND_STYLE));
|
||||
if (backgroundStyle.IsValid() && backgroundStyle.gradient.IsValid()) {
|
||||
|
||||
@@ -38,6 +38,7 @@ void DOMTabBar::InitializeStyle()
|
||||
}
|
||||
if (boxComponent_) {
|
||||
boxComponent_->SetColor(theme->GetBackgroundColor());
|
||||
boxComponent_->SetHasBackgroundColor(true);
|
||||
}
|
||||
auto paddingDimension = theme->GetPadding();
|
||||
padding_ = Edge(paddingDimension.Value(), 0.0, paddingDimension.Value(), 0.0, paddingDimension.Unit());
|
||||
|
||||
@@ -324,6 +324,16 @@ public:
|
||||
onLongPressId_ = onLongPressId;
|
||||
}
|
||||
|
||||
bool HasBackgroundColor() const
|
||||
{
|
||||
return hasBackgroundColor_;
|
||||
}
|
||||
|
||||
void SetHasBackgroundColor(bool hasBackgroundColor)
|
||||
{
|
||||
hasBackgroundColor_ = hasBackgroundColor;
|
||||
}
|
||||
|
||||
private:
|
||||
RefPtr<Decoration> backDecoration_;
|
||||
RefPtr<Decoration> frontDecoration_;
|
||||
@@ -352,6 +362,7 @@ private:
|
||||
TextDirection inspectorDirection_ { TextDirection::LTR };
|
||||
RefPtr<StateAttributes<BoxStateAttribute>> stateAttributeList_ = nullptr;
|
||||
EventMarker remoteMessageId_;
|
||||
bool hasBackgroundColor_;
|
||||
};
|
||||
|
||||
} // namespace OHOS::Ace
|
||||
|
||||
Reference in New Issue
Block a user