fix stepper theme

Signed-off-by: sunfei <sunfei.sun@huawei.com>
Change-Id:  I52bb61f15640fe814f27349aa4c31e34c7bccae3
This commit is contained in:
wangwencong 2021-11-15 17:50:59 +08:00 committed by sunfei
parent 7b61751464
commit bab2d993b9
2 changed files with 10 additions and 1 deletions

View File

@ -54,6 +54,11 @@ void JSStepper::Create(const JSCallbackInfo& info)
stepperComponent->SetButtonPressedHeight(theme->GetButtonPressedHeight());
stepperComponent->SetControlHeight(theme->GetControlHeight());
stepperComponent->SetControlMargin(theme->GetControlMargin());
stepperComponent->SetControlPadding(theme->GetControlPadding());
stepperComponent->SetFocusColor(theme->GetFocusColor());
stepperComponent->SetFocusBorderWidth(theme->GetFocusBorderWidth());
stepperComponent->SetMouseHoverColor(theme->GetMouseHoverColor());
stepperComponent->SetDisabledAlpha(theme->GetDisabledAlpha());
}
ViewStackProcessor::GetInstance()->Push(stepperComponent);
}

View File

@ -35,7 +35,11 @@ void JSStepperItem::Create(const JSCallbackInfo& info)
RefPtr<StepperItemComponent> stepperItemComponent = stepperItemComponentV2->GetStepperItemComponent();
RefPtr<StepperTheme> stepperTheme = GetTheme<StepperTheme>();
if (stepperTheme) {
stepperItemComponent->SetTextStyle(stepperTheme->GetTextStyle());
TextStyle textStyle_ = stepperTheme->GetTextStyle();
textStyle_.SetAdaptTextSize(stepperTheme->GetTextStyle().GetFontSize(), stepperTheme->GetMinFontSize());
textStyle_.SetMaxLines(stepperTheme->GetTextMaxLines());
textStyle_.SetTextOverflow(TextOverflow::ELLIPSIS);
stepperItemComponent->SetTextStyle(textStyle_);
}
auto focusAnimationTheme = GetTheme<FocusAnimationTheme>();
if (focusAnimationTheme) {