mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-16 04:56:18 +00:00
@@ -4,6 +4,7 @@ import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:auto_size_text/auto_size_text.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hbb/common/widgets/address_book.dart';
|
||||
import 'package:flutter_hbb/consts.dart';
|
||||
@@ -177,12 +178,15 @@ class _ConnectionPageState extends State<ConnectionPage>
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
translate('Control Remote Desktop'),
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleLarge
|
||||
?.merge(TextStyle(height: 1)),
|
||||
Expanded(
|
||||
child: AutoSizeText(
|
||||
translate('Control Remote Desktop'),
|
||||
maxLines: 1,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleLarge
|
||||
?.merge(TextStyle(height: 1)),
|
||||
),
|
||||
),
|
||||
],
|
||||
).marginOnly(bottom: 15),
|
||||
|
||||
@@ -658,13 +658,9 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
|
||||
initialKey: modeInitialKey,
|
||||
onChanged: (key) => model.setApproveMode(key),
|
||||
).marginOnly(left: _kContentHMargin),
|
||||
Offstage(
|
||||
offstage: !usePassword,
|
||||
child: radios[0],
|
||||
),
|
||||
Offstage(
|
||||
offstage: !usePassword,
|
||||
child: _SubLabeledWidget(
|
||||
if (usePassword) radios[0],
|
||||
if (usePassword)
|
||||
_SubLabeledWidget(
|
||||
'One-time password length',
|
||||
Row(
|
||||
children: [
|
||||
@@ -672,20 +668,13 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
|
||||
],
|
||||
),
|
||||
enabled: tmpEnabled && !locked),
|
||||
),
|
||||
Offstage(
|
||||
offstage: !usePassword,
|
||||
child: radios[1],
|
||||
),
|
||||
Offstage(
|
||||
offstage: !usePassword,
|
||||
child: _SubButton('Set permanent password', setPasswordDialog,
|
||||
if (usePassword) radios[1],
|
||||
if (usePassword)
|
||||
_SubButton('Set permanent password', setPasswordDialog,
|
||||
permEnabled && !locked),
|
||||
),
|
||||
Offstage(
|
||||
offstage: !usePassword,
|
||||
child: radios[2],
|
||||
),
|
||||
if (usePassword)
|
||||
hide_cm(!locked).marginOnly(left: _kContentHSubMargin - 6),
|
||||
if (usePassword) radios[2],
|
||||
]);
|
||||
})));
|
||||
}
|
||||
@@ -814,6 +803,46 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
|
||||
).marginOnly(left: _kCheckBoxLeftMargin);
|
||||
});
|
||||
}
|
||||
|
||||
Widget hide_cm(bool enabled) {
|
||||
return ChangeNotifierProvider.value(
|
||||
value: gFFI.serverModel,
|
||||
child: Consumer<ServerModel>(builder: (context, model, child) {
|
||||
final enableHideCm = model.approveMode == 'password' &&
|
||||
model.verificationMethod == kUsePermanentPassword;
|
||||
onHideCmChanged(bool? b) {
|
||||
if (b != null) {
|
||||
bind.mainSetOption(
|
||||
key: 'allow-hide-cm', value: bool2option('allow-hide-cm', b));
|
||||
}
|
||||
}
|
||||
|
||||
return Tooltip(
|
||||
message: enableHideCm ? "" : translate('hide_cm_tip'),
|
||||
child: GestureDetector(
|
||||
onTap:
|
||||
enableHideCm ? () => onHideCmChanged(!model.hideCm) : null,
|
||||
child: Row(
|
||||
children: [
|
||||
Checkbox(
|
||||
value: model.hideCm,
|
||||
onChanged: enabled && enableHideCm
|
||||
? onHideCmChanged
|
||||
: null)
|
||||
.marginOnly(right: 5),
|
||||
Expanded(
|
||||
child: Text(
|
||||
translate('Hide connection management window'),
|
||||
style: TextStyle(
|
||||
color: _disabledTextColor(
|
||||
context, enabled && enableHideCm)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
));
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
class _Network extends StatefulWidget {
|
||||
|
||||
Reference in New Issue
Block a user