display switch
This commit is contained in:
parent
8583b6b140
commit
dfb28e9e5e
@ -34,6 +34,7 @@ class FfiModel with ChangeNotifier {
|
|||||||
|
|
||||||
get permissions => _permissions;
|
get permissions => _permissions;
|
||||||
get initialized => _initialized;
|
get initialized => _initialized;
|
||||||
|
get pi => _pi;
|
||||||
|
|
||||||
FfiModel() {
|
FfiModel() {
|
||||||
clear();
|
clear();
|
||||||
@ -118,6 +119,7 @@ class FfiModel with ChangeNotifier {
|
|||||||
_display.width = int.parse(evt['width']);
|
_display.width = int.parse(evt['width']);
|
||||||
_display.height = int.parse(evt['height']);
|
_display.height = int.parse(evt['height']);
|
||||||
FFI.cursorModel.updateDisplayOrigin(_display.x, _display.y);
|
FFI.cursorModel.updateDisplayOrigin(_display.x, _display.y);
|
||||||
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
void handlePeerInfo(Map<String, dynamic> evt) {
|
void handlePeerInfo(Map<String, dynamic> evt) {
|
||||||
|
@ -279,6 +279,7 @@ class _RemotePageState extends State<RemotePage> {
|
|||||||
minWidth: 0, //wraps child's width
|
minWidth: 0, //wraps child's width
|
||||||
height: 0,
|
height: 0,
|
||||||
child: FlatButton(
|
child: FlatButton(
|
||||||
|
splashColor: Colors.black,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(5.0),
|
borderRadius: BorderRadius.circular(5.0),
|
||||||
),
|
),
|
||||||
@ -568,11 +569,45 @@ void showOptions(BuildContext context) {
|
|||||||
FFI.getByName('toggle_option', 'lock-after-session-end') == 'true';
|
FFI.getByName('toggle_option', 'lock-after-session-end') == 'true';
|
||||||
String quality = FFI.getByName('image_quality');
|
String quality = FFI.getByName('image_quality');
|
||||||
if (quality == '') quality = 'balanced';
|
if (quality == '') quality = 'balanced';
|
||||||
|
var displays = <Widget>[];
|
||||||
|
final pi = FFI.ffiModel.pi;
|
||||||
|
if (pi.displays.length > 1) {
|
||||||
|
final cur = pi.currentDisplay;
|
||||||
|
final children = <Widget>[];
|
||||||
|
for (var i = 0; i < pi.displays.length; ++i)
|
||||||
|
children.add(InkWell(
|
||||||
|
onTap: () {
|
||||||
|
if (i == cur) return;
|
||||||
|
FFI.setByName('switch_display', i.toString());
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
child: Ink(
|
||||||
|
width: 40,
|
||||||
|
height: 40,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(color: Colors.black87),
|
||||||
|
color: i == cur ? Colors.black87 : Colors.white),
|
||||||
|
child: Center(
|
||||||
|
child: Text((i + 1).toString(),
|
||||||
|
style: TextStyle(
|
||||||
|
color: i == cur ? Colors.white : Colors.black87))))));
|
||||||
|
displays.add(Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 8),
|
||||||
|
child: Wrap(
|
||||||
|
alignment: WrapAlignment.center,
|
||||||
|
spacing: 8,
|
||||||
|
children: children,
|
||||||
|
)));
|
||||||
|
displays.add(Divider(color: MyTheme.border));
|
||||||
|
}
|
||||||
showAlertDialog(
|
showAlertDialog(
|
||||||
context,
|
context,
|
||||||
(setState) => Tuple3(
|
(setState) => Tuple3(
|
||||||
null,
|
null,
|
||||||
Column(mainAxisSize: MainAxisSize.min, children: [
|
Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: displays +
|
||||||
|
<Widget>[
|
||||||
RadioListTile<String>(
|
RadioListTile<String>(
|
||||||
controlAffinity: ListTileControlAffinity.trailing,
|
controlAffinity: ListTileControlAffinity.trailing,
|
||||||
title: const Text('Good image quality'),
|
title: const Text('Good image quality'),
|
||||||
@ -609,13 +644,14 @@ void showOptions(BuildContext context) {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
Divider(color: Colors.black),
|
Divider(color: MyTheme.border),
|
||||||
CheckboxListTile(
|
CheckboxListTile(
|
||||||
value: showRemoteCursor,
|
value: showRemoteCursor,
|
||||||
onChanged: (v) {
|
onChanged: (v) {
|
||||||
setState(() {
|
setState(() {
|
||||||
showRemoteCursor = v;
|
showRemoteCursor = v;
|
||||||
FFI.setByName('toggle_option', 'show-remote-cursor');
|
FFI.setByName(
|
||||||
|
'toggle_option', 'show-remote-cursor');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
title: Text('Show remote cursor')),
|
title: Text('Show remote cursor')),
|
||||||
@ -624,7 +660,8 @@ void showOptions(BuildContext context) {
|
|||||||
onChanged: (v) {
|
onChanged: (v) {
|
||||||
setState(() {
|
setState(() {
|
||||||
lockAfterSessionEnd = v;
|
lockAfterSessionEnd = v;
|
||||||
FFI.setByName('toggle_option', 'lock-after-session-end');
|
FFI.setByName(
|
||||||
|
'toggle_option', 'lock-after-session-end');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
title: Text('Lock after session end'))
|
title: Text('Lock after session end'))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user