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
+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(