mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
feat: record window position (#692)
This commit is contained in:
@@ -53,15 +53,7 @@ Future<void> _initApp() async {
|
||||
await Paths.init(BuildData.name, bakName: 'srvbox_bak.json');
|
||||
await _initData();
|
||||
_setupDebug();
|
||||
|
||||
final windowSize = Stores.setting.windowSize;
|
||||
final hideTitleBar = Stores.setting.hideTitleBar.fetch();
|
||||
await SystemUIs.initDesktopWindow(
|
||||
hideTitleBar: hideTitleBar,
|
||||
size: windowSize.fetch().toSize(),
|
||||
listener: WindowSizeListener(windowSize),
|
||||
);
|
||||
|
||||
_initWindow();
|
||||
FontUtils.loadFrom(Stores.setting.fontPath.fetch());
|
||||
|
||||
_doPlatformRelated();
|
||||
@@ -130,3 +122,16 @@ Future<void> _doVersionRelated() async {
|
||||
Stores.setting.lastVer.put(newVer);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _initWindow() async {
|
||||
if (!isDesktop) return;
|
||||
final windowStateProp = Stores.setting.windowState;
|
||||
final windowState = windowStateProp.fetch();
|
||||
final hideTitleBar = Stores.setting.hideTitleBar.fetch();
|
||||
await SystemUIs.initDesktopWindow(
|
||||
hideTitleBar: hideTitleBar,
|
||||
size: windowState?.size,
|
||||
position: windowState?.position,
|
||||
listener: WindowStateListener(windowStateProp),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user