[0185] Chat 侧边栏欢迎内容居中偏上调整#3603
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- 将 contentLayout 顶部固定偏移(240px)改为 0,消除硬编码偏移。 - 在 topPanel 内部添加顶部和底部弹性空间(QSpacerItem,stretch 比例 2:1), 利用 Qt 布局自适应能力将欢迎内容推到中心偏上。 - 进入会话模式时,将内部弹性空间收缩为 0,避免挤压消息区域。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- 将 topInnerSpacer_ 的 size hint 从 0 改为 120px,确保小窗口下也有足够顶部偏移。 - 将 inner spacer stretch 比例从 2:1 调整为 1:1,使内容更稳定在 2/5 位置。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- 移除 topPanel 内部的固定/弹性混合 spacer 方案。 - 改为在 resizeEvent 中根据 ChatConversationPanel 当前高度动态计算 topSpacer_ 的固定偏移:height * 2/5 - marginY。 - 确保在不同窗口高度下,欢迎内容始终稳定在容器高度的 2/5 处。 - 进入会话模式时 topSpacer_ 恢复为 8px,不影响消息区域展开。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
将 resizeEvent 中计算顶部偏移的比例从 2/5 调整为 2/7, 使欢迎内容在 Chat 标签页和 dock 侧边栏模式下 都位于容器中心稍稍偏上的位置。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
修改内容
ChatConversationPanel欢迎模式的竖直布局策略,使其在 Chat 标签页和 Chat 侧边栏(dock)模式下都能将"欢迎使用 Liii STEM"和输入框置于容器中心偏上位置。resizeEvent中计算顶部偏移的比例从2/5调整为2/7。实现方式
ChatConversationPanel::resizeEvent(),在欢迎模式下根据面板高度动态计算顶部 spacer 高度,使内容位于容器高度的 2/7 处。topSpacer_收缩为固定小偏移,不影响消息区域展开。测试
qt_chat_tab_widget_test82/82 全部通过。xmake b stem通过。🤖 Generated with Claude Code