From 3148ab214a6730e628f1c60955e0a29c33ba8289 Mon Sep 17 00:00:00 2001 From: dignow Date: Sun, 9 Jul 2023 12:48:28 +0800 Subject: [PATCH] refact, remote toolbar menu, windows Signed-off-by: dignow --- .../lib/desktop/widgets/remote_toolbar.dart | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/flutter/lib/desktop/widgets/remote_toolbar.dart b/flutter/lib/desktop/widgets/remote_toolbar.dart index b25118c40..badf04445 100644 --- a/flutter/lib/desktop/widgets/remote_toolbar.dart +++ b/flutter/lib/desktop/widgets/remote_toolbar.dart @@ -120,6 +120,10 @@ class _ToolbarTheme { static const Color dividerDark = MyTheme.dividerDark; static const Color dividerLight = MyTheme.dividerLight; static const double dividerSpaceToAction = 8; + + static const double menuBorderRadius = 5.0; + static EdgeInsets menuPadding = Platform.isWindows ? EdgeInsets.fromLTRB(4, 12, 4, 12) : EdgeInsets.fromLTRB(6, 18, 6, 18); + static const double menuButtonBorderRadius = 3.0; } typedef DismissFunc = void Function(); @@ -484,6 +488,8 @@ class _RemoteToolbarState extends State { textStyle: MaterialStatePropertyAll( TextStyle(fontWeight: FontWeight.normal), ), + shape: MaterialStatePropertyAll(RoundedRectangleBorder( + borderRadius: BorderRadius.circular(_ToolbarTheme.menuButtonBorderRadius))), ), ), dividerTheme: DividerThemeData( @@ -1651,14 +1657,15 @@ class _IconSubmenuButtonState extends State<_IconSubmenuButton> { child: SubmenuButton( menuStyle: widget.menuStyle ?? MenuStyle( - side: MaterialStateProperty.all(BorderSide( - width: 1, - color: MyTheme.currentThemeMode() == ThemeMode.light - ? _ToolbarTheme.bordLight - : _ToolbarTheme.bordDark, - )), - visualDensity: VisualDensity.comfortable, - ), + side: MaterialStateProperty.all(BorderSide( + width: 1, + color: MyTheme.currentThemeMode() == ThemeMode.light + ? _ToolbarTheme.bordLight + : _ToolbarTheme.bordDark, + )), + shape: MaterialStatePropertyAll(RoundedRectangleBorder( + borderRadius: BorderRadius.circular(_ToolbarTheme.menuBorderRadius))), + padding: MaterialStateProperty.all(_ToolbarTheme.menuPadding)), style: ButtonStyle( backgroundColor: MaterialStatePropertyAll(Colors.transparent), padding: MaterialStatePropertyAll(EdgeInsets.zero),