diff --git a/lib/theme/themes.dart b/lib/theme/themes.dart index c4b860602..0213322c5 100644 --- a/lib/theme/themes.dart +++ b/lib/theme/themes.dart @@ -10,17 +10,6 @@ class Themes { fontFeatures: [FontFeature.enable('smcp')], ); - // adapted from M3 defaults - static MaterialStateProperty _popupMenuTextStyle(ColorScheme colors, TextTheme textTheme) { - return MaterialStateProperty.resolveWith((states) { - final TextStyle style = textTheme.labelLarge!; - if (states.contains(MaterialState.disabled)) { - return style.apply(color: colors.onSurface.withOpacity(0.38)); - } - return style.apply(color: colors.onSurface); - }); - } - static TextStyle searchFieldStyle(BuildContext context) => Theme.of(context).textTheme.bodyLarge!; static Color overlayBackgroundColor({ @@ -83,6 +72,20 @@ class Themes { contentPadding: EdgeInsets.symmetric(horizontal: 16), ); + static PopupMenuThemeData _popupMenuTheme(ColorScheme colors, TextTheme textTheme) { + return PopupMenuThemeData( + labelTextStyle: MaterialStateProperty.resolveWith((states) { + // adapted from M3 defaults + final TextStyle style = textTheme.labelLarge!; + if (states.contains(MaterialState.disabled)) { + return style.apply(color: colors.onSurface.withOpacity(0.38)); + } + return style.apply(color: colors.onSurface); + }), + iconColor: colors.onSurface, + ); + } + // adapted from M3 defaults static RadioThemeData _radioTheme(ColorScheme colors) => RadioThemeData( fillColor: MaterialStateProperty.resolveWith((states) { @@ -158,9 +161,7 @@ class Themes { listTileTheme: _listTileTheme.copyWith( iconColor: _lightActionIconColor, ), - popupMenuTheme: PopupMenuThemeData( - labelTextStyle: _popupMenuTextStyle(colors, textTheme), - ), + popupMenuTheme: _popupMenuTheme(colors, textTheme), snackBarTheme: _snackBarTheme(colors), switchTheme: SwitchThemeData( thumbColor: MaterialStateProperty.resolveWith((states) { @@ -209,9 +210,7 @@ class Themes { titleTextStyle: _titleTextStyle.copyWith(color: _darkTitleColor), ), listTileTheme: _listTileTheme, - popupMenuTheme: PopupMenuThemeData( - labelTextStyle: _popupMenuTextStyle(colors, textTheme), - ), + popupMenuTheme: _popupMenuTheme(colors, textTheme), snackBarTheme: _snackBarTheme(colors).copyWith( backgroundColor: _schemeSecondLayer(colors), contentTextStyle: TextStyle( diff --git a/lib/widgets/common/grid/header.dart b/lib/widgets/common/grid/header.dart index 18ba54ec6..376df39e6 100644 --- a/lib/widgets/common/grid/header.dart +++ b/lib/widgets/common/grid/header.dart @@ -34,6 +34,8 @@ class SectionHeader extends StatelessWidget { Widget build(BuildContext context) { final onTap = selectable ? () => _toggleSectionSelection(context) : null; + final theme = Theme.of(context); + Widget child = Container( padding: padding, constraints: BoxConstraints(minHeight: leadingSize.height), @@ -55,18 +57,25 @@ class SectionHeader extends StatelessWidget { children: [ WidgetSpan( alignment: widgetSpanAlignment, - child: _SectionSelectableLeading( - selectable: selectable, - sectionKey: sectionKey, - browsingBuilder: leading != null - ? (context) => Container( - padding: const EdgeInsetsDirectional.only(end: 8, bottom: 4), - width: leadingSize.width, - height: leadingSize.height, - child: leading, - ) - : null, - onPressed: onTap, + child: Theme( + data: theme.copyWith( + iconTheme: theme.iconTheme.copyWith( + color: theme.colorScheme.onSurface, + ), + ), + child: _SectionSelectableLeading( + selectable: selectable, + sectionKey: sectionKey, + browsingBuilder: leading != null + ? (context) => Container( + padding: const EdgeInsetsDirectional.only(end: 8, bottom: 4), + width: leadingSize.width, + height: leadingSize.height, + child: leading, + ) + : null, + onPressed: onTap, + ), ), ), TextSpan( diff --git a/lib/widgets/common/identity/aves_expansion_tile.dart b/lib/widgets/common/identity/aves_expansion_tile.dart index b8ef518fb..92c8aa18b 100644 --- a/lib/widgets/common/identity/aves_expansion_tile.dart +++ b/lib/widgets/common/identity/aves_expansion_tile.dart @@ -57,7 +57,7 @@ class AvesExpansionTile extends StatelessWidget { initiallyExpanded: initiallyExpanded, finalPadding: const EdgeInsets.symmetric(vertical: 6.0), baseColor: theme.colorScheme.background, - expandedTextColor: colorScheme.onBackground, + expandedTextColor: colorScheme.onSurface, duration: animationDuration, shadowColor: theme.shadowColor, child: Column( diff --git a/lib/widgets/debug/colors.dart b/lib/widgets/debug/colors.dart index f0a6f3471..2b37bd3eb 100644 --- a/lib/widgets/debug/colors.dart +++ b/lib/widgets/debug/colors.dart @@ -1,4 +1,5 @@ import 'package:aves/widgets/common/identity/aves_expansion_tile.dart'; +import 'package:flex_color_picker/flex_color_picker.dart'; import 'package:flutter/material.dart'; class DebugColorSection extends StatefulWidget { @@ -58,6 +59,11 @@ class _DebugColorSectionState extends State with AutomaticKee children: [ Text(text), const Spacer(), + Text( + color.hex, + style: const TextStyle(fontFamily: 'monospace'), + ), + const SizedBox(width: 4), Container( width: 20, height: 20, diff --git a/untranslated.json b/untranslated.json index 81143d62d..f8a39b500 100644 --- a/untranslated.json +++ b/untranslated.json @@ -7660,75 +7660,6 @@ "tagPlaceholderState" ], - "zh": [ - "chipActionGoToPlacePage", - "entryActionCast", - "editorTransformCrop", - "cropAspectRatioFree", - "cropAspectRatioOriginal", - "cropAspectRatioSquare", - "filterLocatedLabel", - "filterTaggedLabel", - "albumTierVaults", - "lengthUnitPixel", - "lengthUnitPercent", - "maxBrightnessNever", - "maxBrightnessAlways", - "overlayHistogramNone", - "overlayHistogramLuminance", - "vaultLockTypePattern", - "vaultLockTypePin", - "settingsVideoEnablePip", - "videoResumptionModeNever", - "videoResumptionModeAlways", - "widgetTapUpdateWidget", - "newVaultWarningDialogMessage", - "newVaultDialogTitle", - "configureVaultDialogTitle", - "vaultDialogLockModeWhenScreenOff", - "vaultDialogLockTypeLabel", - "patternDialogEnter", - "authenticateToConfigureVault", - "authenticateToUnlockVault", - "vaultBinUsageDialogMessage", - "exportEntryDialogQuality", - "exportEntryDialogWriteMetadata", - "tooManyItemsErrorDialogMessage", - "castDialogTitle", - "aboutDataUsageSectionTitle", - "aboutDataUsageData", - "aboutDataUsageCache", - "aboutDataUsageDatabase", - "aboutDataUsageMisc", - "aboutDataUsageInternal", - "aboutDataUsageExternal", - "aboutDataUsageClearCache", - "drawerPlacePage", - "statePageTitle", - "stateEmpty", - "placePageTitle", - "placeEmpty", - "searchStatesSectionTitle", - "settingsAskEverytime", - "settingsModificationWarningDialogMessage", - "settingsConfirmationVaultDataLoss", - "settingsCollectionBurstPatternsTile", - "settingsCollectionBurstPatternsNone", - "settingsViewerShowHistogram", - "settingsViewerShowDescription", - "settingsVideoPlaybackTile", - "settingsVideoPlaybackPageTitle", - "settingsVideoResumptionModeTile", - "settingsVideoResumptionModeDialogTitle", - "settingsVideoBackgroundMode", - "settingsVideoBackgroundModeDialogTitle", - "settingsVideoGestureVerticalDragBrightnessVolume", - "settingsDisablingBinWarningDialogMessage", - "settingsAccessibilityShowPinchGestureAlternatives", - "statsTopStatesSectionTitle", - "tagPlaceholderState" - ], - "zh_Hant": [ "entryActionCast", "overlayHistogramNone",