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:
+46
-17
@@ -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 呆头鹅。保留所有权利。'],
|
||||
|
||||
Reference in New Issue
Block a user