diff --git a/README.md b/README.md index 6faf70a..6f3d998 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# 时序图工作台 · Sequence Diagram Studio +# 时序图设计器 · Sequence Diagram Studio 面向 **PLC 流程节拍设计 / 相位角设计** 的桌面设计软件(Flutter Desktop)。 @@ -93,7 +93,7 @@ Flutter 3.29+(Desktop) · CustomPainter 自绘 · Riverpod · 不可变模 ## 关于 -- **软件**:时序图工作台 · Sequence Diagram Studio +- **软件**:时序图设计器 · Sequence Diagram Studio - **设计人**:呆头鹅 - **版本**:V1.0.0 - **版权**:Copyright © 2026 呆头鹅。保留所有权利。 diff --git a/demo/app-icon.png b/demo/app-icon.png index 0adbcc1..477bd09 100644 Binary files a/demo/app-icon.png and b/demo/app-icon.png differ diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 1a7beeb..6e3db5d 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -1,4 +1,4 @@ -# 架构文档 · 时序图工作台(Sequence Diagram Studio) +# 架构文档 · 时序图设计器(Sequence Diagram Studio) > 面向 PLC 流程节拍 / 相位角设计的 Flutter Windows 桌面软件。 > 本文档描述代码结构、数据流、关键算法与**可优化点**,供后续性能与体验优化使用。 diff --git a/docs/DESIGN.md b/docs/DESIGN.md index 93e33ef..db38595 100644 --- a/docs/DESIGN.md +++ b/docs/DESIGN.md @@ -1,4 +1,4 @@ -# 时序图工作台(Sequence Diagram Studio)设计文档 +# 时序图设计器(Sequence Diagram Studio)设计文档 > PLC 流程节拍设计 / 相位角设计软件 > 版本 v0.1(设计草案) · 2026-09-17 diff --git a/docs/HELP.md b/docs/HELP.md index 78aa784..2b87ae4 100644 --- a/docs/HELP.md +++ b/docs/HELP.md @@ -1,4 +1,4 @@ -# 时序图工作台 · 使用帮助(按任务组织) +# 时序图设计器 · 使用帮助(按任务组织) > 面向 PLC 流程节拍 / 相位角设计的桌面软件(Flutter Desktop)。 > 应用内按 **F1** 可随时打开同一份帮助。 @@ -238,7 +238,7 @@ ms = angle / 360 × cycleMs ## N. 关于 -- **软件**:时序图工作台 · Sequence Diagram Studio +- **软件**:时序图设计器 · Sequence Diagram Studio - **设计人**:呆头鹅 - **版本**:V1.0.0 - **版权**:Copyright © 2026 呆头鹅。保留所有权利。 diff --git a/lib/export/svg_writer.dart b/lib/export/svg_writer.dart index 1c2a96a..d358b3b 100644 --- a/lib/export/svg_writer.dart +++ b/lib/export/svg_writer.dart @@ -258,7 +258,7 @@ class SvgWriter { /// 参数 [w]/[h] 为画布宽高,用于定位到左下角。 void _legend(double w, double h) { _b.write(''); - _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); _b.write(''); } diff --git a/lib/main.dart b/lib/main.dart index 1ccefc7..7b607f3 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -67,7 +67,7 @@ class _SequenceDiagramAppState extends State { /// 原生窗口标题通道(在 Windows runner 中实现 SetWindowText)。 static const MethodChannel _windowChannel = MethodChannel('seqstudio/window'); - /// 更新原生窗口标题为「时序图工作台 - <文件名 | 未命名文件>」, + /// 更新原生窗口标题为「时序图设计器 - <文件名 | 未命名文件>」, /// 有未保存修改时追加 ` *`。 void _updateWindowTitle() { final String name = _controller.filePath == null @@ -75,7 +75,7 @@ class _SequenceDiagramAppState extends State { : _controller.filePath!.split(RegExp(r'[\\/]')).last; final String dirty = _controller.dirty ? ' *' : ''; _windowChannel - .invokeMethod('setTitle', '时序图工作台 - $name$dirty') + .invokeMethod('setTitle', '时序图设计器 - $name$dirty') .catchError((Object _) {}); } @@ -150,7 +150,7 @@ class _SequenceDiagramAppState extends State { builder: (BuildContext context, Widget? child) { final Tokens tokens = Tokens.of(_controller.brightness); return MaterialApp( - title: '时序图工作台 · Sequence Diagram Studio', + title: '时序图设计器 · Sequence Diagram Studio', debugShowCheckedModeBanner: false, theme: buildTheme(tokens), home: AppShell(controller: _controller), diff --git a/lib/model/models.dart b/lib/model/models.dart index 478c6b2..174305f 100644 --- a/lib/model/models.dart +++ b/lib/model/models.dart @@ -376,7 +376,7 @@ class Cycle { /// 参数 [durationMs]:整圈时长(毫秒),默认 2400;[startAngle]:起始相位角; /// [direction]:旋转方向;[origin]:0° 基准位置;[snapDeg]:角度吸附步长(度)。 const Cycle({ - this.durationMs = 2400, + this.durationMs = 3600, this.startAngle = 0, this.direction = CycleDirection.cw, this.origin = CycleOrigin.twelve, @@ -927,7 +927,7 @@ class Project { ]; return Project( name: '未命名节拍', - cycle: const Cycle(durationMs: 2400), + cycle: const Cycle(durationMs: 3600), stations: stations, actions: actions, units: const UnitSettings(), diff --git a/lib/ui/ai_dialog.dart b/lib/ui/ai_dialog.dart index c406643..d1f82e8 100644 --- a/lib/ui/ai_dialog.dart +++ b/lib/ui/ai_dialog.dart @@ -14,6 +14,7 @@ import '../ai/ai_client.dart'; import '../model/models.dart'; import '../state/app_controller.dart'; import '../theme/tokens.dart'; +import 'dialogs.dart'; class AiGenerateDialog extends StatefulWidget { const AiGenerateDialog({super.key, required this.controller}); @@ -79,10 +80,11 @@ class _AiGenerateDialogState extends State { return Dialog( backgroundColor: t.dialog, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)), - child: SizedBox( - width: 880, - height: 620, - child: Padding( + child: scaledDialogBox( + context, + 880, + 620, + Padding( padding: const EdgeInsets.all(18), child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/ui/app_shell.dart b/lib/ui/app_shell.dart index 6855259..dea828b 100644 --- a/lib/ui/app_shell.dart +++ b/lib/ui/app_shell.dart @@ -307,86 +307,127 @@ class _AppShellState extends State { ), child: LayoutBuilder( builder: (BuildContext ctx, BoxConstraints cons) { - // 响应式断点:窄于 1960 时使用紧凑布局(图标化、隐藏次要信息)。 - final bool compact = cons.maxWidth < 1960; - // 左侧工具组:品牌、文件操作、撤销重做、编辑与视图切换。 - final List left = [ - const AppLogo(size: 32), - const SizedBox(width: 10), - Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text('时序图工作台', - style: TextStyle(color: t.text, fontSize: 14, fontWeight: FontWeight.w700, letterSpacing: 1)), - if (!compact) - Text('Sequence Diagram Studio', style: TextStyle(color: t.dim, fontSize: 10)), - ], - ), - SizedBox(width: compact ? 12 : 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(context: context, builder: (_) => ActionEditorDialog(controller: c, action: a)); + // 响应式断点:宽于 1760 用完整布局;否则用紧凑布局, + // 保证在 1920×1080(含 150% 缩放下的 1280 逻辑宽度)也能全部显示。 + final bool compact = cons.maxWidth < 1760; + // 侧栏开关(两种布局共用)。 + final Widget sideToggleLeft = _iconBtn(t, Icons.view_sidebar_outlined, () => setState(() { + if (_leftVisible) { + _leftVisible = false; + _leftHover = false; + } else { + _leftVisible = true; + if (!_leftPinned) _leftHover = true; + } + }), tooltip: '显示 / 隐藏左侧栏'); + final Widget sideToggleRight = Transform( + alignment: Alignment.center, + transform: Matrix4.diagonal3Values(-1.0, 1.0, 1.0), + child: _iconBtn(t, Icons.view_sidebar_outlined, () => setState(() { + if (_rightVisible) { + _rightVisible = false; + _rightHover = false; + } else { + _rightVisible = true; + if (!_rightPinned) _rightHover = true; } - }), - _aiBtn(t), - const SizedBox(width: 12), - _segmented(t), - ]; - // 右侧工具组:导出、缩放、单位、文件状态、侧栏开关与主题。 - final List right = [ - _primaryBtn(t, '导出 SVG', _exportSvg), - const SizedBox(width: 6), - _ghost(t, '导出 PNG', _exportPng), - const SizedBox(width: 6), - _zoomBox(t), - const SizedBox(width: 6), - if (compact) - _iconBtn(t, Icons.crop_free, c.fitView, tooltip: '适应视图') - else + }), tooltip: '显示 / 隐藏右侧栏'), + ); + + final List left; + final List right; + if (!compact) { + // 完整布局:文字按钮 + 文件状态胶囊。 + left = [ + const AppLogo(size: 32), + const SizedBox(width: 10), + Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text('时序图设计器', + 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(context: context, builder: (_) => ActionEditorDialog(controller: c, action: a)); + } + }), + _aiBtn(t), + const SizedBox(width: 12), + _segmented(t), + ]; + right = [ + _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), - const SizedBox(width: 8), - _unitDropdown(t), - if (!compact) ...[ + const SizedBox(width: 8), + _unitDropdown(t), const SizedBox(width: 8), fileChip, - ], - const SizedBox(width: 8), - _iconBtn(t, Icons.view_sidebar_outlined, () => setState(() { - if (_leftVisible) { - _leftVisible = false; - _leftHover = false; - } else { - _leftVisible = true; - if (!_leftPinned) _leftHover = true; - } - }), tooltip: '显示 / 隐藏左侧栏'), - Transform( - alignment: Alignment.center, - transform: Matrix4.diagonal3Values(-1.0, 1.0, 1.0), - child: _iconBtn(t, Icons.view_sidebar_outlined, () => setState(() { - if (_rightVisible) { - _rightVisible = false; - _rightHover = false; - } else { - _rightVisible = true; - if (!_rightPinned) _rightHover = true; + const SizedBox(width: 8), + sideToggleLeft, + sideToggleRight, + _iconBtn(t, Icons.help_outline, () => + showDialog(context: context, builder: (_) => const HelpDialog()), tooltip: '帮助 F1'), + _themeToggle(t), + ]; + } else { + // 紧凑布局:图标化 + 导出合并为菜单,尽量压缩宽度。 + left = [ + const AppLogo(size: 28), + const SizedBox(width: 8), + Text('时序图设计器', + style: TextStyle(color: t.text, fontSize: 13, fontWeight: FontWeight.w700, letterSpacing: 0.5)), + const SizedBox(width: 8), + _iconBtn(t, Icons.note_add_outlined, _newProject, tooltip: '新建 Ctrl+N'), + _iconBtn(t, Icons.folder_open_outlined, _open, tooltip: '打开 Ctrl+O'), + _iconBtn(t, Icons.save_outlined, _save, tooltip: '保存 Ctrl+S'), + const SizedBox(width: 4), + _iconBtn(t, Icons.undo, c.canUndo ? c.undo : null, tooltip: '撤销 Ctrl+Z'), + _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(context: context, builder: (_) => ActionEditorDialog(controller: c, action: a)); } - }), tooltip: '显示 / 隐藏右侧栏'), - ), - _iconBtn(t, Icons.help_outline, () => - showDialog(context: context, builder: (_) => const HelpDialog()), tooltip: '帮助 F1'), - _themeToggle(t), - ]; + }, tooltip: '编辑', color: t.accent), + _iconBtn(t, Icons.auto_awesome, () => + showDialog(context: context, builder: (_) => AiGenerateDialog(controller: c)), + tooltip: 'AI 生成', color: t.accent2), + const SizedBox(width: 8), + _segmented(t, compact: true), + ]; + right = [ + _exportMenuBtn(t), + _zoomBox(t), + _iconBtn(t, Icons.crop_free, c.fitView, tooltip: '适应视图'), + _unitDropdown(t), + sideToggleLeft, + sideToggleRight, + _iconBtn(t, Icons.help_outline, () => + showDialog(context: context, builder: (_) => const HelpDialog()), tooltip: '帮助 F1'), + _themeToggle(t), + ]; + } // 用「最小宽度 = 视口宽度」约束让内容铺满整条工具栏: // 空间足够时 Spacer 把右侧工具组顶到最右(不再留空白); // 空间不足时横向滚动,避免溢出。 @@ -405,14 +446,16 @@ class _AppShellState extends State { } /// 视图模式分段控件:条形节拍 / 圆周节拍一键切换。 - Widget _segmented(Tokens t) { + /// + /// [compact] 为真时使用更窄的宽度,适配 1920×1080 等较小窗口。 + Widget _segmented(Tokens t, {bool compact = false}) { final bool bar = c.project.viewState.mode == ViewMode.bar; Widget seg(String label, bool active, VoidCallback onTap) { return InkWell( onTap: onTap, borderRadius: BorderRadius.circular(10), child: Container( - width: 140, + width: compact ? 96 : 140, height: 34, alignment: Alignment.center, decoration: BoxDecoration( @@ -647,13 +690,38 @@ class _AppShellState extends State { ); } - /// 图标按钮,可附带 tooltip。 - Widget _iconBtn(Tokens t, IconData icon, VoidCallback? onTap, {String? tooltip}) { + /// 图标按钮,可附带 tooltip 与自定义颜色;尺寸紧凑以节省工具栏宽度。 + Widget _iconBtn(Tokens t, IconData icon, VoidCallback? onTap, {String? tooltip, Color? color}) { return IconButton( 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, - splashRadius: 18, + splashRadius: 16, + padding: EdgeInsets.zero, + constraints: const BoxConstraints(minWidth: 34, minHeight: 34), + ); + } + + /// 导出菜单按钮:一个图标弹出「导出 SVG / PNG」,节省工具栏宽度。 + Widget _exportMenuBtn(Tokens t) { + return PopupMenuButton( + tooltip: '导出 SVG / PNG', + color: t.dialog, + onSelected: (String v) { + if (v == 'svg') { + _exportSvg(); + } else { + _exportPng(); + } + }, + itemBuilder: (BuildContext ctx) => const >[ + PopupMenuItem(value: 'svg', child: Text('导出 SVG')), + PopupMenuItem(value: 'png', child: Text('导出 PNG')), + ], + child: Padding( + padding: const EdgeInsets.all(7), + child: Icon(Icons.download, size: 18, color: t.accent2), + ), ); } diff --git a/lib/ui/dialogs.dart b/lib/ui/dialogs.dart index 7604715..ebd0ac2 100644 --- a/lib/ui/dialogs.dart +++ b/lib/ui/dialogs.dart @@ -7,6 +7,7 @@ // · .seq.json 文件浏览/保存对话框(FileBrowserDialog / pickFile); // · 动作编辑、依赖编辑、工艺参数设置、帮助中心等业务对话框。 import 'dart:io'; +import 'dart:math' as math; import 'package:flutter/material.dart' hide Action; @@ -15,6 +16,30 @@ import '../model/units.dart'; import '../state/app_controller.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 { return Dialog( backgroundColor: t.dialog, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)), - child: SizedBox( - width: 760, - height: 560, - child: Padding( + child: scaledDialogBox( + context, + 760, + 560, + Padding( padding: const EdgeInsets.all(16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -631,10 +657,11 @@ class _SettingsDialogState extends State { return Dialog( backgroundColor: t.dialog, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)), - child: SizedBox( - width: 860, - height: 620, - child: Padding( + child: scaledDialogBox( + context, + 860, + 620, + Padding( padding: const EdgeInsets.all(20), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -1040,10 +1067,11 @@ class _PhaseZoneDialogState extends State { return Dialog( backgroundColor: t.dialog, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)), - child: SizedBox( - width: 620, - height: 560, - child: Padding( + child: scaledDialogBox( + context, + 620, + 560, + Padding( padding: const EdgeInsets.all(16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -1219,10 +1247,11 @@ class HelpDialog extends StatelessWidget { return Dialog( backgroundColor: t.dialog, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)), - child: SizedBox( - width: 880, - height: 620, - child: Padding( + child: scaledDialogBox( + context, + 880, + 620, + Padding( padding: const EdgeInsets.all(20), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -1304,7 +1333,7 @@ class HelpDialog extends StatelessWidget { ]), // 关于:设计人、版本与版权声明。 _section(t, >[ - ['软件名称', '时序图工作台 · Sequence Diagram Studio'], + ['软件名称', '时序图设计器 · Sequence Diagram Studio'], ['设计人', '呆头鹅'], ['版本', 'V1.0.0'], ['版权声明', 'Copyright © 2026 呆头鹅。保留所有权利。'], diff --git a/pubspec.yaml b/pubspec.yaml index a03f35a..e5a46f8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: sequence_diagram -description: "A new Flutter project." +description: "时序图设计器 · Sequence Diagram Studio —— 面向 PLC 流程节拍 / 相位角设计的桌面软件。" # The following line prevents the package from being accidentally published to # 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 diff --git a/test/model_test.dart b/test/model_test.dart index 727da4e..95b9749 100644 --- a/test/model_test.dart +++ b/test/model_test.dart @@ -53,7 +53,7 @@ void main() { expect(decoded.stations.length, p.stations.length); expect(decoded.phaseZones.length, p.phaseZones.length); 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); }); }); diff --git a/tools/gen-icon.py b/tools/gen-icon.py index 1bcaade..eb81281 100644 --- a/tools/gen-icon.py +++ b/tools/gen-icon.py @@ -4,6 +4,9 @@ A clock / cycle dial that reflects the product spirit: one turn = one cycle, 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: windows/runner/resources/app_icon.ico (multi-size, for the Windows build) 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") S = 1024 -BG_TOP = (14, 21, 32, 255) -BG_BOT = (11, 16, 24, 255) -LINE = (31, 44, 64, 255) -ACCENT = (76, 201, 240, 255) -ACCENT2 = (124, 92, 255, 255) -OK = (52, 211, 153, 255) -DIAL = (12, 19, 32, 255) -TICK = (42, 58, 82, 255) -TEXT = (232, 238, 252, 255) +BG_TOP = (76, 201, 240, 255) # #4CC9F0 cyan +BG_BOT = (124, 92, 255, 255) # #7C5CFF violet +WHITE = (255, 255, 255, 255) +WHITE_SOFT = (255, 255, 255, 170) +NAVY = (11, 16, 24, 255) # #0B1018 +EDGE = (255, 255, 255, 90) 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)) -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(): 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)) bd = ImageDraw.Draw(body) for y in range(S): @@ -71,50 +60,47 @@ def build_master(): mask = rounded_mask(S, 210, inset=48) img.paste(body, (0, 0), mask) - # Inner border ring. + draw = ImageDraw.Draw(img) + # Subtle inner edge to separate from the taskbar. draw.rounded_rectangle( [48, 48, S - 1 - 48, S - 1 - 48], radius=210, - outline=LINE, - width=6, + outline=EDGE, + width=5, ) cx = cy = S // 2 - r_ring = 320 - ring_w = 46 + r_ring = 300 + ring_w = 40 - # Dial disc. + # White outer ring (the cycle). 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], - fill=DIAL, - outline=LINE, - width=4, + outline=WHITE, + width=ring_w, ) - # 12 / 3 / 6 / 9 major ticks. + # 12 tick marks; 12/3/6/9 are longer and thicker. for d in range(0, 360, 30): major = d % 90 == 0 r1 = r_ring - 96 r2 = r_ring - (52 if major else 74) - col = ACCENT if major else TICK - w = 14 if major else 9 - draw.line([polar(cx, cy, r1, d), polar(cx, cy, r2, d)], fill=col, width=w) + draw.line( + [polar(cx, cy, r1, d), polar(cx, cy, r2, d)], + fill=WHITE if major else WHITE_SOFT, + width=16 if major else 9, + ) - # Phase arcs on the outer ring: two "actions" of the cycle. - arc(draw, cx, cy, r_ring, 0, 70, ACCENT, ring_w) - 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)): + # Clock hands: classic 10:10 pose, navy for contrast on white. + for r, deg, col, w in ((170, 305, NAVY, 34), (240, 55, NAVY, 26)): hx, hy = polar(cx, cy, r, deg) 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) # Hub. - draw.ellipse([cx - 30, cy - 30, cx + 30, cy + 30], fill=TEXT) - draw.ellipse([cx - 13, cy - 13, cx + 13, cy + 13], fill=DIAL) + draw.ellipse([cx - 30, cy - 30, cx + 30, cy + 30], fill=NAVY) + draw.ellipse([cx - 12, cy - 12, cx + 12, cy + 12], fill=WHITE) return img diff --git a/windows/runner/Runner.rc b/windows/runner/Runner.rc index c4c25e8..7eb7995 100644 --- a/windows/runner/Runner.rc +++ b/windows/runner/Runner.rc @@ -90,12 +90,12 @@ BEGIN BLOCK "040904e4" BEGIN VALUE "CompanyName", "呆头鹅" "\0" - VALUE "FileDescription", "时序图工作台 Sequence Diagram Studio" "\0" + VALUE "FileDescription", "时序图设计器 Sequence Diagram Studio" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" VALUE "InternalName", "sequence_diagram" "\0" VALUE "LegalCopyright", "Copyright (C) 2026 呆头鹅. All rights reserved." "\0" VALUE "OriginalFilename", "sequence_diagram.exe" "\0" - VALUE "ProductName", "时序图工作台" "\0" + VALUE "ProductName", "时序图设计器" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" END END diff --git a/windows/runner/flutter_window.cpp b/windows/runner/flutter_window.cpp index c842cee..5afd040 100644 --- a/windows/runner/flutter_window.cpp +++ b/windows/runner/flutter_window.cpp @@ -33,7 +33,7 @@ bool FlutterWindow::OnCreate() { SetChildContent(flutter_controller_->view()->GetNativeWindow()); // Method channel used by the Dart side to update the native window title - // (e.g. "时序图工作台 - "). + // (e.g. "时序图设计器 - "). title_channel_ = std::make_unique>( flutter_controller_->engine()->messenger(), "seqstudio/window", diff --git a/windows/runner/main.cpp b/windows/runner/main.cpp index e1fac0c..1f01f62 100644 --- a/windows/runner/main.cpp +++ b/windows/runner/main.cpp @@ -38,7 +38,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, Win32Window::Size size( static_cast(screen_width / scale * 0.94), static_cast(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; } window.SetQuitOnClose(true); diff --git a/windows/runner/resources/app_icon.ico b/windows/runner/resources/app_icon.ico index 23eb9a4..07cab21 100644 Binary files a/windows/runner/resources/app_icon.ico and b/windows/runner/resources/app_icon.ico differ