!263 fix:修复安全控件首次弹窗标题换行问题

Merge pull request !263 from Harylee/master
This commit is contained in:
openharmony_ci 2024-06-25 12:48:26 +00:00 committed by Gitee
commit 8ca4074db3
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 13 additions and 6 deletions

View File

@ -251,6 +251,9 @@ export default class Constants {
public static SECURITY_ICON_WIDTH = 48;
public static SECURITY_ICON_HEIGHT = 48;
// header
public static SECURITY_HEADER_MAX_LINES = 2;
////////////////////////////////////////////
// icon of dialog

View File

@ -108,18 +108,22 @@ struct SecurityDialog {
Column() {
Text(this.securityParams[this.index].label)
.textAlign(TextAlign.Center)
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontSize($r('sys.float.ohos_id_text_size_headline8'))
.fontColor($r('sys.color.font_primary'))
.fontSize($r('sys.float.Title_S'))
.fontWeight(FontWeight.Bold)
.lineHeight(Constants.TEXT_LINE_HEIGHT_27)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.maxLines(Constants.SECURITY_HEADER_MAX_LINES)
.minFontSize($r('sys.float.Subtitle_M'))
.maxFontSize($r('sys.float.Title_S'))
.heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST)
}
.height(Constants.HEADLINE_HEIGHT)
.padding({ top: Constants.PADDING_16, bottom: Constants.PADDING_16 })
.justifyContent(FlexAlign.Center)
Text($r(this.securityParams[this.index].description, this.appName))
.textAlign(TextAlign.Start)
.fontColor($r('sys.color.ohos_id_color_text_secondary'))
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.font_primary'))
.fontSize($r('sys.float.Body_L'))
.lineHeight(Constants.TEXT_SMALL_LINE_HEIGHT)
}
}