From 279cc2318f1c52118973816eb8b35ba5ff7b8eaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=86=E5=A4=B4=E9=B9=85?= Date: Fri, 18 Sep 2026 17:31:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=E9=A2=84=E8=A7=88=E7=BC=A9=E7=95=A5?= =?UTF-8?q?=E5=9B=BE=E5=B0=BA=E5=AF=B8/=E5=B1=85=E4=B8=AD=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=EF=BC=9B=E7=B4=A7=E5=87=91=E5=B7=A5=E5=85=B7=E6=A0=8F?= =?UTF-8?q?=E4=BF=9D=E7=95=99=E3=80=8CAI=20=E7=94=9F=E6=88=90=E3=80=8D?= =?UTF-8?q?=E6=96=87=E5=AD=97=EF=BC=9BREADME=20=E5=8E=BB=E9=99=A4=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=89=88=E6=8E=AA=E8=BE=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 预览卡片 CustomPaint 显式 size=Size.infinite,修正缩略图偏移与不显示 - 圆周缩略图自适应铺满、居中;条形缩略图正常铺满 - 紧凑工具栏 AI 按钮改为带「AI 生成」文字,避免认不出 - README:测试版 -> 正式版 V1.0.0 - 重新构建 dist --- README.md | 6 +++--- lib/ui/app_shell.dart | 10 +++++----- lib/ui/canvas_overlays.dart | 36 +++++++++++++++++++++++------------- 3 files changed, 31 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 6f3d998..ceb5f5c 100644 --- a/README.md +++ b/README.md @@ -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) | 构建说明与绿盾(透明加密)环境的规避方法 | diff --git a/lib/ui/app_shell.dart b/lib/ui/app_shell.dart index 8cc972f..0cadf6a 100644 --- a/lib/ui/app_shell.dart +++ b/lib/ui/app_shell.dart @@ -417,9 +417,8 @@ class _AppShellState extends State { showDialog(context: context, builder: (_) => ActionEditorDialog(controller: c, action: a)); } }, tooltip: '编辑', color: t.accent), - _iconBtn(t, Icons.auto_awesome, () => - showDialog(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 { 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, ), ), ); diff --git a/lib/ui/canvas_overlays.dart b/lib/ui/canvas_overlays.dart index 45ea43c..8f451cd 100644 --- a/lib/ui/canvas_overlays.dart +++ b/lib/ui/canvas_overlays.dart @@ -765,10 +765,14 @@ class _BarPreviewCard extends StatelessWidget { children: [ 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(