T-573 修复封面画廊候选图宽度

This commit is contained in:
chengma
2026-07-09 15:51:48 +08:00
parent 065ad349de
commit c3c79b63d4
3 changed files with 109 additions and 12 deletions
+10 -2
View File
@@ -3,7 +3,7 @@ id: T-573
title: ②封面画廊候选图横向滚动内容宽度修复
phase: 7
deps: [T-567, T-569]
status: TODO
status: DONE
created: 2026-07-09
---
@@ -65,4 +65,12 @@ T-568/T-569 后封面画廊支持切换任务和重新生成,候选图列表
## 执行记录
(做完在这里写:改了什么文件、跑了什么验证命令及结果、关键决策。)
- 2026-07-09:已完成。
- `app/gui/tabs/generate.py`:`CoverGalleryDialog` 保存 `candidate_scroll` / `candidate_content` 引用,新增 `_sync_candidate_content_size()`;候选图初始化和 `_rebuild_candidate_items()` 后按候选数量、item 宽度、spacing 与 layout sizeHint 同步 content 最小尺寸和实际尺寸,保留横向滚动行为。
- `tests/test_gui.py`:新增多候选图内容宽度测试,以及从少候选任务切换到多候选任务后的宽度重新同步测试。
- 验证通过:
- `py -3.10 -m unittest tests.test_gui`
- `python -m ruff check app tests main.py`
- `py -3.10 -m compileall app main.py`
- `py -3.10 -m unittest discover -s tests`
- `git diff --check`