mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-12 11:06:57 +00:00
feat: main window custom bar & drag
Signed-off-by: Kingtous <kingtous@qq.com>
This commit is contained in:
@@ -77,7 +77,14 @@ Future<void> initEnv(String appType) async {
|
||||
}
|
||||
|
||||
void runMainApp(bool startService) async {
|
||||
await initEnv(kAppTypeMain);
|
||||
WindowOptions windowOptions = getHiddenTitleBarWindowOptions(Size(1280, 720));
|
||||
await Future.wait([
|
||||
initEnv(kAppTypeMain),
|
||||
windowManager.waitUntilReadyToShow(windowOptions, () async {
|
||||
await windowManager.show();
|
||||
await windowManager.focus();
|
||||
})
|
||||
]);
|
||||
if (startService) {
|
||||
// await windowManager.ensureInitialized();
|
||||
// disable tray
|
||||
@@ -118,13 +125,7 @@ void runFileTransferScreen(Map<String, dynamic> argument) async {
|
||||
|
||||
void runConnectionManagerScreen() async {
|
||||
// initialize window
|
||||
WindowOptions windowOptions = WindowOptions(
|
||||
size: Size(300, 400),
|
||||
center: true,
|
||||
backgroundColor: Colors.transparent,
|
||||
skipTaskbar: false,
|
||||
titleBarStyle: TitleBarStyle.normal,
|
||||
);
|
||||
WindowOptions windowOptions = getHiddenTitleBarWindowOptions(Size(300, 400));
|
||||
await Future.wait([
|
||||
initEnv(kAppTypeConnectionManager),
|
||||
windowManager.waitUntilReadyToShow(windowOptions, () async {
|
||||
@@ -134,7 +135,20 @@ void runConnectionManagerScreen() async {
|
||||
})
|
||||
]);
|
||||
;
|
||||
runApp(GetMaterialApp(theme: getCurrentTheme(), home: DesktopServerPage()));
|
||||
runApp(GetMaterialApp(
|
||||
debugShowCheckedModeBanner: false,
|
||||
theme: getCurrentTheme(),
|
||||
home: DesktopServerPage()));
|
||||
}
|
||||
|
||||
WindowOptions getHiddenTitleBarWindowOptions(Size size) {
|
||||
return WindowOptions(
|
||||
size: size,
|
||||
center: true,
|
||||
backgroundColor: Colors.transparent,
|
||||
skipTaskbar: false,
|
||||
titleBarStyle: TitleBarStyle.hidden,
|
||||
);
|
||||
}
|
||||
|
||||
class App extends StatelessWidget {
|
||||
|
||||
Reference in New Issue
Block a user