!46973 Popup适配预览器

Merge pull request !46973 from Zhang Jinyu/popup
This commit is contained in:
openharmony_ci 2024-10-30 02:01:32 +00:00 committed by Gitee
commit cb7ddba319
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 24 additions and 4 deletions

View File

@ -679,7 +679,12 @@ export class PopupComponent extends ViewPU {
n28 = 400;
}
else {
n28 = px2vp(o28.width);
if (o28.width != 0) {
n28 = px2vp(o28.width);
} else {
// The previewer does not support the display interface to use abnormal values
n28 = -1;
}
}
n28 -= (this.theme.windows.padding.start.value - (this.theme.button.margin.end.value / 2));
n28 -= this.theme.windows.padding.end.value;
@ -826,7 +831,12 @@ export class PopupComponent extends ViewPU {
e28 = 400;
}
else {
e28 = px2vp(h28.width);
if (h28.width != 0) {
e28 = px2vp(h28.width);
} else {
// The previewer does not support the display interface to use abnormal values
e28 = -1;
}
}
if (px2vp(h28.height) > 480) {
f28 = 480;

View File

@ -367,7 +367,12 @@ export struct PopupComponent {
if (px2vp(defaultDisplaySync.width) > 400) {
textMaxWeight = 400
} else {
textMaxWeight = px2vp(defaultDisplaySync.width)
if (defaultDisplaySync.width != 0) {
textMaxWeight = px2vp(defaultDisplaySync.width)
} else {
// The previewer does not support the display interface to use abnormal values
textMaxWeight = -1
}
}
textMaxWeight -= (this.theme.windows.padding.start.value - (this.theme.button.margin.end.value / 2))
textMaxWeight -= this.theme.windows.padding.end.value
@ -511,7 +516,12 @@ export struct PopupComponent {
if (px2vp(defaultDisplaySync.width) > 400) {
applyMaxWidth = 400
} else {
applyMaxWidth = px2vp(defaultDisplaySync.width)
if (defaultDisplaySync.width != 0) {
applyMaxWidth = px2vp(defaultDisplaySync.width)
} else {
// The previewer does not support the display interface to use abnormal values
applyMaxWidth = -1
}
}
if (px2vp(defaultDisplaySync.height) > 480) {
applyMaxHeight = 480