fix(ui): 预览缩略图尺寸/居中修正;紧凑工具栏保留「AI 生成」文字;README 去除测试版措辞

- 预览卡片 CustomPaint 显式 size=Size.infinite,修正缩略图偏移与不显示
- 圆周缩略图自适应铺满、居中;条形缩略图正常铺满
- 紧凑工具栏 AI 按钮改为带「AI 生成」文字,避免认不出
- README:测试版 -> 正式版 V1.0.0
- 重新构建 dist
This commit is contained in:
呆头鹅
2026-09-18 17:31:44 +08:00
parent 1fc897f551
commit 279cc2318f
3 changed files with 31 additions and 21 deletions
+3 -3
View File
@@ -9,9 +9,9 @@
- **深色 / 浅色双主题**:右上角 ☀ / ☾ 一键切换,语义颜色不变,导出 SVG 与屏幕一致
- **导出 SVG**:矢量、分层、带语义 `id` / `data-*` 元数据,可直接进工艺卡与 MES
## 试用(测试版)
## 正式版 V1.0.0
已按设计文档落地**可运行的 Flutter Windows 桌面测试版**(源码在 `lib/`)。
**可运行的 Flutter Windows 桌面正式版**(源码在 `lib/`),设计人:呆头鹅。
**运行 / 构建**
@@ -63,7 +63,7 @@ scripts\build.bat # 发布版(构建并复制到浅目录 dist
| 路径 | 说明 |
| --- | --- |
| [`lib/`](lib/) | **测试版源码**:模型 / 状态 / 布局 / 渲染 / 导出 / 持久化 / UI |
| [`lib/`](lib/) | **正式版源码**:模型 / 状态 / 布局 / 渲染 / 导出 / 持久化 / UI |
| [`docs/HELP.md`](docs/HELP.md) | 使用帮助:快速开始、界面与侧栏、快捷键、双视图、单位、导出、崩溃恢复 |
| [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) | **架构文档**:模块依赖、数据流、关键算法、性能分析与优化点 |
| [`BUILD-NOTES.md`](BUILD-NOTES.md) | 构建说明与绿盾(透明加密)环境的规避方法 |
+5 -5
View File
@@ -417,9 +417,8 @@ class _AppShellState extends State<AppShell> {
showDialog<void>(context: context, builder: (_) => ActionEditorDialog(controller: c, action: a));
}
}, tooltip: '编辑', color: t.accent),
_iconBtn(t, Icons.auto_awesome, () =>
showDialog<void>(context: context, builder: (_) => AiGenerateDialog(controller: c)),
tooltip: 'AI 生成', color: t.accent2),
// AI 是核心卖点,紧凑布局下也保留「AI 生成」文字,避免认不出。
_aiBtn(t),
const SizedBox(width: 8),
_segmented(t, compact: true),
];
@@ -685,13 +684,14 @@ class _AppShellState extends State<AppShell> {
builder: (_) => AiGenerateDialog(controller: c),
),
icon: const Icon(Icons.auto_awesome, size: 16),
label: const Text('AI 生成', style: TextStyle(fontSize: 11, fontWeight: FontWeight.w600)),
label: const Text('AI 生成', style: TextStyle(fontSize: 12, fontWeight: FontWeight.w700)),
style: FilledButton.styleFrom(
backgroundColor: t.accent2,
foregroundColor: Colors.white,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(9)),
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 10),
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),
minimumSize: const Size(0, 34),
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
),
);
+23 -13
View File
@@ -765,10 +765,14 @@ class _BarPreviewCard extends StatelessWidget {
children: <Widget>[
Text('条形节拍预览(实时联动)', style: TextStyle(color: t.sub, fontSize: 11, fontWeight: FontWeight.w600)),
const SizedBox(height: 10),
SizedBox(
height: project.actions.length * 22.0 + 18,
child: CustomPaint(painter: _MiniBarPainter(project, t)),
),
SizedBox(
width: double.infinity,
height: project.actions.length * 22.0 + 18,
child: CustomPaint(
size: Size.infinite,
painter: _MiniBarPainter(project, t),
),
),
],
),
);
@@ -846,8 +850,12 @@ class _CircularPreviewCard extends StatelessWidget {
Text('圆周节拍预览(实时联动)', style: TextStyle(color: t.sub, fontSize: 11, fontWeight: FontWeight.w600)),
const SizedBox(height: 8),
SizedBox(
width: double.infinity,
height: 250,
child: CustomPaint(painter: _MiniCircularPainter(project, t)),
child: CustomPaint(
size: Size.infinite,
painter: _MiniCircularPainter(project, t),
),
),
Text('12 点钟起始 · 顺时针 · 每层一环', style: TextStyle(color: t.dim, fontSize: 10)),
],
@@ -870,10 +878,12 @@ class _MiniCircularPainter extends CustomPainter {
void paint(Canvas canvas, Size size) {
final Offset c = Offset(size.width / 2, size.height / 2);
final int n = project.actions.length;
final double r0 = 26;
final double pitch = n <= 1 ? 18 : math.min(20, (size.height / 2 - 30 - r0) / (n - 1));
const double pw = 9;
canvas.drawCircle(c, r0 + (n - 1) * pitch + pw + 12, Paint()..color = t.dial);
// 自适应半径:把圆环铺满预览框(顶部为方向箭头预留约 26px)。
final double maxR = math.max(math.min(size.width, size.height) / 2 - 24, 24);
final double r0 = n <= 1 ? maxR * 0.6 : maxR * 0.34;
final double pitch = n <= 1 ? 0 : (maxR - r0) / (n - 1);
final double pw = (pitch == 0 ? 10.0 : pitch * 0.5).clamp(6.0, 13.0);
canvas.drawCircle(c, r0 + (n - 1) * pitch + pw / 2, Paint()..color = t.dial);
for (int i = 0; i < n; i++) {
final Action a = project.actions[i];
final double r = r0 + i * pitch;
@@ -896,11 +906,11 @@ class _MiniCircularPainter extends CustomPainter {
);
}
}
final double tip = r0 + (n - 1) * pitch + pw + 12;
final double tip = r0 + (n - 1) * pitch + pw / 2;
final Path arrow = Path()
..moveTo(c.dx, c.dy - tip - 10)
..lineTo(c.dx - 7, c.dy - tip - 22)
..lineTo(c.dx + 7, c.dy - tip - 22)
..moveTo(c.dx, c.dy - tip - 6)
..lineTo(c.dx - 7, c.dy - tip - 18)
..lineTo(c.dx + 7, c.dy - tip - 18)
..close();
canvas.drawPath(arrow, Paint()..color = t.accent);
final TextPainter tp = TextPainter(