fix(ui): 预览缩略图尺寸/居中修正;紧凑工具栏保留「AI 生成」文字;README 去除测试版措辞
- 预览卡片 CustomPaint 显式 size=Size.infinite,修正缩略图偏移与不显示 - 圆周缩略图自适应铺满、居中;条形缩略图正常铺满 - 紧凑工具栏 AI 按钮改为带「AI 生成」文字,避免认不出 - README:测试版 -> 正式版 V1.0.0 - 重新构建 dist
This commit is contained in:
@@ -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
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user