From 8de35f55aad1bdb3660b938439b2fc2208874438 Mon Sep 17 00:00:00 2001 From: 21pages Date: Wed, 15 Mar 2023 16:57:24 +0800 Subject: [PATCH] menubar dark theme elevation Signed-off-by: 21pages --- flutter/lib/common.dart | 27 ++++++++++++------- .../lib/desktop/widgets/remote_menubar.dart | 2 ++ 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 21dc427cc..3138dd14d 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -112,18 +112,21 @@ class ColorThemeExtension extends ThemeExtension { required this.border2, required this.highlight, required this.drag_indicator, + required this.shadow, }); final Color? border; final Color? border2; final Color? highlight; final Color? drag_indicator; + final Color? shadow; static final light = ColorThemeExtension( border: Color(0xFFCCCCCC), border2: Color(0xFFBBBBBB), highlight: Color(0xFFE5E5E5), drag_indicator: Colors.grey[800], + shadow: Colors.black, ); static final dark = ColorThemeExtension( @@ -131,19 +134,24 @@ class ColorThemeExtension extends ThemeExtension { border2: Color(0xFFE5E5E5), highlight: Color(0xFF3F3F3F), drag_indicator: Colors.grey, + shadow: Colors.grey, ); @override - ThemeExtension copyWith( - {Color? border, - Color? border2, - Color? highlight, - Color? drag_indicator}) { + ThemeExtension copyWith({ + Color? border, + Color? border2, + Color? highlight, + Color? drag_indicator, + Color? shadow, + }) { return ColorThemeExtension( - border: border ?? this.border, - border2: border2 ?? this.border2, - highlight: highlight ?? this.highlight, - drag_indicator: drag_indicator ?? this.drag_indicator); + border: border ?? this.border, + border2: border2 ?? this.border2, + highlight: highlight ?? this.highlight, + drag_indicator: drag_indicator ?? this.drag_indicator, + shadow: shadow ?? this.shadow, + ); } @override @@ -157,6 +165,7 @@ class ColorThemeExtension extends ThemeExtension { border2: Color.lerp(border2, other.border2, t), highlight: Color.lerp(highlight, other.highlight, t), drag_indicator: Color.lerp(drag_indicator, other.drag_indicator, t), + shadow: Color.lerp(shadow, other.shadow, t), ); } } diff --git a/flutter/lib/desktop/widgets/remote_menubar.dart b/flutter/lib/desktop/widgets/remote_menubar.dart index d1189abe4..01e41609b 100644 --- a/flutter/lib/desktop/widgets/remote_menubar.dart +++ b/flutter/lib/desktop/widgets/remote_menubar.dart @@ -372,6 +372,7 @@ class _RemoteMenubarState extends State { offstage: _dragging.isTrue, child: Material( elevation: _MenubarTheme.elevation, + shadowColor: MyTheme.color(context).shadow, child: _DraggableShowHide( dragging: _dragging, fractionX: _fractionX, @@ -412,6 +413,7 @@ class _RemoteMenubarState extends State { children: [ Material( elevation: _MenubarTheme.elevation, + shadowColor: MyTheme.color(context).shadow, borderRadius: BorderRadius.all(Radius.circular(4.0)), color: Theme.of(context) .menuBarTheme