This commit is contained in:
open-trade 2020-11-28 13:34:59 +08:00
parent 6a5454f72a
commit d57a0c85d8

View File

@ -642,83 +642,92 @@ void showOptions(BuildContext context) {
))); )));
displays.add(Divider(color: MyTheme.border)); displays.add(Divider(color: MyTheme.border));
} }
showAlertDialog( showAlertDialog(context, (setState) {
context, final more = [];
(setState) => Tuple3( if (FFI.ffiModel.permissions['audio'] != false) {
null, more.add(CheckboxListTile(
Column( value: FFI.getByName('toggle_option', 'disable-audio') == 'true',
mainAxisSize: MainAxisSize.min, onChanged: (v) {
children: displays + setState(() {
<Widget>[ lockAfterSessionEnd = v;
RadioListTile<String>( FFI.setByName('toggle_option', 'disable-audio');
controlAffinity: ListTileControlAffinity.trailing, });
title: const Text('Good image quality'), },
value: 'best', title: Text('Mute')));
groupValue: quality, }
onChanged: (String value) { return Tuple3(
null,
Column(
mainAxisSize: MainAxisSize.min,
children: displays +
<Widget>[
RadioListTile<String>(
controlAffinity: ListTileControlAffinity.trailing,
title: const Text('Good image quality'),
value: 'best',
groupValue: quality,
onChanged: (String value) {
setState(() {
quality = value;
FFI.setByName('image_quality', value);
});
},
),
RadioListTile<String>(
controlAffinity: ListTileControlAffinity.trailing,
title: const Text('Balanced'),
value: 'balanced',
groupValue: quality,
onChanged: (String value) {
setState(() {
quality = value;
FFI.setByName('image_quality', value);
});
},
),
RadioListTile<String>(
controlAffinity: ListTileControlAffinity.trailing,
title: const Text('Optimize reaction time'),
value: 'low',
groupValue: quality,
onChanged: (String value) {
setState(() {
quality = value;
FFI.setByName('image_quality', value);
});
},
),
Divider(color: MyTheme.border),
CheckboxListTile(
value: showRemoteCursor,
onChanged: (v) {
setState(() { setState(() {
quality = value; showRemoteCursor = v;
FFI.setByName('image_quality', value); FFI.setByName('toggle_option', 'show-remote-cursor');
}); });
}, },
), title: Text('Show remote cursor')),
RadioListTile<String>( CheckboxListTile(
controlAffinity: ListTileControlAffinity.trailing, value: lockAfterSessionEnd,
title: const Text('Balanced'), onChanged: (v) {
value: 'balanced',
groupValue: quality,
onChanged: (String value) {
setState(() { setState(() {
quality = value; lockAfterSessionEnd = v;
FFI.setByName('image_quality', value); FFI.setByName(
'toggle_option', 'lock-after-session-end');
}); });
}, },
), title: Text('Lock after session end'))
RadioListTile<String>( ] +
controlAffinity: ListTileControlAffinity.trailing, more),
title: const Text('Optimize reaction time'), null);
value: 'low', }, () async => true, true, 0);
groupValue: quality,
onChanged: (String value) {
setState(() {
quality = value;
FFI.setByName('image_quality', value);
});
},
),
Divider(color: MyTheme.border),
CheckboxListTile(
value: showRemoteCursor,
onChanged: (v) {
setState(() {
showRemoteCursor = v;
FFI.setByName(
'toggle_option', 'show-remote-cursor');
});
},
title: Text('Show remote cursor')),
CheckboxListTile(
value: lockAfterSessionEnd,
onChanged: (v) {
setState(() {
lockAfterSessionEnd = v;
FFI.setByName(
'toggle_option', 'lock-after-session-end');
});
},
title: Text('Lock after session end'))
]),
null),
() async => true,
true,
0);
} }
void showActions(BuildContext context) { void showActions(BuildContext context) {
final size = MediaQuery.of(context).size; final size = MediaQuery.of(context).size;
final x = 120.0; final x = 120.0;
final y = size.height; final y = size.height;
var more = <Widget>[]; final more = <Widget>[];
if (FFI.ffiModel.pi.version.isNotEmpty) { if (FFI.ffiModel.pi.version.isNotEmpty) {
more.add(PopupMenuItem<String>(child: Text('Refresh'), value: 'refresh')); more.add(PopupMenuItem<String>(child: Text('Refresh'), value: 'refresh'));
} }