From 9ce62dc5843b772cdeec71adfdc15210b2bddcc1 Mon Sep 17 00:00:00 2001 From: fufesou <13586388+fufesou@users.noreply.github.com> Date: Mon, 27 May 2024 09:29:31 +0800 Subject: [PATCH] fix: window backgroud color (#8155) Signed-off-by: fufesou --- flutter/lib/consts.dart | 1 + flutter/lib/desktop/pages/remote_page.dart | 2 +- flutter/lib/desktop/widgets/tabbar_widget.dart | 7 ++++++- flutter/lib/mobile/pages/remote_page.dart | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/flutter/lib/consts.dart b/flutter/lib/consts.dart index f9caac94d..be8ee3c17 100644 --- a/flutter/lib/consts.dart +++ b/flutter/lib/consts.dart @@ -157,6 +157,7 @@ const String kKeyReverseMouseWheel = "reverse_mouse_wheel"; const String kEnvPortableExecutable = "RUSTDESK_APPNAME"; const Color kColorWarn = Color.fromARGB(255, 245, 133, 59); +const Color kColorCanvas = Colors.black; const int kMobileDefaultDisplayWidth = 720; const int kMobileDefaultDisplayHeight = 1280; diff --git a/flutter/lib/desktop/pages/remote_page.dart b/flutter/lib/desktop/pages/remote_page.dart index d8a3c5b60..6fe256cf6 100644 --- a/flutter/lib/desktop/pages/remote_page.dart +++ b/flutter/lib/desktop/pages/remote_page.dart @@ -279,7 +279,7 @@ class _RemotePageState extends State return Stack( children: [ Container( - color: Colors.black, + color: kColorCanvas, child: RawKeyFocusScope( focusNode: _rawKeyFocusNode, onFocusChange: (bool imageFocused) { diff --git a/flutter/lib/desktop/widgets/tabbar_widget.dart b/flutter/lib/desktop/widgets/tabbar_widget.dart index 27bae1a29..0016f8fb3 100644 --- a/flutter/lib/desktop/widgets/tabbar_widget.dart +++ b/flutter/lib/desktop/widgets/tabbar_widget.dart @@ -334,7 +334,7 @@ class DesktopTab extends StatelessWidget { List _tabWidgets = []; Widget _buildPageView() { - return _buildBlock( + final child = _buildBlock( child: Obx(() => PageView( controller: state.value.pageController, physics: NeverScrollableScrollPhysics(), @@ -358,6 +358,11 @@ class DesktopTab extends StatelessWidget { return newList; } }()))); + if (tabType == DesktopTabType.remoteScreen) { + return Container(color: kColorCanvas, child: child); + } else { + return child; + } } /// Check whether to show ListView diff --git a/flutter/lib/mobile/pages/remote_page.dart b/flutter/lib/mobile/pages/remote_page.dart index a73f45fee..ca7b909e8 100644 --- a/flutter/lib/mobile/pages/remote_page.dart +++ b/flutter/lib/mobile/pages/remote_page.dart @@ -312,7 +312,7 @@ class _RemotePageState extends State { initialEntries: [ OverlayEntry(builder: (context) { return Container( - color: Colors.black, + color: kColorCanvas, child: isWebDesktop ? getBodyForDesktopWithListener(keyboard) : SafeArea(