menubar dark theme elevation

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages 2023-03-15 16:57:24 +08:00
parent 1a5a358656
commit 8de35f55aa
2 changed files with 20 additions and 9 deletions

View File

@ -112,18 +112,21 @@ class ColorThemeExtension extends ThemeExtension<ColorThemeExtension> {
required this.border2, required this.border2,
required this.highlight, required this.highlight,
required this.drag_indicator, required this.drag_indicator,
required this.shadow,
}); });
final Color? border; final Color? border;
final Color? border2; final Color? border2;
final Color? highlight; final Color? highlight;
final Color? drag_indicator; final Color? drag_indicator;
final Color? shadow;
static final light = ColorThemeExtension( static final light = ColorThemeExtension(
border: Color(0xFFCCCCCC), border: Color(0xFFCCCCCC),
border2: Color(0xFFBBBBBB), border2: Color(0xFFBBBBBB),
highlight: Color(0xFFE5E5E5), highlight: Color(0xFFE5E5E5),
drag_indicator: Colors.grey[800], drag_indicator: Colors.grey[800],
shadow: Colors.black,
); );
static final dark = ColorThemeExtension( static final dark = ColorThemeExtension(
@ -131,19 +134,24 @@ class ColorThemeExtension extends ThemeExtension<ColorThemeExtension> {
border2: Color(0xFFE5E5E5), border2: Color(0xFFE5E5E5),
highlight: Color(0xFF3F3F3F), highlight: Color(0xFF3F3F3F),
drag_indicator: Colors.grey, drag_indicator: Colors.grey,
shadow: Colors.grey,
); );
@override @override
ThemeExtension<ColorThemeExtension> copyWith( ThemeExtension<ColorThemeExtension> copyWith({
{Color? border, Color? border,
Color? border2, Color? border2,
Color? highlight, Color? highlight,
Color? drag_indicator}) { Color? drag_indicator,
Color? shadow,
}) {
return ColorThemeExtension( return ColorThemeExtension(
border: border ?? this.border, border: border ?? this.border,
border2: border2 ?? this.border2, border2: border2 ?? this.border2,
highlight: highlight ?? this.highlight, highlight: highlight ?? this.highlight,
drag_indicator: drag_indicator ?? this.drag_indicator); drag_indicator: drag_indicator ?? this.drag_indicator,
shadow: shadow ?? this.shadow,
);
} }
@override @override
@ -157,6 +165,7 @@ class ColorThemeExtension extends ThemeExtension<ColorThemeExtension> {
border2: Color.lerp(border2, other.border2, t), border2: Color.lerp(border2, other.border2, t),
highlight: Color.lerp(highlight, other.highlight, t), highlight: Color.lerp(highlight, other.highlight, t),
drag_indicator: Color.lerp(drag_indicator, other.drag_indicator, t), drag_indicator: Color.lerp(drag_indicator, other.drag_indicator, t),
shadow: Color.lerp(shadow, other.shadow, t),
); );
} }
} }

View File

@ -372,6 +372,7 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
offstage: _dragging.isTrue, offstage: _dragging.isTrue,
child: Material( child: Material(
elevation: _MenubarTheme.elevation, elevation: _MenubarTheme.elevation,
shadowColor: MyTheme.color(context).shadow,
child: _DraggableShowHide( child: _DraggableShowHide(
dragging: _dragging, dragging: _dragging,
fractionX: _fractionX, fractionX: _fractionX,
@ -412,6 +413,7 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
children: [ children: [
Material( Material(
elevation: _MenubarTheme.elevation, elevation: _MenubarTheme.elevation,
shadowColor: MyTheme.color(context).shadow,
borderRadius: BorderRadius.all(Radius.circular(4.0)), borderRadius: BorderRadius.all(Radius.circular(4.0)),
color: Theme.of(context) color: Theme.of(context)
.menuBarTheme .menuBarTheme