mirror of
https://github.com/openharmony/applications_systemui.git
synced 2026-07-19 19:44:41 -04:00
!209 SystemUI状态栏人因布局需求
Merge pull request !209 from lijinfengde123/master
This commit is contained in:
@@ -23,7 +23,7 @@ export class CommonStyle {
|
||||
statusBarFontSize: Length = deviceTypeInfo === 'phone' ? '12fp' : '16fp';
|
||||
statusBarIconWidth: Length = '24vp';
|
||||
statusBarIconHeight: Length = '24vp';
|
||||
statusBarMarginLeftRight: Length = deviceTypeInfo === 'phone' ? '0vp' : '5vp';
|
||||
statusBarMarginLeftRight: Length = deviceTypeInfo === 'phone' ? '0vp' : $r("app.float.status_bar_margin_left_right");
|
||||
deviceTypeInfo = deviceTypeInfo;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ export default struct MetaIconItemComponent {
|
||||
Row() {
|
||||
if ((this.mItemData.get().isShowLabel && !CheckEmptyUtils.isEmpty(this.mItemData.get().label))
|
||||
|| (this.mItemData.get().isShowIcon && !CheckEmptyUtils.isEmpty(this.mItemData.get().iconUrl))) {
|
||||
Row().width(this.style.stackPadding).height('100%')
|
||||
Row().width(this.styleCommon.statusBarMarginLeftRight).height('100%')
|
||||
}
|
||||
if (this.mItemData.get().isShowLabel && !CheckEmptyUtils.isEmpty(this.mItemData.get().label)) {
|
||||
Text(this.mItemData.get()
|
||||
@@ -77,7 +77,7 @@ export default struct MetaIconItemComponent {
|
||||
}
|
||||
if ((this.mItemData.get().isShowLabel && !CheckEmptyUtils.isEmpty(this.mItemData.get().label))
|
||||
|| (this.mItemData.get().isShowIcon && !CheckEmptyUtils.isEmpty(this.mItemData.get().iconUrl))) {
|
||||
Row().width(this.style.stackPadding).height('100%')
|
||||
Row().width(this.styleCommon.statusBarMarginLeftRight).height('100%')
|
||||
}
|
||||
}.height('100%')
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@ export default struct PluginIconItemComponent {
|
||||
build() {
|
||||
Row() {
|
||||
if (this.mPluginData.template && this.mPluginData.data && Object.keys(this.mPluginData.data).length > 0) {
|
||||
Row().width(this.styleCommon.statusBarMarginLeftRight).height('100%')
|
||||
PluginComponent({
|
||||
template: this.mPluginData.template,
|
||||
data: this.mPluginData.data
|
||||
@@ -81,6 +82,7 @@ export default struct PluginIconItemComponent {
|
||||
Log.showInfo(TAG, `PluginComponent.Error code:${errcode} message:${msg}`)
|
||||
})
|
||||
.size({ width: px2vp(this.style.iconWidth), height: '100%' })
|
||||
Row().width(this.styleCommon.statusBarMarginLeftRight).height('100%')
|
||||
}
|
||||
}.height('100%')
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ export default struct StatusBarComponent {
|
||||
private moduleName: string = ''
|
||||
|
||||
aboutToAppear() {
|
||||
AppStorage.SetOrCreate('size', $r("app.float.status_bar_margin_left_right"));
|
||||
Log.showInfo(TAG, `aboutToAppear Start, mStatusBarComponentConfig: ${JSON.stringify(this.mStatusBarComponentConfig)}`);
|
||||
this.initViewModel(this.moduleName);
|
||||
}
|
||||
@@ -239,7 +240,7 @@ struct VerticalStatusBarItemLoadComponent {
|
||||
@Component
|
||||
struct StatusBarItemLoadComponent {
|
||||
private mComponentName: string
|
||||
|
||||
@StorageLink('size') size: any=''
|
||||
aboutToAppear() {
|
||||
Log.showInfo(TAG_StatusBarItemLoadComponent, `aboutToAppear, mComponentName: ${this.mComponentName} `)
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ export class StyleManager extends BaseStyleManager {
|
||||
style.statusBarFontSize = this.calcScaleSizePx(14);
|
||||
style.statusBarIconWidth = this.calcScaleSizePx(20);
|
||||
style.statusBarIconHeight = this.calcScaleSizePx(20);
|
||||
style.statusBarMarginLeftRight = this.calcScaleSizePx(10);
|
||||
style.statusBarMarginLeftRight = $r("app.float.status_bar_margin_left_right");
|
||||
}
|
||||
|
||||
// StatusBar-VerticalStatusBarItemLoadComponent
|
||||
|
||||
@@ -143,6 +143,10 @@
|
||||
{
|
||||
"name": "signal_component_text_margin_left",
|
||||
"value": "3vp"
|
||||
},
|
||||
{
|
||||
"name": "status_bar_margin_left_right",
|
||||
"value": "6vp"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"float": [
|
||||
{
|
||||
"name": "status_bar_margin_left_right",
|
||||
"value": "3vp"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,5 +1,9 @@
|
||||
{
|
||||
"float": [
|
||||
{
|
||||
"name": "status_bar_margin_left_right",
|
||||
"value": "5vp"
|
||||
},
|
||||
{
|
||||
"name": "status_bar_height",
|
||||
"value": "46vp"
|
||||
|
||||
@@ -143,6 +143,10 @@
|
||||
{
|
||||
"name": "battery_component_margin",
|
||||
"value": "2vp"
|
||||
},
|
||||
{
|
||||
"name": "status_bar_margin_left_right",
|
||||
"value": "5vp"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user