1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_TEXT_FIELD_TEXTFIELD_THEME_H 17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_TEXT_FIELD_TEXTFIELD_THEME_H 18 19 #include "base/geometry/dimension.h" 20 #include "core/components/common/properties/border.h" 21 #include "core/components/common/properties/color.h" 22 #include "core/components/common/properties/edge.h" 23 #include "core/components/common/properties/radius.h" 24 #include "core/components/theme/theme.h" 25 #include "core/components/theme/theme_constants.h" 26 #include "core/components/theme/theme_constants_defines.h" 27 28 namespace OHOS::Ace { 29 30 /** 31 * TextFieldTheme defines color and styles of SliderComponent. TextFieldTheme should be built 32 * using TextFieldTheme::Builder. 33 */ 34 class TextFieldTheme : public virtual Theme { 35 DECLARE_ACE_TYPE(TextFieldTheme, Theme); 36 37 public: 38 class Builder { 39 public: 40 Builder() = default; 41 ~Builder() = default; 42 Build(const RefPtr<ThemeConstants> & themeConstants)43 RefPtr<TextFieldTheme> Build(const RefPtr<ThemeConstants>& themeConstants) const 44 { 45 RefPtr<TextFieldTheme> theme = AceType::Claim(new TextFieldTheme()); 46 if (!themeConstants) { 47 return theme; 48 } 49 // init theme from global data 50 theme->padding_ = Edge(themeConstants->GetDimension(THEME_TEXTFIELD_PADDING_HORIZONTAL), 51 themeConstants->GetDimension(THEME_TEXTFIELD_PADDING_VERTICAL), 52 themeConstants->GetDimension(THEME_TEXTFIELD_PADDING_HORIZONTAL), 53 themeConstants->GetDimension(THEME_TEXTFIELD_PADDING_VERTICAL)); 54 theme->height_ = themeConstants->GetDimension(THEME_TEXTFIELD_HEIGHT); 55 theme->fontSize_ = themeConstants->GetDimension(THEME_TEXTFIELD_FONT_SIZE); 56 theme->fontWeight_ = FontWeight(themeConstants->GetInt(THEME_TEXTFIELD_FONT_WEIGHT)); 57 theme->borderRadius_ = Radius(themeConstants->GetDimension(THEME_TEXTFIELD_BORDER_RADIUS)); 58 59 theme->bgColor_ = themeConstants->GetColor(THEME_TEXTFIELD_BACKGROUND_COLOR); 60 theme->placeholderColor_ = themeConstants->GetColor(THEME_TEXTFIELD_PLACEHOLDER_COLOR); 61 theme->textColor_ = themeConstants->GetColor(THEME_TEXTFIELD_TEXT_COLOR); 62 theme->selectedColor_ = themeConstants->GetColor(THEME_TEXTFIELD_TEXT_SELECTED_COLOR); 63 theme->hoverColor_ = themeConstants->GetColor(THEME_TEXTFIELD_HOVER_COLOR); 64 theme->pressColor_ = themeConstants->GetColor(THEME_TEXTFIELD_PRESS_COLOR); 65 66 theme->focusBgColor_ = themeConstants->GetColor(THEME_TEXTFIELD_FOCUS_BACKGROUND_COLOR); 67 theme->focusPlaceholderColor_ = themeConstants->GetColor(THEME_TEXTFIELD_FOCUS_PLACEHOLDER_COLOR); 68 theme->focusTextColor_ = themeConstants->GetColor(THEME_TEXTFIELD_FOCUS_TEXT_COLOR); 69 70 theme->disableOpacityRatio_ = themeConstants->GetDouble(THEME_TEXTFIELD_DISABLE_OPACITY_RATIO); 71 theme->disableTextColor_ = themeConstants->GetColor(THEME_TEXTFIELD_TEXT_COLOR_DISABLE); 72 73 theme->overHideLength_ = themeConstants->GetDimension(THEME_TEXTFIELD_OVER_HIDE_LENGTH); 74 75 theme->cursorColor_ = themeConstants->GetColor(THEME_TEXTFIELD_CURSOR_COLOR); 76 theme->cursorRadius_ = themeConstants->GetDimension(THEME_TEXTFIELD_CURSOR_RADIUS); 77 theme->needFade_ = static_cast<bool>(themeConstants->GetInt(THEME_TEXTFIELD_NEED_FADE)); 78 79 theme->iconSize_ = themeConstants->GetDimension(THEME_TEXTFIELD_ICON_SIZE); 80 theme->iconHotZoneSize_ = themeConstants->GetDimension(THEME_TEXTFIELD_ICON_HOT_ZONE_SIZE); 81 82 theme->showEllipsis_ = static_cast<bool>(themeConstants->GetInt(THEME_TEXTFIELD_SHOW_ELLIPSIS)); 83 84 theme->errorSpacing_ = themeConstants->GetDimension(THEME_TEXTFIELD_ERROR_SPACING); 85 theme->errorIsInner_ = static_cast<bool>(themeConstants->GetInt(THEME_TEXTFIELD_ERROR_IS_INNER)); 86 theme->errorBorderWidth_ = themeConstants->GetDimension(THEME_TEXTFIELD_ERROR_BORDER_WIDTH); 87 theme->errorBorderColor_ = themeConstants->GetColor(THEME_TEXTFIELD_ERROR_BORDER_COLOR); 88 theme->errorTextStyle_.SetTextColor(themeConstants->GetColor(THEME_TEXTFIELD_ERROR_COLOR)); 89 theme->errorTextStyle_.SetFontSize(themeConstants->GetDimension(THEME_TEXTFIELD_ERROR_FONT_SIZE)); 90 theme->errorTextStyle_.SetFontWeight(FontWeight(themeConstants->GetInt(THEME_TEXTFIELD_ERROR_FONT_WEIGHT))); 91 92 theme->countTextStyle_.SetTextColor(themeConstants->GetColor(THEME_TEXTFIELD_COUNT_TEXT_COLOR)); 93 theme->countTextStyle_.SetFontSize(themeConstants->GetDimension(THEME_TEXTFIELD_COUNT_FONT_SIZE)); 94 theme->countTextStyle_.SetFontWeight( 95 FontWeight(themeConstants->GetInt(THEME_TEXTFIELD_COUNT_FONT_WEIGHT))); 96 theme->overCountStyle_.SetTextColor(themeConstants->GetColor(THEME_TEXTFIELD_OVER_COUNT_TEXT_COLOR)); 97 theme->overCountStyle_.SetFontSize(themeConstants->GetDimension(THEME_TEXTFIELD_OVER_COUNT_FONT_SIZE)); 98 theme->overCountStyle_.SetFontWeight( 99 FontWeight(themeConstants->GetInt(THEME_TEXTFIELD_OVER_COUNT_FONT_WEIGHT))); 100 101 theme->countTextStyleOuter_.SetTextColor(themeConstants->GetColor(THEME_TEXTFIELD_COUNT_TEXT_COLOR)); 102 theme->countTextStyleOuter_.SetFontSize( 103 themeConstants->GetDimension(THEME_TEXTFIELD_COUNT_FONT_SIZE_OUTER)); 104 theme->countTextStyleOuter_.SetFontWeight( 105 FontWeight(themeConstants->GetInt(THEME_TEXTFIELD_COUNT_FONT_WEIGHT))); 106 theme->overCountStyleOuter_.SetTextColor(themeConstants->GetColor(THEME_TEXTFIELD_OVER_COUNT_TEXT_COLOR)); 107 theme->overCountStyleOuter_.SetFontSize( 108 themeConstants->GetDimension(THEME_TEXTFIELD_COUNT_FONT_SIZE_OUTER)); 109 theme->overCountStyleOuter_.SetFontWeight( 110 FontWeight(themeConstants->GetInt(THEME_TEXTFIELD_OVER_COUNT_FONT_WEIGHT))); 111 112 ParsePattern(themeConstants->GetThemeStyle(), theme); 113 return theme; 114 } 115 116 private: ParsePattern(const RefPtr<ThemeStyle> & themeStyle,const RefPtr<TextFieldTheme> & theme)117 void ParsePattern(const RefPtr<ThemeStyle>& themeStyle, const RefPtr<TextFieldTheme>& theme) const 118 { 119 if (!themeStyle || !theme) { 120 return; 121 } 122 auto pattern = themeStyle->GetAttr<RefPtr<ThemeStyle>>("textfield_pattern", nullptr); 123 if (!pattern) { 124 LOGW("find pattern of textfield fail"); 125 return; 126 } 127 const double defaultErrorAlpha = 0.6; 128 const double defaultUnderlineAlpha = 0.6; 129 const double defaultDisableUnderlineAlpha = 0.4; 130 const Color defaultUnderlineColor = Color(0x33182431); 131 const Color defaultUnderlineTextColor = Color(0x99182431); 132 theme->fontSize_ = pattern->GetAttr<Dimension>(PATTERN_TEXT_SIZE, 0.0_fp); 133 theme->textColor_ = pattern->GetAttr<Color>(PATTERN_TEXT_COLOR, Color()); 134 theme->focusTextColor_ = pattern->GetAttr<Color>(PATTERN_TEXT_COLOR_FOCUSED, Color()); 135 theme->placeholderColor_ = pattern->GetAttr<Color>("tips_text_color", Color()); 136 theme->focusPlaceholderColor_ = pattern->GetAttr<Color>("tips_text_color_focused", Color()); 137 theme->bgColor_ = pattern->GetAttr<Color>(PATTERN_BG_COLOR, Color()); 138 theme->focusBgColor_ = pattern->GetAttr<Color>(PATTERN_BG_COLOR_FOCUSED, Color()); 139 // color of error border blend 60% opacity 140 theme->errorBorderColor_ = pattern->GetAttr<Color>("error_text_border_color", Color()) 141 .BlendOpacity(pattern->GetAttr<double>("error_text_border_color_alpha", defaultErrorAlpha)); 142 theme->errorUnderlineColor_ = pattern->GetAttr<Color>(ERROR_UNDERLINE_COLOR, Color()); 143 theme->underlineColor_ = pattern->GetAttr<Color>(UNDERLINE_COLOR, defaultUnderlineColor); 144 theme->disableUnderlineColor_ = pattern->GetAttr<Color>(UNDERLINE_COLOR, defaultUnderlineColor) 145 .BlendOpacity(pattern->GetAttr<double>(DISABLE_UNDERLINE_ALPHA, defaultDisableUnderlineAlpha)); 146 theme->underlineTextColor_ = pattern->GetAttr<Color>(UNDERLINE_TEXT_COLOR, defaultUnderlineTextColor); 147 theme->underlineFontSize_ = pattern->GetAttr<Dimension>(UNDERLINE_FONT_SIZE, 0.0_fp); 148 theme->errorTextStyle_.SetTextColor(pattern->GetAttr<Color>(ERROR_UNDERLINE_TEXT_COLOR, Color())); 149 theme->errorTextStyle_.SetFontSize(pattern->GetAttr<Dimension>(ERROR_UNDERLINE_TEXT_SIZE, 0.0_fp)); 150 151 theme->countTextStyle_.SetTextColor(pattern->GetAttr<Color>("count_text_color", Color())); 152 theme->countTextStyle_.SetFontSize(pattern->GetAttr<Dimension>("count_text_font_size", 0.0_fp)); 153 theme->overCountStyle_.SetTextColor(pattern->GetAttr<Color>("over_text_color", Color())); 154 theme->overCountStyle_.SetFontSize(pattern->GetAttr<Dimension>("over_text_font_size", 0.0_fp)); 155 156 theme->countTextStyleOuter_.SetTextColor(pattern->GetAttr<Color>("count_outer_text_color", Color())); 157 theme->countTextStyleOuter_.SetFontSize( 158 pattern->GetAttr<Dimension>("count_outer_text_font_size", 0.0_fp)); 159 theme->overCountStyleOuter_.SetTextColor(pattern->GetAttr<Color>("over_outer_text_color", Color())); 160 theme->overCountStyleOuter_.SetFontSize( 161 pattern->GetAttr<Dimension>("over_outer_text_font_size", 0.0_fp)); 162 theme->overCountTextStyle_.SetTextColor(pattern->GetAttr<Color>(OVER_COUNT_TEXT_COLOR, Color())); 163 theme->overCountTextStyle_.SetFontSize(pattern->GetAttr<Dimension>(OVER_COUNT_TEXT_FONT_SIZE, 0.0_fp)); 164 theme->selectedColor_ = pattern->GetAttr<Color>(PATTERN_BG_COLOR_SELECTED, Color()); 165 theme->disableTextColor_ = pattern->GetAttr<Color>(PATTERN_TEXT_COLOR_DISABLED, Color()); 166 theme->underlineActivedColor_ = pattern->GetAttr<Color>(PATTERN_UNDERLINE_ACTIVED_COLOR, Color()) 167 .BlendOpacity(pattern->GetAttr<double>(UNDERLINE_COLOR_ALPHA, defaultUnderlineAlpha)); 168 theme->underlineTypingColor_ = pattern->GetAttr<Color>(PATTERN_UNDERLINE_TYPING_COLOR, Color()) 169 .BlendOpacity(pattern->GetAttr<double>(UNDERLINE_COLOR_ALPHA, defaultUnderlineAlpha)); 170 theme->textColorDisable_ = pattern->GetAttr<Color>(PATTERN_DISABLED_TEXT_COLOR, Color()); 171 theme->cursorColor_ = pattern->GetAttr<Color>("cursor_color", Color()); 172 theme->cursorWidth_ = pattern->GetAttr<Dimension>("cursor_width", 1.5_vp); 173 theme->hoverColor_ = pattern->GetAttr<Color>(PATTERN_BG_COLOR_HOVERED, Color()); 174 theme->pressColor_ = pattern->GetAttr<Color>(PATTERN_BG_COLOR_PRESSED, Color()); 175 theme->borderRadiusSize_ = Radius(pattern->GetAttr<Dimension>(BORDER_RADIUS_SIZE, 20.0_vp)); 176 theme->disabledIconFillColor_ = theme->bgColor_.BlendOpacity(theme->disableOpacityRatio_); 177 theme->passwordErrorTextColor_ = pattern->GetAttr<Color>(PATTERN_TEXT_COLOR, Color()); 178 theme->passwordErrorInputColor_ = pattern->GetAttr<Color>(ERROR_PASSWORD_INPUT_COLOR, Color()); 179 theme->passwordErrorBorderColor_ = pattern->GetAttr<Color>(ERROR_PASSWORD_BORDER_COLOR, Color()) 180 .BlendOpacity(pattern->GetAttr<double>(ERROR_PASSWORD_BORDER_ALPHA, defaultErrorAlpha)); 181 theme->passwordErrorLableColor_ = pattern->GetAttr<Color>(ERROR_PASSWORD_TEXT_COLOR, Color()); 182 theme->overCountBorderColor_ = pattern->GetAttr<Color>(OVER_COUNT_BORDER_COLOR, Color()) 183 .BlendOpacity(pattern->GetAttr<double>(OVER_COUNT_BORDER_COLOR_ALPHA, defaultErrorAlpha)); 184 theme->inlineTextColor_ = pattern->GetAttr<Color>(INLINE_TEXT_COLOR, Color()); 185 theme->inlineRadiusSize_ = Radius(pattern->GetAttr<Dimension>(INLINE_RADIUS_SIZE, 4.0_vp)); 186 theme->inlineBgColor_ = pattern->GetAttr<Color>(INLINE_BG_COLOR, Color()); 187 theme->inlineBorderColor_ = pattern->GetAttr<Color>(INLINE_BORDER_COLOR, Color()); 188 auto draggable = pattern->GetAttr<std::string>("draggable", "0"); 189 theme->draggable_ = StringUtils::StringToInt(draggable); 190 } 191 }; 192 193 ~TextFieldTheme() override = default; 194 GetPadding()195 const Edge& GetPadding() const 196 { 197 return padding_; 198 } 199 GetHeight()200 const Dimension& GetHeight() const 201 { 202 return height_; 203 } 204 GetFontSize()205 const Dimension& GetFontSize() const 206 { 207 return fontSize_; 208 } 209 GetUnderlineFontSize()210 const Dimension& GetUnderlineFontSize() const 211 { 212 return underlineFontSize_; 213 } 214 GetFontWeight()215 const FontWeight& GetFontWeight() const 216 { 217 return fontWeight_; 218 } 219 GetBorderRadius()220 const Radius& GetBorderRadius() const 221 { 222 return borderRadius_; 223 } 224 GetBgColor()225 const Color& GetBgColor() const 226 { 227 return bgColor_; 228 } 229 GetPlaceholderColor()230 const Color& GetPlaceholderColor() const 231 { 232 return placeholderColor_; 233 } 234 GetFocusBgColor()235 const Color& GetFocusBgColor() const 236 { 237 return focusBgColor_; 238 } 239 GetFocusPlaceholderColor()240 const Color& GetFocusPlaceholderColor() const 241 { 242 return focusPlaceholderColor_; 243 } 244 GetFocusTextColor()245 const Color& GetFocusTextColor() const 246 { 247 return focusTextColor_; 248 } 249 GetTextColor()250 const Color& GetTextColor() const 251 { 252 return textColor_; 253 } 254 GetDisableTextColor()255 const Color& GetDisableTextColor() const 256 { 257 return disableTextColor_; 258 } 259 GetTextColorDisable()260 const Color& GetTextColorDisable() const 261 { 262 return textColorDisable_; 263 } 264 GetUnderlineActivedColor()265 const Color& GetUnderlineActivedColor() const 266 { 267 return underlineActivedColor_; 268 } 269 GetUnderlineTypingColor()270 const Color& GetUnderlineTypingColor() const 271 { 272 return underlineTypingColor_; 273 } 274 GetSelectedColor()275 const Color& GetSelectedColor() const 276 { 277 return selectedColor_; 278 } 279 GetHoverColor()280 const Color& GetHoverColor() const 281 { 282 return hoverColor_; 283 } 284 GetPressColor()285 const Color& GetPressColor() const 286 { 287 return pressColor_; 288 } 289 GetBorderRadiusSize()290 const Radius& GetBorderRadiusSize() const 291 { 292 return borderRadiusSize_; 293 } 294 GetDisableOpacityRatio()295 double GetDisableOpacityRatio() const 296 { 297 return disableOpacityRatio_; 298 } 299 GetDisabledIconFillColor()300 const Color& GetDisabledIconFillColor() const 301 { 302 return disabledIconFillColor_; 303 } 304 GetOverHideLength()305 const Dimension& GetOverHideLength() const 306 { 307 return overHideLength_; 308 } 309 GetCursorColor()310 const Color& GetCursorColor() const 311 { 312 return cursorColor_; 313 } 314 GetCursorRadius()315 const Dimension& GetCursorRadius() const 316 { 317 return cursorRadius_; 318 } 319 GetCursorWidth()320 const Dimension& GetCursorWidth() const 321 { 322 return cursorWidth_; 323 } 324 NeedFade()325 bool NeedFade() const 326 { 327 return needFade_; 328 } 329 GetIconSize()330 const Dimension& GetIconSize() const 331 { 332 return iconSize_; 333 } 334 GetIconHotZoneSize()335 const Dimension& GetIconHotZoneSize() const 336 { 337 return iconHotZoneSize_; 338 } 339 ShowEllipsis()340 bool ShowEllipsis() const 341 { 342 return showEllipsis_; 343 } 344 GetErrorSpacing()345 const Dimension& GetErrorSpacing() const 346 { 347 return errorSpacing_; 348 } 349 GetErrorIsInner()350 bool GetErrorIsInner() const 351 { 352 return errorIsInner_; 353 } 354 GetErrorBorderWidth()355 const Dimension& GetErrorBorderWidth() const 356 { 357 return errorBorderWidth_; 358 } 359 GetErrorBorderColor()360 const Color& GetErrorBorderColor() const 361 { 362 return errorBorderColor_; 363 } 364 GetErrorUnderlineColor()365 const Color& GetErrorUnderlineColor() const 366 { 367 return errorUnderlineColor_; 368 } 369 GetUnderlineColor()370 const Color& GetUnderlineColor() const 371 { 372 return underlineColor_; 373 } 374 GetDisableUnderlineColor()375 const Color& GetDisableUnderlineColor() const 376 { 377 return disableUnderlineColor_; 378 } 379 GetUnderlineTextColor()380 const Color& GetUnderlineTextColor() const 381 { 382 return underlineTextColor_; 383 } 384 GetOverCountBorderColor()385 const Color& GetOverCountBorderColor() const 386 { 387 return overCountBorderColor_; 388 } 389 GetErrorTextStyle()390 const TextStyle& GetErrorTextStyle() const 391 { 392 return errorTextStyle_; 393 } 394 GetCountTextStyle()395 const TextStyle& GetCountTextStyle() const 396 { 397 return countTextStyle_; 398 } 399 GetOverCountStyle()400 const TextStyle& GetOverCountStyle() const 401 { 402 return overCountStyle_; 403 } 404 GetCountTextStyleOuter()405 const TextStyle& GetCountTextStyleOuter() const 406 { 407 return countTextStyleOuter_; 408 } 409 GetOverCountStyleOuter()410 const TextStyle& GetOverCountStyleOuter() const 411 { 412 return overCountStyleOuter_; 413 } 414 GetPasswordErrorTextColor()415 const Color& GetPasswordErrorTextColor() const 416 { 417 return passwordErrorTextColor_; 418 } 419 GetPasswordErrorInputColor()420 const Color& GetPasswordErrorInputColor() const 421 { 422 return passwordErrorInputColor_; 423 } 424 GetPasswordErrorBorderColor()425 const Color& GetPasswordErrorBorderColor() const 426 { 427 return passwordErrorBorderColor_; 428 } 429 GetPasswordErrorLableColor()430 const Color& GetPasswordErrorLableColor() const 431 { 432 return passwordErrorLableColor_; 433 } 434 GetOverCountTextStyle()435 const TextStyle& GetOverCountTextStyle() const 436 { 437 return overCountTextStyle_; 438 } 439 GetInlineTextColor()440 const Color& GetInlineTextColor() const 441 { 442 return inlineTextColor_; 443 } 444 GetInlineRadiusSize()445 const Radius& GetInlineRadiusSize() const 446 { 447 return inlineRadiusSize_; 448 } 449 GetInlineBgColor()450 const Color& GetInlineBgColor() const 451 { 452 return inlineBgColor_; 453 } 454 GetInlineBorderColor()455 const Color& GetInlineBorderColor() const 456 { 457 return inlineBorderColor_; 458 } 459 GetInlineBorderWidth()460 const Dimension& GetInlineBorderWidth() const 461 { 462 return inlineBorderWidth_; 463 } 464 GetDraggable()465 bool GetDraggable() const 466 { 467 return draggable_; 468 } 469 470 protected: 471 TextFieldTheme() = default; 472 473 private: 474 Edge padding_; 475 Dimension height_; 476 Dimension fontSize_; 477 Dimension underlineFontSize_; 478 FontWeight fontWeight_ = FontWeight::NORMAL; 479 Radius borderRadius_; 480 481 Color bgColor_; 482 Radius borderRadiusSize_; 483 Color placeholderColor_; 484 Color focusBgColor_; 485 Color focusPlaceholderColor_; 486 Color focusTextColor_; 487 Color textColor_; 488 Color disableTextColor_; 489 Color underlineActivedColor_; 490 Color underlineTypingColor_; 491 Color textColorDisable_; 492 Color selectedColor_; 493 Color hoverColor_; 494 Color pressColor_; 495 Color disabledIconFillColor_; 496 Dimension errorSpacing_; 497 bool errorIsInner_ = false; 498 Dimension errorBorderWidth_; 499 Color errorBorderColor_; 500 Color overCountBorderColor_; 501 Color errorUnderlineColor_; 502 Color underlineColor_; 503 Color disableUnderlineColor_; 504 Color underlineTextColor_; 505 Color passwordErrorTextColor_; 506 Color passwordErrorInputColor_; 507 Color passwordErrorBorderColor_; 508 Color passwordErrorLableColor_; 509 TextStyle errorTextStyle_; 510 TextStyle countTextStyle_; 511 TextStyle overCountStyle_; 512 TextStyle countTextStyleOuter_; 513 TextStyle overCountStyleOuter_; 514 TextStyle overCountTextStyle_; 515 Color inlineTextColor_; 516 Radius inlineRadiusSize_; 517 Color inlineBgColor_; 518 Color inlineBorderColor_; 519 520 // UX::disable state: opacity is set to 38% of the default 521 double disableOpacityRatio_ = 1.0; 522 523 // UX::over length state 524 Dimension overHideLength_; 525 526 // UX::cursor state cursor-color=#000000, cursor blur-radius=0.9, cursor-width=2, cursor-height=24, cursor-radius=1 527 Color cursorColor_; 528 Dimension cursorRadius_; 529 Dimension cursorWidth_; 530 bool needFade_ = false; 531 532 // UX::icon size = 24, hotZoneSize = 36 533 Dimension iconSize_; 534 Dimension iconHotZoneSize_; 535 Dimension inlineBorderWidth_ = 2.0_vp; 536 537 bool showEllipsis_ = true; 538 bool draggable_ = false; 539 }; 540 541 } // namespace OHOS::Ace 542 543 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_TEXT_FIELD_TEXTFIELD_THEME_H 544