From 21cb79d2c22f79ffb7d0e15687437c300b82d4a7 Mon Sep 17 00:00:00 2001 From: Tommy Chow Date: Sat, 7 Mar 2026 17:30:02 -0800 Subject: [PATCH] move menu styling to theme for app-wide consistency Add menuTheme and menuButtonTheme to ThemeData matching the existing overlay surface style (12px radius, outline border, compact density). Remove per-use styling from chat_tabs.dart. Co-Authored-By: Claude Opus 4.6 --- .../channel/chat/widgets/chat_tabs.dart | 18 ------------------ lib/theme.dart | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/screens/channel/chat/widgets/chat_tabs.dart b/lib/screens/channel/chat/widgets/chat_tabs.dart index 7d565190..7635ddee 100644 --- a/lib/screens/channel/chat/widgets/chat_tabs.dart +++ b/lib/screens/channel/chat/widgets/chat_tabs.dart @@ -262,26 +262,11 @@ class ChatTabs extends StatelessWidget { ); } - final borderColor = - Theme.of(context).colorScheme.outlineVariant.withValues(alpha: 0.5); - return MenuAnchor( - style: MenuStyle( - padding: const WidgetStatePropertyAll(EdgeInsets.symmetric(vertical: 4)), - shape: WidgetStatePropertyAll( - RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12), - side: BorderSide(color: borderColor), - ), - ), - ), menuChildren: [ if (isActivated) MenuItemButton( leadingIcon: const Icon(Icons.power_off_rounded, size: 18), - style: MenuItemButton.styleFrom( - visualDensity: VisualDensity.compact, - ), child: const Text('Disconnect'), onPressed: () { HapticFeedback.lightImpact(); @@ -294,9 +279,6 @@ class ChatTabs extends StatelessWidget { size: 18, color: Theme.of(context).colorScheme.error, ), - style: MenuItemButton.styleFrom( - visualDensity: VisualDensity.compact, - ), child: Text( 'Remove', style: TextStyle(color: Theme.of(context).colorScheme.error), diff --git a/lib/theme.dart b/lib/theme.dart index fdf6d976..06216a11 100644 --- a/lib/theme.dart +++ b/lib/theme.dart @@ -136,6 +136,24 @@ class FrostyThemes { backgroundColor: backgroundColor, surfaceTintColor: backgroundColor, ), + menuTheme: MenuThemeData( + style: MenuStyle( + padding: const WidgetStatePropertyAll( + EdgeInsets.symmetric(vertical: 4), + ), + shape: WidgetStatePropertyAll( + RoundedRectangleBorder( + borderRadius: const BorderRadius.all(Radius.circular(12)), + side: BorderSide(color: borderColor), + ), + ), + ), + ), + menuButtonTheme: MenuButtonThemeData( + style: MenuItemButton.styleFrom( + visualDensity: VisualDensity.compact, + ), + ), dialogTheme: DialogThemeData( backgroundColor: backgroundColor, surfaceTintColor: backgroundColor,