This commit is contained in:
Thibault Deckers 2023-12-19 12:04:13 +01:00
parent 0a1c5a44e3
commit b54c8824f0
5 changed files with 44 additions and 99 deletions

View file

@ -10,17 +10,6 @@ class Themes {
fontFeatures: [FontFeature.enable('smcp')],
);
// adapted from M3 defaults
static MaterialStateProperty<TextStyle?> _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<Color>((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<Color>((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(

View file

@ -34,6 +34,8 @@ class SectionHeader<T> 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,6 +57,12 @@ class SectionHeader<T> extends StatelessWidget {
children: [
WidgetSpan(
alignment: widgetSpanAlignment,
child: Theme(
data: theme.copyWith(
iconTheme: theme.iconTheme.copyWith(
color: theme.colorScheme.onSurface,
),
),
child: _SectionSelectableLeading<T>(
selectable: selectable,
sectionKey: sectionKey,
@ -69,6 +77,7 @@ class SectionHeader<T> extends StatelessWidget {
onPressed: onTap,
),
),
),
TextSpan(
text: title,
style: AStyles.unknownTitleText,

View file

@ -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(

View file

@ -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<DebugColorSection> with AutomaticKee
children: [
Text(text),
const Spacer(),
Text(
color.hex,
style: const TextStyle(fontFamily: 'monospace'),
),
const SizedBox(width: 4),
Container(
width: 20,
height: 20,

View file

@ -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",