From 88e1245d101cdb595997d3a9f832f406bb4c8e51 Mon Sep 17 00:00:00 2001 From: dignow Date: Wed, 13 Sep 2023 21:02:21 +0800 Subject: [PATCH] fix, set scrollbar thickness to 12 Signed-off-by: dignow --- flutter/lib/common.dart | 13 ++++++++++--- flutter/lib/consts.dart | 2 ++ flutter/lib/desktop/pages/remote_page.dart | 2 ++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index fbbe6e254..a71bd12b9 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -265,6 +265,14 @@ class MyTheme { ? EdgeInsets.only(left: dialogPadding) : EdgeInsets.only(left: dialogPadding / 3); + static ScrollbarThemeData scrollbarTheme = ScrollbarThemeData( + thickness: MaterialStateProperty.all(kScrollbarThickness), + ); + + static ScrollbarThemeData scrollbarThemeDark = scrollbarTheme.copyWith( + thumbColor: MaterialStateProperty.all(Colors.grey[500]), + ); + static ThemeData lightTheme = ThemeData( brightness: Brightness.light, hoverColor: Color.fromARGB(255, 224, 224, 224), @@ -280,6 +288,7 @@ class MyTheme { ), ), ), + scrollbarTheme: scrollbarTheme, inputDecorationTheme: isDesktop ? InputDecorationTheme( fillColor: grayBg, @@ -364,6 +373,7 @@ class MyTheme { ), ), ), + scrollbarTheme: scrollbarThemeDark, inputDecorationTheme: isDesktop ? InputDecorationTheme( fillColor: Color(0xFF24252B), @@ -390,9 +400,6 @@ class MyTheme { tabBarTheme: const TabBarTheme( labelColor: Colors.white70, ), - scrollbarTheme: ScrollbarThemeData( - thumbColor: MaterialStateProperty.all(Colors.grey[500]), - ), tooltipTheme: tooltipTheme(), splashColor: isDesktop ? Colors.transparent : null, highlightColor: isDesktop ? Colors.transparent : null, diff --git a/flutter/lib/consts.dart b/flutter/lib/consts.dart index 24a9b3fad..c682f9fac 100644 --- a/flutter/lib/consts.dart +++ b/flutter/lib/consts.dart @@ -13,6 +13,8 @@ const String kPeerPlatformLinux = "Linux"; const String kPeerPlatformMacOS = "Mac OS"; const String kPeerPlatformAndroid = "Android"; +const double kScrollbarThickness = 12.0; + /// [kAppTypeMain] used by 'Desktop Main Page' , 'Mobile (Client and Server)', "Install Page" const String kAppTypeMain = "main"; diff --git a/flutter/lib/desktop/pages/remote_page.dart b/flutter/lib/desktop/pages/remote_page.dart index f265f1895..86d4b05bb 100644 --- a/flutter/lib/desktop/pages/remote_page.dart +++ b/flutter/lib/desktop/pages/remote_page.dart @@ -694,6 +694,7 @@ class _ImagePaintState extends State { enableCustomMouseWheelScrolling: cursorOverImage.isFalse, customMouseWheelScrollConfig: scrollConfig, child: RawScrollbar( + thickness: kScrollbarThickness, thumbColor: Colors.grey, controller: _horizontal, thumbVisibility: false, @@ -711,6 +712,7 @@ class _ImagePaintState extends State { enableCustomMouseWheelScrolling: cursorOverImage.isFalse, customMouseWheelScrollConfig: scrollConfig, child: RawScrollbar( + thickness: kScrollbarThickness, thumbColor: Colors.grey, controller: _vertical, thumbVisibility: false,