Skip to content

Commit aa10527

Browse files
committed
fix: correct bubble height calc on cold start
1. Replace appIcon.width with appIcon.sourceSize.width for bodyText preferredWidth calculation to avoid layout dependency issues 2. Fix bubble popup position error caused by incorrect width during cold start when icon width is not yet finalized Log: Fix incorrect bubble height calculation causing wrong popup position on cold start fix: 修复冷启动时气泡高度计算错误 1. 将 bodyText 宽度计算中的 appIcon.width 替换为 appIcon.sourceSize.width, 避免依赖未就绪的布局宽度 2. 修复冷启动时图标宽度尚未确定导致气泡弹出位置不正确的问题 Log: 修复冷启动时气泡高度计算错误导致弹出位置偏移的问题 PMS: BUG-362143
1 parent ae3a27b commit aa10527

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

panels/notification/plugin/NotifyItemContent.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ NotifyItem {
278278
id: bodyText
279279
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
280280
// text 宽度若让Layout通过implicitWidth计算会导致ListView的add动画出现位置错误,故这里手动计算Text的宽度
281-
Layout.preferredWidth: NotifyStyle.contentItem.width - appIcon.width
281+
Layout.preferredWidth: NotifyStyle.contentItem.width - appIcon.sourceSize.width
282282
- appIcon.Layout.leftMargin - appIcon.Layout.rightMargin
283283
- contentLayout.Layout.rightMargin - contentLayout.Layout.leftMargin
284284
- (contentIconLoader.active ? (contentIconLoader.width + 1) : 0)

0 commit comments

Comments
 (0)