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 <noreply@anthropic.com>
This commit is contained in:
parent
4c696745b0
commit
21cb79d2c2
2 changed files with 18 additions and 18 deletions
|
|
@ -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),
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue