fix(ui): 同泳道依赖改水平连线;圆周依赖标签沿弧显示;导出改独立按钮;换道高亮目标泳道
- 同泳道依赖:源/目标同 y 时水平直线连接,标签置于线上方,不再压住箭头/色块 - 圆周依赖标签改用沿弧文字(与动作名一致),不再显示为竖直矩形 - 紧凑工具栏导出恢复为「导出 SVG / 导出 PNG」两个独立按钮 - 上下换泳道时高亮目标泳道(可放置=强调色,重叠=警示色) - 重新构建 dist
This commit is contained in:
+5
-24
@@ -423,7 +423,11 @@ class _AppShellState extends State<AppShell> {
|
||||
_segmented(t, compact: true),
|
||||
];
|
||||
right = <Widget>[
|
||||
_exportMenuBtn(t),
|
||||
// 导出保持两个独立按钮(不用合并菜单,便于一眼识别)。
|
||||
_ghost(t, '导出 SVG', _exportSvg),
|
||||
const SizedBox(width: 4),
|
||||
_ghost(t, '导出 PNG', _exportPng),
|
||||
const SizedBox(width: 4),
|
||||
_zoomBox(t),
|
||||
_iconBtn(t, Icons.crop_free, c.fitView, tooltip: '适应视图'),
|
||||
_unitDropdown(t),
|
||||
@@ -709,29 +713,6 @@ class _AppShellState extends State<AppShell> {
|
||||
);
|
||||
}
|
||||
|
||||
/// 导出菜单按钮:一个图标弹出「导出 SVG / PNG」,节省工具栏宽度。
|
||||
Widget _exportMenuBtn(Tokens t) {
|
||||
return PopupMenuButton<String>(
|
||||
tooltip: '导出 SVG / PNG',
|
||||
color: t.dialog,
|
||||
onSelected: (String v) {
|
||||
if (v == 'svg') {
|
||||
_exportSvg();
|
||||
} else {
|
||||
_exportPng();
|
||||
}
|
||||
},
|
||||
itemBuilder: (BuildContext ctx) => const <PopupMenuEntry<String>>[
|
||||
PopupMenuItem<String>(value: 'svg', child: Text('导出 SVG')),
|
||||
PopupMenuItem<String>(value: 'png', child: Text('导出 PNG')),
|
||||
],
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(7),
|
||||
child: Icon(Icons.download, size: 18, color: t.accent2),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// ===================== 侧栏停靠状态机(钉住 / 悬浮 / 轨道) =====================
|
||||
|
||||
/// 侧栏标题栏控制按钮:切换钉住状态与隐藏侧栏。
|
||||
|
||||
+13
-1
@@ -70,6 +70,12 @@ class _CanvasViewState extends State<CanvasView> {
|
||||
/// 当前鼠标指针样式(靠近可拖拽端点时显示左右箭头)。
|
||||
MouseCursor _cursor = SystemMouseCursors.basic;
|
||||
|
||||
/// 上下拖拽换泳道时的目标泳道号;非空时在画布上高亮。
|
||||
int? _dropLane;
|
||||
|
||||
/// 目标泳道是否可放置(时间不重叠)。
|
||||
bool _dropValid = true;
|
||||
|
||||
/// 控制器快捷访问器。
|
||||
AppController get c => widget.controller;
|
||||
|
||||
@@ -377,7 +383,10 @@ class _CanvasViewState extends State<CanvasView> {
|
||||
);
|
||||
} else if (dy.abs() > dx.abs() + 6 && dy.abs() > 12) {
|
||||
// 以垂直为主:上下拖拽换泳道(同泳道可放多个不重叠动作)。
|
||||
c.moveActionLane(_dragAction!.id, layout.laneAt(p.dy));
|
||||
final int target = layout.laneAt(p.dy);
|
||||
_dropLane = target;
|
||||
_dropValid = c.canPlaceInLane(_dragAction!.id, target);
|
||||
c.moveActionLane(_dragAction!.id, target);
|
||||
} else {
|
||||
c.setActionStart(_dragAction!.id, _startAngle + dx / layout.span * 360);
|
||||
}
|
||||
@@ -419,6 +428,7 @@ class _CanvasViewState extends State<CanvasView> {
|
||||
_dragAction = null;
|
||||
_zoneIndex = -1;
|
||||
_zoneGuideAngle = null;
|
||||
_dropLane = null;
|
||||
}
|
||||
|
||||
/// 滚轮:按住 Ctrl 时以指针方向缩放,否则按滚轮增量平移画布。
|
||||
@@ -573,6 +583,8 @@ class _CanvasViewState extends State<CanvasView> {
|
||||
criticalDeps: c.criticalDeps,
|
||||
selectedIds: c.selectedIds.toSet(),
|
||||
guideAngle: _zoneGuideAngle,
|
||||
dropLane: _dropLane,
|
||||
dropValid: _dropValid,
|
||||
)
|
||||
: CircularPainter(
|
||||
project: c.project,
|
||||
|
||||
Reference in New Issue
Block a user