Skip to content
This repository has been archived by the owner on Feb 25, 2024. It is now read-only.

Commit

Permalink
Menus: use surface variant in dark theme, surface in light theme
Browse files Browse the repository at this point in the history
This makes it possible configure the background color of menus. I
sincerely hope surfaceVariant is a safe choice for this.

Ref: #302
  • Loading branch information
jpnurmi committed Mar 11, 2023
1 parent a5a8837 commit 1e1ce0f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/src/themes/common_themes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ ThemeData createYaruDarkTheme({
inverseSurface: YaruColors.porcelain,
onInverseSurface: YaruColors.inkstone,
surfaceTint: YaruColors.coolGrey,
surfaceVariant: YaruColors.inkstone,
surfaceVariant: const Color.fromARGB(255, 34, 34, 34),
tertiary: const Color(0xFF18b6ec),
onTertiary: YaruColors.porcelain,
tertiaryContainer: const Color(0xFF18b6ec),
Expand All @@ -502,8 +502,8 @@ Color contrastColor(Color color) => ThemeData.estimateBrightnessForColor(

PopupMenuThemeData _createPopupMenuThemeData(ColorScheme colorScheme) {
final bgColor = colorScheme.brightness == Brightness.dark
? const Color.fromARGB(255, 34, 34, 34)
: Colors.white;
? colorScheme.surfaceVariant
: colorScheme.surface;
return PopupMenuThemeData(
color: bgColor,
surfaceTintColor: bgColor,
Expand All @@ -521,9 +521,8 @@ PopupMenuThemeData _createPopupMenuThemeData(ColorScheme colorScheme) {

MenuStyle _createMenuStyle(ColorScheme colorScheme) {
final bgColor = colorScheme.brightness == Brightness.dark
? const Color.fromARGB(255, 34, 34, 34)
: Colors.white;

? colorScheme.surfaceVariant
: colorScheme.surface;
return MenuStyle(
surfaceTintColor: MaterialStateColor.resolveWith((states) => bgColor),
shape: MaterialStateProperty.resolveWith(
Expand Down

0 comments on commit 1e1ce0f

Please sign in to comment.