mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-19 17:31:29 +03:00
refact, separate remote window, tmp commit
Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_hbb/common.dart';
|
||||
import 'package:flutter_hbb/consts.dart';
|
||||
import 'package:flutter_hbb/utils/multi_window_manager.dart';
|
||||
import 'package:flutter_hbb/desktop/pages/desktop_home_page.dart';
|
||||
import 'package:flutter_hbb/desktop/pages/desktop_tab_page.dart';
|
||||
import 'package:flutter_hbb/models/platform_model.dart';
|
||||
@@ -248,7 +249,7 @@ class _General extends StatefulWidget {
|
||||
|
||||
class _GeneralState extends State<_General> {
|
||||
final RxBool serviceStop = Get.find<RxBool>(tag: 'stop-service');
|
||||
RxBool serviceBtnEabled = true.obs;
|
||||
RxBool serviceBtnEnabled = true.obs;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -300,14 +301,14 @@ class _GeneralState extends State<_General> {
|
||||
return _Card(title: 'Service', children: [
|
||||
Obx(() => _Button(serviceStop.value ? 'Start' : 'Stop', () {
|
||||
() async {
|
||||
serviceBtnEabled.value = false;
|
||||
serviceBtnEnabled.value = false;
|
||||
await start_service(serviceStop.value);
|
||||
// enable the button after 1 second
|
||||
Future.delayed(const Duration(seconds: 1), () {
|
||||
serviceBtnEabled.value = true;
|
||||
serviceBtnEnabled.value = true;
|
||||
});
|
||||
}();
|
||||
}, enabled: serviceBtnEabled.value))
|
||||
}, enabled: serviceBtnEnabled.value))
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -318,7 +319,14 @@ class _GeneralState extends State<_General> {
|
||||
isServer: false),
|
||||
_OptionCheckBox(context, 'Adaptive Bitrate', 'enable-abr'),
|
||||
_OptionCheckBox(
|
||||
context, 'Separate remote window', kOptionSeparateRemoteWindow, isServer: false),
|
||||
context,
|
||||
'Separate remote window',
|
||||
kOptionSeparateRemoteWindow,
|
||||
isServer: false,
|
||||
update: () {
|
||||
rustDeskWinManager.separateWindows();
|
||||
},
|
||||
),
|
||||
];
|
||||
// though this is related to GUI, but opengl problem affects all users, so put in config rather than local
|
||||
children.add(Tooltip(
|
||||
@@ -1678,7 +1686,6 @@ Widget _OptionCheckBox(BuildContext context, String label, String key,
|
||||
isServer
|
||||
? await mainSetBoolOption(key, option)
|
||||
: await mainSetLocalBoolOption(key, option);
|
||||
;
|
||||
update?.call();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user