feat: 产品更名「时序图设计器」+ 亮色图标 + 工具栏适配 1920x1080 + 对话框等比缩放 + 默认周期 3.6s

- 产品名:时序图设计器 Sequence Diagram Studio(窗口标题/帮助关于/README/RC/素材同步)
- 图标改为亮色渐变+白色时钟,深色任务栏下清晰可见
- 工具栏新增紧凑布局(图标化/导出菜单),1920x1080 及 150% 缩放(1280 逻辑宽)下完整显示
- 对话框以 1920x1080 为基准等比放大(<=1.75x),更小窗口不缩小
- 默认循环周期 2400ms -> 3600ms(3.6s = 360°)
- 重新构建 dist
This commit is contained in:
呆头鹅
2026-09-18 17:14:27 +08:00
parent 550cebc172
commit 89cc3189cc
18 changed files with 248 additions and 163 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
# 时序图工作台 · Sequence Diagram Studio # 时序图设计器 · Sequence Diagram Studio
面向 **PLC 流程节拍设计 / 相位角设计** 的桌面设计软件(Flutter Desktop)。 面向 **PLC 流程节拍设计 / 相位角设计** 的桌面设计软件(Flutter Desktop)。
@@ -93,7 +93,7 @@ Flutter 3.29+(Desktop) · CustomPainter 自绘 · Riverpod · 不可变模
## 关于 ## 关于
- **软件**:时序图工作台 · Sequence Diagram Studio - **软件**:时序图设计器 · Sequence Diagram Studio
- **设计人**:呆头鹅 - **设计人**:呆头鹅
- **版本**:V1.0.0 - **版本**:V1.0.0
- **版权**:Copyright © 2026 呆头鹅。保留所有权利。 - **版权**:Copyright © 2026 呆头鹅。保留所有权利。
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 18 KiB

+1 -1
View File
@@ -1,4 +1,4 @@
# 架构文档 · 时序图工作台(Sequence Diagram Studio) # 架构文档 · 时序图设计器(Sequence Diagram Studio)
> 面向 PLC 流程节拍 / 相位角设计的 Flutter Windows 桌面软件。 > 面向 PLC 流程节拍 / 相位角设计的 Flutter Windows 桌面软件。
> 本文档描述代码结构、数据流、关键算法与**可优化点**,供后续性能与体验优化使用。 > 本文档描述代码结构、数据流、关键算法与**可优化点**,供后续性能与体验优化使用。
+1 -1
View File
@@ -1,4 +1,4 @@
# 时序图工作台(Sequence Diagram Studio)设计文档 # 时序图设计器(Sequence Diagram Studio)设计文档
> PLC 流程节拍设计 / 相位角设计软件 > PLC 流程节拍设计 / 相位角设计软件
> 版本 v0.1(设计草案) · 2026-09-17 > 版本 v0.1(设计草案) · 2026-09-17
+2 -2
View File
@@ -1,4 +1,4 @@
# 时序图工作台 · 使用帮助(按任务组织) # 时序图设计器 · 使用帮助(按任务组织)
> 面向 PLC 流程节拍 / 相位角设计的桌面软件(Flutter Desktop)。 > 面向 PLC 流程节拍 / 相位角设计的桌面软件(Flutter Desktop)。
> 应用内按 **F1** 可随时打开同一份帮助。 > 应用内按 **F1** 可随时打开同一份帮助。
@@ -238,7 +238,7 @@ ms = angle / 360 × cycleMs
## N. 关于 ## N. 关于
- **软件**:时序图工作台 · Sequence Diagram Studio - **软件**:时序图设计器 · Sequence Diagram Studio
- **设计人**:呆头鹅 - **设计人**:呆头鹅
- **版本**:V1.0.0 - **版本**:V1.0.0
- **版权**:Copyright © 2026 呆头鹅。保留所有权利。 - **版权**:Copyright © 2026 呆头鹅。保留所有权利。
+1 -1
View File
@@ -258,7 +258,7 @@ class SvgWriter {
/// 参数 [w]/[h] 为画布宽高,用于定位到左下角。 /// 参数 [w]/[h] 为画布宽高,用于定位到左下角。
void _legend(double w, double h) { void _legend(double w, double h) {
_b.write('<g id="legend">'); _b.write('<g id="legend">');
_text(24, h - 28, '时序图工作台 · ${project.name} · 循环 ${tfmt(project.cycle.durationMs, project.units)} = 360°', _text(24, h - 28, '时序图设计器 · ${project.name} · 循环 ${tfmt(project.cycle.durationMs, project.units)} = 360°',
color: _hex(tokens.sub), size: 13); color: _hex(tokens.sub), size: 13);
_b.write('</g>'); _b.write('</g>');
} }
+3 -3
View File
@@ -67,7 +67,7 @@ class _SequenceDiagramAppState extends State<SequenceDiagramApp> {
/// 原生窗口标题通道(在 Windows runner 中实现 SetWindowText)。 /// 原生窗口标题通道(在 Windows runner 中实现 SetWindowText)。
static const MethodChannel _windowChannel = MethodChannel('seqstudio/window'); static const MethodChannel _windowChannel = MethodChannel('seqstudio/window');
/// 更新原生窗口标题为「时序图工作台 - <文件名 | 未命名文件>」, /// 更新原生窗口标题为「时序图设计器 - <文件名 | 未命名文件>」,
/// 有未保存修改时追加 ` *`。 /// 有未保存修改时追加 ` *`。
void _updateWindowTitle() { void _updateWindowTitle() {
final String name = _controller.filePath == null final String name = _controller.filePath == null
@@ -75,7 +75,7 @@ class _SequenceDiagramAppState extends State<SequenceDiagramApp> {
: _controller.filePath!.split(RegExp(r'[\\/]')).last; : _controller.filePath!.split(RegExp(r'[\\/]')).last;
final String dirty = _controller.dirty ? ' *' : ''; final String dirty = _controller.dirty ? ' *' : '';
_windowChannel _windowChannel
.invokeMethod<void>('setTitle', '时序图工作台 - $name$dirty') .invokeMethod<void>('setTitle', '时序图设计器 - $name$dirty')
.catchError((Object _) {}); .catchError((Object _) {});
} }
@@ -150,7 +150,7 @@ class _SequenceDiagramAppState extends State<SequenceDiagramApp> {
builder: (BuildContext context, Widget? child) { builder: (BuildContext context, Widget? child) {
final Tokens tokens = Tokens.of(_controller.brightness); final Tokens tokens = Tokens.of(_controller.brightness);
return MaterialApp( return MaterialApp(
title: '时序图工作台 · Sequence Diagram Studio', title: '时序图设计器 · Sequence Diagram Studio',
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
theme: buildTheme(tokens), theme: buildTheme(tokens),
home: AppShell(controller: _controller), home: AppShell(controller: _controller),
+2 -2
View File
@@ -376,7 +376,7 @@ class Cycle {
/// 参数 [durationMs]:整圈时长(毫秒),默认 2400;[startAngle]:起始相位角; /// 参数 [durationMs]:整圈时长(毫秒),默认 2400;[startAngle]:起始相位角;
/// [direction]:旋转方向;[origin]:0° 基准位置;[snapDeg]:角度吸附步长(度)。 /// [direction]:旋转方向;[origin]:0° 基准位置;[snapDeg]:角度吸附步长(度)。
const Cycle({ const Cycle({
this.durationMs = 2400, this.durationMs = 3600,
this.startAngle = 0, this.startAngle = 0,
this.direction = CycleDirection.cw, this.direction = CycleDirection.cw,
this.origin = CycleOrigin.twelve, this.origin = CycleOrigin.twelve,
@@ -927,7 +927,7 @@ class Project {
]; ];
return Project( return Project(
name: '未命名节拍', name: '未命名节拍',
cycle: const Cycle(durationMs: 2400), cycle: const Cycle(durationMs: 3600),
stations: stations, stations: stations,
actions: actions, actions: actions,
units: const UnitSettings(), units: const UnitSettings(),
+6 -4
View File
@@ -14,6 +14,7 @@ import '../ai/ai_client.dart';
import '../model/models.dart'; import '../model/models.dart';
import '../state/app_controller.dart'; import '../state/app_controller.dart';
import '../theme/tokens.dart'; import '../theme/tokens.dart';
import 'dialogs.dart';
class AiGenerateDialog extends StatefulWidget { class AiGenerateDialog extends StatefulWidget {
const AiGenerateDialog({super.key, required this.controller}); const AiGenerateDialog({super.key, required this.controller});
@@ -79,10 +80,11 @@ class _AiGenerateDialogState extends State<AiGenerateDialog> {
return Dialog( return Dialog(
backgroundColor: t.dialog, backgroundColor: t.dialog,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)),
child: SizedBox( child: scaledDialogBox(
width: 880, context,
height: 620, 880,
child: Padding( 620,
Padding(
padding: const EdgeInsets.all(18), padding: const EdgeInsets.all(18),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
+149 -81
View File
@@ -307,86 +307,127 @@ class _AppShellState extends State<AppShell> {
), ),
child: LayoutBuilder( child: LayoutBuilder(
builder: (BuildContext ctx, BoxConstraints cons) { builder: (BuildContext ctx, BoxConstraints cons) {
// 响应式断点:窄于 1960 时使用紧凑布局(图标化、隐藏次要信息)。 // 响应式断点:宽于 1760 用完整布局;否则用紧凑布局,
final bool compact = cons.maxWidth < 1960; // 保证在 1920×1080(含 150% 缩放下的 1280 逻辑宽度)也能全部显示。
// 左侧工具组:品牌、文件操作、撤销重做、编辑与视图切换。 final bool compact = cons.maxWidth < 1760;
final List<Widget> left = <Widget>[ // 侧栏开关(两种布局共用)。
const AppLogo(size: 32), final Widget sideToggleLeft = _iconBtn(t, Icons.view_sidebar_outlined, () => setState(() {
const SizedBox(width: 10), if (_leftVisible) {
Column( _leftVisible = false;
mainAxisAlignment: MainAxisAlignment.center, _leftHover = false;
crossAxisAlignment: CrossAxisAlignment.start, } else {
children: <Widget>[ _leftVisible = true;
Text('时序图工作台', if (!_leftPinned) _leftHover = true;
style: TextStyle(color: t.text, fontSize: 14, fontWeight: FontWeight.w700, letterSpacing: 1)), }
if (!compact) }), tooltip: '显示 / 隐藏左侧栏');
Text('Sequence Diagram Studio', style: TextStyle(color: t.dim, fontSize: 10)), final Widget sideToggleRight = Transform(
], alignment: Alignment.center,
), transform: Matrix4.diagonal3Values(-1.0, 1.0, 1.0),
SizedBox(width: compact ? 12 : 18), child: _iconBtn(t, Icons.view_sidebar_outlined, () => setState(() {
_ghost(t, '新建', _newProject), if (_rightVisible) {
_ghost(t, '打开', _open), _rightVisible = false;
_ghost(t, '保存', _save), _rightHover = false;
const SizedBox(width: 6), } else {
_ghost(t, '撤销', c.canUndo ? c.undo : null, icon: Icons.undo), _rightVisible = true;
_ghost(t, '重做', c.canRedo ? c.redo : null, icon: Icons.redo), if (!_rightPinned) _rightHover = true;
const SizedBox(width: 6),
_addBtn(t, '添加动作', () => c.addAction(startAngle: 0)),
_toggleBtn(t, '编辑', Icons.edit, () {
final Action? a = c.selected;
if (a != null) {
showDialog<void>(context: context, builder: (_) => ActionEditorDialog(controller: c, action: a));
} }
}), }), tooltip: '显示 / 隐藏右侧栏'),
_aiBtn(t), );
const SizedBox(width: 12),
_segmented(t), final List<Widget> left;
]; final List<Widget> right;
// 右侧工具组:导出、缩放、单位、文件状态、侧栏开关与主题。 if (!compact) {
final List<Widget> right = <Widget>[ // 完整布局:文字按钮 + 文件状态胶囊。
_primaryBtn(t, '导出 SVG', _exportSvg), left = <Widget>[
const SizedBox(width: 6), const AppLogo(size: 32),
_ghost(t, '导出 PNG', _exportPng), const SizedBox(width: 10),
const SizedBox(width: 6), Column(
_zoomBox(t), mainAxisAlignment: MainAxisAlignment.center,
const SizedBox(width: 6), crossAxisAlignment: CrossAxisAlignment.start,
if (compact) children: <Widget>[
_iconBtn(t, Icons.crop_free, c.fitView, tooltip: '适应视图') Text('时序图设计器',
else style: TextStyle(color: t.text, fontSize: 14, fontWeight: FontWeight.w700, letterSpacing: 1)),
Text('Sequence Diagram Studio', style: TextStyle(color: t.dim, fontSize: 10)),
],
),
const SizedBox(width: 18),
_ghost(t, '新建', _newProject),
_ghost(t, '打开', _open),
_ghost(t, '保存', _save),
const SizedBox(width: 6),
_ghost(t, '撤销', c.canUndo ? c.undo : null, icon: Icons.undo),
_ghost(t, '重做', c.canRedo ? c.redo : null, icon: Icons.redo),
const SizedBox(width: 6),
_addBtn(t, '添加动作', () => c.addAction(startAngle: 0)),
_toggleBtn(t, '编辑', Icons.edit, () {
final Action? a = c.selected;
if (a != null) {
showDialog<void>(context: context, builder: (_) => ActionEditorDialog(controller: c, action: a));
}
}),
_aiBtn(t),
const SizedBox(width: 12),
_segmented(t),
];
right = <Widget>[
_primaryBtn(t, '导出 SVG', _exportSvg),
const SizedBox(width: 6),
_ghost(t, '导出 PNG', _exportPng),
const SizedBox(width: 6),
_zoomBox(t),
const SizedBox(width: 6),
_ghost(t, '适应视图', c.fitView), _ghost(t, '适应视图', c.fitView),
const SizedBox(width: 8), const SizedBox(width: 8),
_unitDropdown(t), _unitDropdown(t),
if (!compact) ...<Widget>[
const SizedBox(width: 8), const SizedBox(width: 8),
fileChip, fileChip,
], const SizedBox(width: 8),
const SizedBox(width: 8), sideToggleLeft,
_iconBtn(t, Icons.view_sidebar_outlined, () => setState(() { sideToggleRight,
if (_leftVisible) { _iconBtn(t, Icons.help_outline, () =>
_leftVisible = false; showDialog<void>(context: context, builder: (_) => const HelpDialog()), tooltip: '帮助 F1'),
_leftHover = false; _themeToggle(t),
} else { ];
_leftVisible = true; } else {
if (!_leftPinned) _leftHover = true; // 紧凑布局:图标化 + 导出合并为菜单,尽量压缩宽度。
} left = <Widget>[
}), tooltip: '显示 / 隐藏左侧栏'), const AppLogo(size: 28),
Transform( const SizedBox(width: 8),
alignment: Alignment.center, Text('时序图设计器',
transform: Matrix4.diagonal3Values(-1.0, 1.0, 1.0), style: TextStyle(color: t.text, fontSize: 13, fontWeight: FontWeight.w700, letterSpacing: 0.5)),
child: _iconBtn(t, Icons.view_sidebar_outlined, () => setState(() { const SizedBox(width: 8),
if (_rightVisible) { _iconBtn(t, Icons.note_add_outlined, _newProject, tooltip: '新建 Ctrl+N'),
_rightVisible = false; _iconBtn(t, Icons.folder_open_outlined, _open, tooltip: '打开 Ctrl+O'),
_rightHover = false; _iconBtn(t, Icons.save_outlined, _save, tooltip: '保存 Ctrl+S'),
} else { const SizedBox(width: 4),
_rightVisible = true; _iconBtn(t, Icons.undo, c.canUndo ? c.undo : null, tooltip: '撤销 Ctrl+Z'),
if (!_rightPinned) _rightHover = true; _iconBtn(t, Icons.redo, c.canRedo ? c.redo : null, tooltip: '重做 Ctrl+Y'),
const SizedBox(width: 4),
_iconBtn(t, Icons.add_circle_outline, () => c.addAction(startAngle: 0), tooltip: '添加动作', color: t.ok),
_iconBtn(t, Icons.edit, () {
final Action? a = c.selected;
if (a != null) {
showDialog<void>(context: context, builder: (_) => ActionEditorDialog(controller: c, action: a));
} }
}), tooltip: '显示 / 隐藏右侧栏'), }, tooltip: '编辑', color: t.accent),
), _iconBtn(t, Icons.auto_awesome, () =>
_iconBtn(t, Icons.help_outline, () => showDialog<void>(context: context, builder: (_) => AiGenerateDialog(controller: c)),
showDialog<void>(context: context, builder: (_) => const HelpDialog()), tooltip: '帮助 F1'), tooltip: 'AI 生成', color: t.accent2),
_themeToggle(t), const SizedBox(width: 8),
]; _segmented(t, compact: true),
];
right = <Widget>[
_exportMenuBtn(t),
_zoomBox(t),
_iconBtn(t, Icons.crop_free, c.fitView, tooltip: '适应视图'),
_unitDropdown(t),
sideToggleLeft,
sideToggleRight,
_iconBtn(t, Icons.help_outline, () =>
showDialog<void>(context: context, builder: (_) => const HelpDialog()), tooltip: '帮助 F1'),
_themeToggle(t),
];
}
// 用「最小宽度 = 视口宽度」约束让内容铺满整条工具栏: // 用「最小宽度 = 视口宽度」约束让内容铺满整条工具栏:
// 空间足够时 Spacer 把右侧工具组顶到最右(不再留空白); // 空间足够时 Spacer 把右侧工具组顶到最右(不再留空白);
// 空间不足时横向滚动,避免溢出。 // 空间不足时横向滚动,避免溢出。
@@ -405,14 +446,16 @@ class _AppShellState extends State<AppShell> {
} }
/// 视图模式分段控件:条形节拍 / 圆周节拍一键切换。 /// 视图模式分段控件:条形节拍 / 圆周节拍一键切换。
Widget _segmented(Tokens t) { ///
/// [compact] 为真时使用更窄的宽度,适配 1920×1080 等较小窗口。
Widget _segmented(Tokens t, {bool compact = false}) {
final bool bar = c.project.viewState.mode == ViewMode.bar; final bool bar = c.project.viewState.mode == ViewMode.bar;
Widget seg(String label, bool active, VoidCallback onTap) { Widget seg(String label, bool active, VoidCallback onTap) {
return InkWell( return InkWell(
onTap: onTap, onTap: onTap,
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
child: Container( child: Container(
width: 140, width: compact ? 96 : 140,
height: 34, height: 34,
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
@@ -647,13 +690,38 @@ class _AppShellState extends State<AppShell> {
); );
} }
/// 图标按钮,可附带 tooltip。 /// 图标按钮,可附带 tooltip 与自定义颜色;尺寸紧凑以节省工具栏宽度。
Widget _iconBtn(Tokens t, IconData icon, VoidCallback? onTap, {String? tooltip}) { Widget _iconBtn(Tokens t, IconData icon, VoidCallback? onTap, {String? tooltip, Color? color}) {
return IconButton( return IconButton(
onPressed: onTap, onPressed: onTap,
icon: Icon(icon, size: 19, color: onTap == null ? t.dim : t.text), icon: Icon(icon, size: 18, color: onTap == null ? t.dim : (color ?? t.text)),
tooltip: tooltip, tooltip: tooltip,
splashRadius: 18, splashRadius: 16,
padding: EdgeInsets.zero,
constraints: const BoxConstraints(minWidth: 34, minHeight: 34),
);
}
/// 导出菜单按钮:一个图标弹出「导出 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),
),
); );
} }
+46 -17
View File
@@ -7,6 +7,7 @@
// · .seq.json 文件浏览/保存对话框(FileBrowserDialog / pickFile); // · .seq.json 文件浏览/保存对话框(FileBrowserDialog / pickFile);
// · 动作编辑、依赖编辑、工艺参数设置、帮助中心等业务对话框。 // · 动作编辑、依赖编辑、工艺参数设置、帮助中心等业务对话框。
import 'dart:io'; import 'dart:io';
import 'dart:math' as math;
import 'package:flutter/material.dart' hide Action; import 'package:flutter/material.dart' hide Action;
@@ -15,6 +16,30 @@ import '../model/units.dart';
import '../state/app_controller.dart'; import '../state/app_controller.dart';
import '../theme/tokens.dart'; import '../theme/tokens.dart';
// ===================== 对话框等比缩放 =====================
/// 计算对话框的等比缩放系数。
///
/// 以 **1920×1080** 为基准:更大的窗口按比例放大(最多 1.75×),
/// 更小的窗口**不缩小**(返回 1.0),此时宁可显示不全也不要把字缩到看不清。
double dialogScale(BuildContext context) {
final Size s = MediaQuery.sizeOf(context);
if (s.width <= 0 || s.height <= 0) return 1;
final double k = math.min(s.width / 1920, s.height / 1080);
return k.clamp(1.0, 1.75);
}
/// 按 [dialogScale] 对固定尺寸的对话框内容做等比缩放(仅放大,不缩小)。
///
/// 使用 [Transform.scale] 只影响绘制与命中,不改变布局尺寸,因此
/// 对话框仍以原尺寸居中,视觉上整体放大。
Widget scaledDialogBox(BuildContext context, double width, double height, Widget child) {
final double k = dialogScale(context);
final Widget box = SizedBox(width: width, height: height, child: child);
if (k <= 1.0001) return box;
return Transform.scale(scale: k, alignment: Alignment.center, child: box);
}
// ===================== 通用提示 ===================== // ===================== 通用提示 =====================
/// 弹出一个仅含“确定”按钮的简单消息对话框。 /// 弹出一个仅含“确定”按钮的简单消息对话框。
@@ -122,10 +147,11 @@ class _FileBrowserDialogState extends State<FileBrowserDialog> {
return Dialog( return Dialog(
backgroundColor: t.dialog, backgroundColor: t.dialog,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)),
child: SizedBox( child: scaledDialogBox(
width: 760, context,
height: 560, 760,
child: Padding( 560,
Padding(
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(16),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@@ -631,10 +657,11 @@ class _SettingsDialogState extends State<SettingsDialog> {
return Dialog( return Dialog(
backgroundColor: t.dialog, backgroundColor: t.dialog,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)),
child: SizedBox( child: scaledDialogBox(
width: 860, context,
height: 620, 860,
child: Padding( 620,
Padding(
padding: const EdgeInsets.all(20), padding: const EdgeInsets.all(20),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@@ -1040,10 +1067,11 @@ class _PhaseZoneDialogState extends State<PhaseZoneDialog> {
return Dialog( return Dialog(
backgroundColor: t.dialog, backgroundColor: t.dialog,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)),
child: SizedBox( child: scaledDialogBox(
width: 620, context,
height: 560, 620,
child: Padding( 560,
Padding(
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(16),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@@ -1219,10 +1247,11 @@ class HelpDialog extends StatelessWidget {
return Dialog( return Dialog(
backgroundColor: t.dialog, backgroundColor: t.dialog,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)),
child: SizedBox( child: scaledDialogBox(
width: 880, context,
height: 620, 880,
child: Padding( 620,
Padding(
padding: const EdgeInsets.all(20), padding: const EdgeInsets.all(20),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@@ -1304,7 +1333,7 @@ class HelpDialog extends StatelessWidget {
]), ]),
// 关于:设计人、版本与版权声明。 // 关于:设计人、版本与版权声明。
_section(t, <List<String>>[ _section(t, <List<String>>[
<String>['软件名称', '时序图工作台 · Sequence Diagram Studio'], <String>['软件名称', '时序图设计器 · Sequence Diagram Studio'],
<String>['设计人', '呆头鹅'], <String>['设计人', '呆头鹅'],
<String>['版本', 'V1.0.0'], <String>['版本', 'V1.0.0'],
<String>['版权声明', 'Copyright © 2026 呆头鹅。保留所有权利。'], <String>['版权声明', 'Copyright © 2026 呆头鹅。保留所有权利。'],
+1 -1
View File
@@ -1,5 +1,5 @@
name: sequence_diagram name: sequence_diagram
description: "A new Flutter project." description: "时序图设计器 · Sequence Diagram Studio —— 面向 PLC 流程节拍 / 相位角设计的桌面软件。"
# The following line prevents the package from being accidentally published to # The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages. # pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev publish_to: 'none' # Remove this line if you wish to publish to pub.dev
+1 -1
View File
@@ -53,7 +53,7 @@ void main() {
expect(decoded.stations.length, p.stations.length); expect(decoded.stations.length, p.stations.length);
expect(decoded.phaseZones.length, p.phaseZones.length); expect(decoded.phaseZones.length, p.phaseZones.length);
expect(decoded.actions.last.deps.first.type, DepType.fs); expect(decoded.actions.last.deps.first.type, DepType.fs);
expect(decoded.cycle.durationMs, 2400); expect(decoded.cycle.durationMs, 3600);
expect(decoded.actions.last.color, p.actions.last.color); expect(decoded.actions.last.color, p.actions.last.color);
}); });
}); });
+29 -43
View File
@@ -4,6 +4,9 @@
A clock / cycle dial that reflects the product spirit: one turn = one cycle, A clock / cycle dial that reflects the product spirit: one turn = one cycle,
12 o'clock origin, clockwise phase progression. 12 o'clock origin, clockwise phase progression.
Design note: the badge uses a **bright cyan→violet gradient** with a **white
clock** so the icon stays legible on both light and dark taskbars.
Outputs: Outputs:
windows/runner/resources/app_icon.ico (multi-size, for the Windows build) windows/runner/resources/app_icon.ico (multi-size, for the Windows build)
demo/app-icon.png (1024px preview) demo/app-icon.png (1024px preview)
@@ -18,15 +21,12 @@ OUT_ICO = os.path.join(ROOT, "windows", "runner", "resources", "app_icon.ico")
OUT_PNG = os.path.join(ROOT, "demo", "app-icon.png") OUT_PNG = os.path.join(ROOT, "demo", "app-icon.png")
S = 1024 S = 1024
BG_TOP = (14, 21, 32, 255) BG_TOP = (76, 201, 240, 255) # #4CC9F0 cyan
BG_BOT = (11, 16, 24, 255) BG_BOT = (124, 92, 255, 255) # #7C5CFF violet
LINE = (31, 44, 64, 255) WHITE = (255, 255, 255, 255)
ACCENT = (76, 201, 240, 255) WHITE_SOFT = (255, 255, 255, 170)
ACCENT2 = (124, 92, 255, 255) NAVY = (11, 16, 24, 255) # #0B1018
OK = (52, 211, 153, 255) EDGE = (255, 255, 255, 90)
DIAL = (12, 19, 32, 255)
TICK = (42, 58, 82, 255)
TEXT = (232, 238, 252, 255)
def lerp(a, b, t): def lerp(a, b, t):
@@ -49,21 +49,10 @@ def polar(cx, cy, r, deg):
return (cx + r * math.cos(t), cy + r * math.sin(t)) return (cx + r * math.cos(t), cy + r * math.sin(t))
def arc(draw, cx, cy, r, a0, a1, color, width):
draw.arc(
[cx - r, cy - r, cx + r, cy + r],
start=a0 - 90,
end=a1 - 90,
fill=color,
width=width,
)
def build_master(): def build_master():
img = Image.new("RGBA", (S, S), (0, 0, 0, 0)) img = Image.new("RGBA", (S, S), (0, 0, 0, 0))
draw = ImageDraw.Draw(img)
# Rounded-square body with a vertical gradient. # Bright gradient body.
body = Image.new("RGBA", (S, S), (0, 0, 0, 0)) body = Image.new("RGBA", (S, S), (0, 0, 0, 0))
bd = ImageDraw.Draw(body) bd = ImageDraw.Draw(body)
for y in range(S): for y in range(S):
@@ -71,50 +60,47 @@ def build_master():
mask = rounded_mask(S, 210, inset=48) mask = rounded_mask(S, 210, inset=48)
img.paste(body, (0, 0), mask) img.paste(body, (0, 0), mask)
# Inner border ring. draw = ImageDraw.Draw(img)
# Subtle inner edge to separate from the taskbar.
draw.rounded_rectangle( draw.rounded_rectangle(
[48, 48, S - 1 - 48, S - 1 - 48], [48, 48, S - 1 - 48, S - 1 - 48],
radius=210, radius=210,
outline=LINE, outline=EDGE,
width=6, width=5,
) )
cx = cy = S // 2 cx = cy = S // 2
r_ring = 320 r_ring = 300
ring_w = 46 ring_w = 40
# Dial disc. # White outer ring (the cycle).
draw.ellipse( draw.ellipse(
[cx - r_ring - ring_w // 2, cy - r_ring - ring_w // 2, [cx - r_ring - ring_w // 2, cy - r_ring - ring_w // 2,
cx + r_ring + ring_w // 2, cy + r_ring + ring_w // 2], cx + r_ring + ring_w // 2, cy + r_ring + ring_w // 2],
fill=DIAL, outline=WHITE,
outline=LINE, width=ring_w,
width=4,
) )
# 12 / 3 / 6 / 9 major ticks. # 12 tick marks; 12/3/6/9 are longer and thicker.
for d in range(0, 360, 30): for d in range(0, 360, 30):
major = d % 90 == 0 major = d % 90 == 0
r1 = r_ring - 96 r1 = r_ring - 96
r2 = r_ring - (52 if major else 74) r2 = r_ring - (52 if major else 74)
col = ACCENT if major else TICK draw.line(
w = 14 if major else 9 [polar(cx, cy, r1, d), polar(cx, cy, r2, d)],
draw.line([polar(cx, cy, r1, d), polar(cx, cy, r2, d)], fill=col, width=w) fill=WHITE if major else WHITE_SOFT,
width=16 if major else 9,
)
# Phase arcs on the outer ring: two "actions" of the cycle. # Clock hands: classic 10:10 pose, navy for contrast on white.
arc(draw, cx, cy, r_ring, 0, 70, ACCENT, ring_w) for r, deg, col, w in ((170, 305, NAVY, 34), (240, 55, NAVY, 26)):
arc(draw, cx, cy, r_ring, 105, 190, ACCENT2, ring_w)
arc(draw, cx, cy, r_ring, 300, 360, OK, ring_w)
# Clock hands: classic 10:10 pose.
for r, deg, col, w in ((168, 305, TEXT, 34), (238, 55, ACCENT, 26)):
hx, hy = polar(cx, cy, r, deg) hx, hy = polar(cx, cy, r, deg)
draw.line([(cx, cy), (hx, hy)], fill=col, width=w) draw.line([(cx, cy), (hx, hy)], fill=col, width=w)
draw.ellipse([hx - w / 2, hy - w / 2, hx + w / 2, hy + w / 2], fill=col) draw.ellipse([hx - w / 2, hy - w / 2, hx + w / 2, hy + w / 2], fill=col)
# Hub. # Hub.
draw.ellipse([cx - 30, cy - 30, cx + 30, cy + 30], fill=TEXT) draw.ellipse([cx - 30, cy - 30, cx + 30, cy + 30], fill=NAVY)
draw.ellipse([cx - 13, cy - 13, cx + 13, cy + 13], fill=DIAL) draw.ellipse([cx - 12, cy - 12, cx + 12, cy + 12], fill=WHITE)
return img return img
+2 -2
View File
@@ -90,12 +90,12 @@ BEGIN
BLOCK "040904e4" BLOCK "040904e4"
BEGIN BEGIN
VALUE "CompanyName", "呆头鹅" "\0" VALUE "CompanyName", "呆头鹅" "\0"
VALUE "FileDescription", "时序图工作台 Sequence Diagram Studio" "\0" VALUE "FileDescription", "时序图设计器 Sequence Diagram Studio" "\0"
VALUE "FileVersion", VERSION_AS_STRING "\0" VALUE "FileVersion", VERSION_AS_STRING "\0"
VALUE "InternalName", "sequence_diagram" "\0" VALUE "InternalName", "sequence_diagram" "\0"
VALUE "LegalCopyright", "Copyright (C) 2026 呆头鹅. All rights reserved." "\0" VALUE "LegalCopyright", "Copyright (C) 2026 呆头鹅. All rights reserved." "\0"
VALUE "OriginalFilename", "sequence_diagram.exe" "\0" VALUE "OriginalFilename", "sequence_diagram.exe" "\0"
VALUE "ProductName", "时序图工作台" "\0" VALUE "ProductName", "时序图设计器" "\0"
VALUE "ProductVersion", VERSION_AS_STRING "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0"
END END
END END
+1 -1
View File
@@ -33,7 +33,7 @@ bool FlutterWindow::OnCreate() {
SetChildContent(flutter_controller_->view()->GetNativeWindow()); SetChildContent(flutter_controller_->view()->GetNativeWindow());
// Method channel used by the Dart side to update the native window title // Method channel used by the Dart side to update the native window title
// (e.g. "时序图工作台 - <file name>"). // (e.g. "时序图设计器 - <file name>").
title_channel_ = title_channel_ =
std::make_unique<flutter::MethodChannel<flutter::EncodableValue>>( std::make_unique<flutter::MethodChannel<flutter::EncodableValue>>(
flutter_controller_->engine()->messenger(), "seqstudio/window", flutter_controller_->engine()->messenger(), "seqstudio/window",
+1 -1
View File
@@ -38,7 +38,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
Win32Window::Size size( Win32Window::Size size(
static_cast<unsigned int>(screen_width / scale * 0.94), static_cast<unsigned int>(screen_width / scale * 0.94),
static_cast<unsigned int>(screen_height / scale * 0.94)); static_cast<unsigned int>(screen_height / scale * 0.94));
if (!window.Create(L"\u65F6\u5E8F\u56FE\u5DE5\u4F5C\u53F0", origin, size)) { if (!window.Create(L"\u65F6\u5E8F\u56FE\u8BBE\u8BA1\u5668", origin, size)) {
return EXIT_FAILURE; return EXIT_FAILURE;
} }
window.SetQuitOnClose(true); window.SetQuitOnClose(true);
Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB