From bab2d993b9d85fe8b3b15658c350d526cdda7a19 Mon Sep 17 00:00:00 2001 From: wangwencong Date: Mon, 15 Nov 2021 17:50:59 +0800 Subject: [PATCH] fix stepper theme Signed-off-by: sunfei Change-Id: I52bb61f15640fe814f27349aa4c31e34c7bccae3 --- .../bridge/declarative_frontend/jsview/js_stepper.cpp | 5 +++++ .../bridge/declarative_frontend/jsview/js_stepper_item.cpp | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/frameworks/bridge/declarative_frontend/jsview/js_stepper.cpp b/frameworks/bridge/declarative_frontend/jsview/js_stepper.cpp index 3dff58cce53..d863933f160 100644 --- a/frameworks/bridge/declarative_frontend/jsview/js_stepper.cpp +++ b/frameworks/bridge/declarative_frontend/jsview/js_stepper.cpp @@ -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); } diff --git a/frameworks/bridge/declarative_frontend/jsview/js_stepper_item.cpp b/frameworks/bridge/declarative_frontend/jsview/js_stepper_item.cpp index 57bf05db489..4ed865317b7 100644 --- a/frameworks/bridge/declarative_frontend/jsview/js_stepper_item.cpp +++ b/frameworks/bridge/declarative_frontend/jsview/js_stepper_item.cpp @@ -35,7 +35,11 @@ void JSStepperItem::Create(const JSCallbackInfo& info) RefPtr stepperItemComponent = stepperItemComponentV2->GetStepperItemComponent(); RefPtr stepperTheme = GetTheme(); 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(); if (focusAnimationTheme) {