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)。
@@ -93,7 +93,7 @@ Flutter 3.29+(Desktop) · CustomPainter 自绘 · Riverpod · 不可变模
## 关于
- **软件**:时序图工作台 · Sequence Diagram Studio
- **软件**:时序图设计器 · Sequence Diagram Studio
- **设计人**:呆头鹅
- **版本**:V1.0.0
- **版权**: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 桌面软件。
> 本文档描述代码结构、数据流、关键算法与**可优化点**,供后续性能与体验优化使用。
+1 -1
View File
@@ -1,4 +1,4 @@
# 时序图工作台(Sequence Diagram Studio)设计文档
# 时序图设计器(Sequence Diagram Studio)设计文档
> PLC 流程节拍设计 / 相位角设计软件
> 版本 v0.1(设计草案) · 2026-09-17
+2 -2
View File
@@ -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 呆头鹅。保留所有权利。
+1 -1
View File
@@ -258,7 +258,7 @@ class SvgWriter {
/// 参数 [w]/[h] 为画布宽高,用于定位到左下角。
void _legend(double w, double h) {
_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);
_b.write('</g>');
}
+3 -3
View File
@@ -67,7 +67,7 @@ class _SequenceDiagramAppState extends State<SequenceDiagramApp> {
/// 原生窗口标题通道(在 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<SequenceDiagramApp> {
: _controller.filePath!.split(RegExp(r'[\\/]')).last;
final String dirty = _controller.dirty ? ' *' : '';
_windowChannel
.invokeMethod<void>('setTitle', '时序图工作台 - $name$dirty')
.invokeMethod<void>('setTitle', '时序图设计器 - $name$dirty')
.catchError((Object _) {});
}
@@ -150,7 +150,7 @@ class _SequenceDiagramAppState extends State<SequenceDiagramApp> {
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),
+2 -2
View File
@@ -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(),
+6 -4
View File
@@ -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<AiGenerateDialog> {
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,
+149 -81
View File
@@ -307,86 +307,127 @@ class _AppShellState extends State<AppShell> {
),
child: LayoutBuilder(
builder: (BuildContext ctx, BoxConstraints cons) {
// 响应式断点:窄于 1960 时使用紧凑布局(图标化、隐藏次要信息)。
final bool compact = cons.maxWidth < 1960;
// 左侧工具组:品牌、文件操作、撤销重做、编辑与视图切换。
final List<Widget> left = <Widget>[
const AppLogo(size: 32),
const SizedBox(width: 10),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
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<void>(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<Widget> right = <Widget>[
_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<Widget> left;
final List<Widget> right;
if (!compact) {
// 完整布局:文字按钮 + 文件状态胶囊。
left = <Widget>[
const AppLogo(size: 32),
const SizedBox(width: 10),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
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<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),
const SizedBox(width: 8),
_unitDropdown(t),
if (!compact) ...<Widget>[
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<void>(context: context, builder: (_) => const HelpDialog()), tooltip: '帮助 F1'),
_themeToggle(t),
];
} else {
// 紧凑布局:图标化 + 导出合并为菜单,尽量压缩宽度。
left = <Widget>[
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<void>(context: context, builder: (_) => ActionEditorDialog(controller: c, action: a));
}
}), tooltip: '显示 / 隐藏右侧栏'),
),
_iconBtn(t, Icons.help_outline, () =>
showDialog<void>(context: context, builder: (_) => const HelpDialog()), tooltip: '帮助 F1'),
_themeToggle(t),
];
}, tooltip: '编辑', color: t.accent),
_iconBtn(t, Icons.auto_awesome, () =>
showDialog<void>(context: context, builder: (_) => AiGenerateDialog(controller: c)),
tooltip: 'AI 生成', color: t.accent2),
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 把右侧工具组顶到最右(不再留空白);
// 空间不足时横向滚动,避免溢出。
@@ -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;
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<AppShell> {
);
}
/// 图标按钮,可附带 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<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);
// · 动作编辑、依赖编辑、工艺参数设置、帮助中心等业务对话框。
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<FileBrowserDialog> {
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<SettingsDialog> {
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<PhaseZoneDialog> {
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, <List<String>>[
<String>['软件名称', '时序图工作台 · Sequence Diagram Studio'],
<String>['软件名称', '时序图设计器 · Sequence Diagram Studio'],
<String>['设计人', '呆头鹅'],
<String>['版本', 'V1.0.0'],
<String>['版权声明', 'Copyright © 2026 呆头鹅。保留所有权利。'],
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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);
});
});
+29 -43
View File
@@ -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
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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. "时序图工作台 - <file name>").
// (e.g. "时序图设计器 - <file name>").
title_channel_ =
std::make_unique<flutter::MethodChannel<flutter::EncodableValue>>(
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(
static_cast<unsigned int>(screen_width / 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;
}
window.SetQuitOnClose(true);
Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB