fix: handle font change events in dialog#693
Merged
18202781743 merged 1 commit intolinuxdeepin:masterfrom Oct 23, 2025
Merged
Conversation
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
deepin-ci-robot
added a commit
to linuxdeepin/dtk6widget
that referenced
this pull request
Oct 20, 2025
Synchronize source files from linuxdeepin/dtkwidget. Source-pull-request: linuxdeepin/dtkwidget#693
deepin-ci-robot
added a commit
to linuxdeepin/dtk6widget
that referenced
this pull request
Oct 23, 2025
Synchronize source files from linuxdeepin/dtkwidget. Source-pull-request: linuxdeepin/dtkwidget#693
Fix dialog size not updating when system font changes Add font change event handling to recalculate dialog size Ensure proper layout when font size or family changes Influence: 1. Test dialog appearance when system font settings change 2. Verify dialog size adapts correctly to different font sizes 3. Check layout integrity after font changes 4. Test with various font families and sizes fix: 处理对话框中的字体变更事件 修复系统字体变更时对话框大小不更新的问题 添加字体变更事件处理以重新计算对话框大小 确保字体大小或字体家族变更时的正确布局 Influence: 1. 测试系统字体设置变更时对话框的显示效果 2. 验证对话框大小是否正确适应不同的字体大小 3. 检查字体变更后的布局完整性 4. 测试不同字体家族和大小的显示效果 PMS: BUG-331061
Contributor
deepin pr auto review我来对这段代码进行审查和分析。 这段代码是在 DDialog 类的 changeEvent 方法中添加了对字体变化事件的处理。让我们从几个方面来分析:
改进建议: void DDialog::changeEvent(QEvent *event)
{
if (!d) { // 添加安全检查
return DAbstractDialog::changeEvent(event);
}
if (event->type() == QEvent::PaletteChange) {
if (DApplication::dApp()->isDXcbPlatform()) {
DThemeManager::instance()->updateTheme(this);
}
d->updateSize();
} else if (event->type() == QEvent::FontChange) {
// 字体变化时需要更新对话框尺寸以适应新的字体大小
d->updateSize();
}
return DAbstractDialog::changeEvent(event);
}总的来说,这段修改是合理的,它正确地处理了字体变化事件,确保对话框能够适应字体变化。建议添加安全检查和注释来提高代码的健壮性和可维护性。 |
deepin-ci-robot
added a commit
to linuxdeepin/dtk6widget
that referenced
this pull request
Oct 23, 2025
Synchronize source files from linuxdeepin/dtkwidget. Source-pull-request: linuxdeepin/dtkwidget#693
mhduiy
approved these changes
Oct 23, 2025
18202781743
pushed a commit
to linuxdeepin/dtk6widget
that referenced
this pull request
Oct 23, 2025
Synchronize source files from linuxdeepin/dtkwidget. Source-pull-request: linuxdeepin/dtkwidget#693
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix dialog size not updating when system font changes
Add font change event handling to recalculate dialog size
Ensure proper layout when font size or family changes
Influence:
fix: 处理对话框中的字体变更事件
修复系统字体变更时对话框大小不更新的问题
添加字体变更事件处理以重新计算对话框大小
确保字体大小或字体家族变更时的正确布局
Influence:
PMS: BUG-331061