hide empty waiting layer after images are reached
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
dade589075
commit
f2d96b895f
@ -234,6 +234,8 @@ class _RemotePageState extends State<RemotePage>
|
|||||||
bind.sessionInputOsPassword(sessionId: sessionId, value: '');
|
bind.sessionInputOsPassword(sessionId: sessionId, value: '');
|
||||||
},
|
},
|
||||||
child: BlockableOverlay(
|
child: BlockableOverlay(
|
||||||
|
/// the Overlay key will be set with _blockableOverlayState in BlockableOverlay
|
||||||
|
/// see override build() in [BlockableOverlay]
|
||||||
state: _blockableOverlayState,
|
state: _blockableOverlayState,
|
||||||
underlying: Container(
|
underlying: Container(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
@ -244,9 +246,6 @@ class _RemotePageState extends State<RemotePage>
|
|||||||
Widget buildBody(BuildContext context) {
|
Widget buildBody(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Theme.of(context).colorScheme.background,
|
backgroundColor: Theme.of(context).colorScheme.background,
|
||||||
|
|
||||||
/// the Overlay key will be set with _blockableOverlayState in BlockableOverlay
|
|
||||||
/// see override build() in [BlockableOverlay]
|
|
||||||
body: Stack(
|
body: Stack(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
@ -273,7 +272,11 @@ class _RemotePageState extends State<RemotePage>
|
|||||||
},
|
},
|
||||||
inputModel: _ffi.inputModel,
|
inputModel: _ffi.inputModel,
|
||||||
child: getBodyForDesktop(context))),
|
child: getBodyForDesktop(context))),
|
||||||
emptyOverlay(),
|
Obx(
|
||||||
|
() => _ffi.ffiModel.waitForFirstImage.isTrue
|
||||||
|
? emptyOverlay()
|
||||||
|
: Offstage(),
|
||||||
|
),
|
||||||
RemoteToolbar(
|
RemoteToolbar(
|
||||||
id: widget.id,
|
id: widget.id,
|
||||||
ffi: _ffi,
|
ffi: _ffi,
|
||||||
|
@ -38,8 +38,6 @@ import 'platform_model.dart';
|
|||||||
|
|
||||||
typedef HandleMsgBox = Function(Map<String, dynamic> evt, String id);
|
typedef HandleMsgBox = Function(Map<String, dynamic> evt, String id);
|
||||||
typedef ReconnectHandle = Function(OverlayDialogManager, SessionID, bool);
|
typedef ReconnectHandle = Function(OverlayDialogManager, SessionID, bool);
|
||||||
final _waitForImageDialogShow = <UuidValue, bool>{};
|
|
||||||
final _waitForFirstImage = <UuidValue, bool>{};
|
|
||||||
final _constSessionId = Uuid().v4obj();
|
final _constSessionId = Uuid().v4obj();
|
||||||
|
|
||||||
class CachedPeerData {
|
class CachedPeerData {
|
||||||
@ -100,6 +98,9 @@ class FfiModel with ChangeNotifier {
|
|||||||
WeakReference<FFI> parent;
|
WeakReference<FFI> parent;
|
||||||
late final SessionID sessionId;
|
late final SessionID sessionId;
|
||||||
|
|
||||||
|
RxBool waitForImageDialogShow = true.obs;
|
||||||
|
RxBool waitForFirstImage = true.obs;
|
||||||
|
|
||||||
Map<String, bool> get permissions => _permissions;
|
Map<String, bool> get permissions => _permissions;
|
||||||
|
|
||||||
Display get display => _display;
|
Display get display => _display;
|
||||||
@ -498,7 +499,7 @@ class FfiModel with ChangeNotifier {
|
|||||||
closeConnection();
|
closeConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_waitForFirstImage[sessionId] == false) return;
|
if (waitForFirstImage.isFalse) return;
|
||||||
dialogManager.show(
|
dialogManager.show(
|
||||||
(setState, close, context) => CustomAlertDialog(
|
(setState, close, context) => CustomAlertDialog(
|
||||||
title: null,
|
title: null,
|
||||||
@ -509,7 +510,7 @@ class FfiModel with ChangeNotifier {
|
|||||||
onCancel: onClose),
|
onCancel: onClose),
|
||||||
tag: '$sessionId-waiting-for-image',
|
tag: '$sessionId-waiting-for-image',
|
||||||
);
|
);
|
||||||
_waitForImageDialogShow[sessionId] = true;
|
waitForImageDialogShow.value = true;
|
||||||
bind.sessionOnWaitingForImageDialogShow(sessionId: sessionId);
|
bind.sessionOnWaitingForImageDialogShow(sessionId: sessionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -578,7 +579,7 @@ class FfiModel with ChangeNotifier {
|
|||||||
}
|
}
|
||||||
if (displays.isNotEmpty) {
|
if (displays.isNotEmpty) {
|
||||||
_reconnects = 1;
|
_reconnects = 1;
|
||||||
_waitForFirstImage[sessionId] = true;
|
waitForFirstImage.value = true;
|
||||||
}
|
}
|
||||||
Map<String, dynamic> features = json.decode(evt['features']);
|
Map<String, dynamic> features = json.decode(evt['features']);
|
||||||
_pi.features.privacyMode = features['privacy_mode'] == 1;
|
_pi.features.privacyMode = features['privacy_mode'] == 1;
|
||||||
@ -1814,12 +1815,12 @@ class FFI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void onEvent2UIRgba() async {
|
void onEvent2UIRgba() async {
|
||||||
if (_waitForImageDialogShow[sessionId] == true) {
|
if (ffiModel.waitForImageDialogShow.isTrue) {
|
||||||
_waitForImageDialogShow[sessionId] = false;
|
ffiModel.waitForImageDialogShow.value = false;
|
||||||
clearWaitingForImage(dialogManager, sessionId);
|
clearWaitingForImage(dialogManager, sessionId);
|
||||||
}
|
}
|
||||||
if (_waitForFirstImage[sessionId] == true) {
|
if (ffiModel.waitForFirstImage.value == true) {
|
||||||
_waitForFirstImage[sessionId] = false;
|
ffiModel.waitForFirstImage.value = false;
|
||||||
dialogManager.dismissAll();
|
dialogManager.dismissAll();
|
||||||
await canvasModel.updateViewStyle();
|
await canvasModel.updateViewStyle();
|
||||||
await canvasModel.updateScrollStyle();
|
await canvasModel.updateScrollStyle();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user