fix: 修改限制尺寸
This commit is contained in:
parent
9b5e370f0b
commit
2d1f391932
@ -23,6 +23,7 @@ import '../../utils/kr_log_util.dart';
|
|||||||
import '../../utils/kr_secure_storage.dart';
|
import '../../utils/kr_secure_storage.dart';
|
||||||
import '../../utils/kr_windows_dns_util.dart';
|
import '../../utils/kr_windows_dns_util.dart';
|
||||||
import '../../common/app_run_data.dart';
|
import '../../common/app_run_data.dart';
|
||||||
|
import '../../common/app_config.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
|
|
||||||
enum KRConnectionType {
|
enum KRConnectionType {
|
||||||
|
|||||||
@ -25,9 +25,9 @@ class KRWindowManager with WindowListener, TrayListener {
|
|||||||
KRLogUtil.kr_i('kr_initWindowManager: 窗口管理器已初始化');
|
KRLogUtil.kr_i('kr_initWindowManager: 窗口管理器已初始化');
|
||||||
|
|
||||||
const WindowOptions windowOptions = WindowOptions(
|
const WindowOptions windowOptions = WindowOptions(
|
||||||
size: Size(420, 800),
|
size: Size(375, 800),
|
||||||
minimumSize: Size(420, 800),
|
minimumSize: Size(375, 600),
|
||||||
maximumSize: Size(420, 800),
|
maximumSize: Size(420, 900),
|
||||||
center: true,
|
center: true,
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
skipTaskbar: false,
|
skipTaskbar: false,
|
||||||
@ -47,20 +47,20 @@ class KRWindowManager with WindowListener, TrayListener {
|
|||||||
if (Platform.isWindows) {
|
if (Platform.isWindows) {
|
||||||
await windowManager.setTitleBarStyle(TitleBarStyle.normal);
|
await windowManager.setTitleBarStyle(TitleBarStyle.normal);
|
||||||
await windowManager.setTitle('HiFastVPN');
|
await windowManager.setTitle('HiFastVPN');
|
||||||
await windowManager.setSize(const Size(420, 800));
|
await windowManager.setSize(const Size(375, 800));
|
||||||
await windowManager.setMinimumSize(const Size(420, 800));
|
await windowManager.setMinimumSize(const Size(375, 600));
|
||||||
await windowManager.setMaximumSize(const Size(420, 800));
|
await windowManager.setMaximumSize(const Size(420, 900));
|
||||||
await windowManager.setResizable(false);
|
await windowManager.setResizable(true);
|
||||||
await windowManager.center();
|
await windowManager.center();
|
||||||
await windowManager.show();
|
await windowManager.show();
|
||||||
// 阻止窗口关闭
|
// 阻止窗口关闭
|
||||||
await windowManager.setPreventClose(true);
|
await windowManager.setPreventClose(true);
|
||||||
} else {
|
} else {
|
||||||
await windowManager.setTitle('HiFastVPN');
|
await windowManager.setTitle('HiFastVPN');
|
||||||
await windowManager.setSize(const Size(420, 800));
|
await windowManager.setSize(const Size(375, 800));
|
||||||
await windowManager.setMinimumSize(const Size(420, 800));
|
await windowManager.setMinimumSize(const Size(375, 600));
|
||||||
await windowManager.setMaximumSize(const Size(420, 800));
|
await windowManager.setMaximumSize(const Size(420, 900));
|
||||||
await windowManager.setResizable(false);
|
await windowManager.setResizable(true);
|
||||||
await windowManager.center();
|
await windowManager.center();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -139,7 +139,12 @@ Widget _myApp(GetxTranslations translations, Locale initialLocale) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 使用 Stack 布局来设置背景
|
// 使用 Stack 布局来设置背景
|
||||||
return Stack(
|
return ColoredBox(
|
||||||
|
color: Colors.black, // 超出宽度的区域显示黑色背景
|
||||||
|
child: Center(
|
||||||
|
child: ConstrainedBox(
|
||||||
|
constraints: const BoxConstraints(maxWidth: 450), // 限制最大宽度
|
||||||
|
child: Stack(
|
||||||
fit: StackFit.expand,
|
fit: StackFit.expand,
|
||||||
children: [
|
children: [
|
||||||
// 背景层:使用您的自定义组件
|
// 背景层:使用您的自定义组件
|
||||||
@ -156,6 +161,9 @@ Widget _myApp(GetxTranslations translations, Locale initialLocale) {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
theme: KRThemeService().kr_lightTheme(),
|
theme: KRThemeService().kr_lightTheme(),
|
||||||
|
|||||||
@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
|||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
# In Windows, build-name is used as the major, minor, and patch parts
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
# of the product and file versions while build-number is used as the build suffix.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 1.0.0+100
|
version: 1.0.0+101
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=3.5.0 <4.0.0"
|
sdk: ">=3.5.0 <4.0.0"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user