minor fixes

This commit is contained in:
Thibault Deckers 2023-12-19 15:35:40 +01:00
parent cd624979fb
commit 4dcfc7568f
8 changed files with 23 additions and 9 deletions

View file

@ -58,6 +58,7 @@ class Themes {
typography: _typography,
// COMPONENT THEMES
checkboxTheme: _checkboxTheme(colors),
floatingActionButtonTheme: _floatingActionButtonTheme(colors),
radioTheme: _radioTheme(colors),
sliderTheme: _sliderTheme(colors),
tooltipTheme: _tooltipTheme,
@ -86,6 +87,13 @@ class Themes {
);
}
static FloatingActionButtonThemeData _floatingActionButtonTheme(ColorScheme colors) {
return FloatingActionButtonThemeData(
foregroundColor: colors.onPrimary,
backgroundColor: colors.primary,
);
}
// adapted from M3 defaults
static RadioThemeData _radioTheme(ColorScheme colors) => RadioThemeData(
fillColor: MaterialStateProperty.resolveWith<Color>((states) {

View file

@ -30,7 +30,7 @@ class AboutTranslators extends StatelessWidget {
static Widget buildBody(BuildContext context) {
return _RandomTextSpanHighlighter(
spans: Contributors.translators.map((v) => v.name).toList(),
color: Theme.of(context).colorScheme.onPrimary,
color: Theme.of(context).colorScheme.onBackground,
);
}
}

View file

@ -11,11 +11,13 @@ class FilterBar extends StatefulWidget {
static const double preferredHeight = AvesFilterChip.minChipHeight + verticalPadding;
final List<CollectionFilter> filters;
final bool interactive;
final FilterCallback? onTap, onRemove;
FilterBar({
super.key,
required Set<CollectionFilter> filters,
this.interactive = true,
this.onTap,
this.onRemove,
}) : filters = List<CollectionFilter>.from(filters)..sort();
@ -111,6 +113,7 @@ class _FilterBarState extends State<FilterBar> {
return _Chip(
filter: filter,
single: filters.length == 1,
interactive: widget.interactive,
onTap: onTap,
onRemove: onRemove,
);
@ -119,12 +122,13 @@ class _FilterBarState extends State<FilterBar> {
class _Chip extends StatelessWidget {
final CollectionFilter filter;
final bool single;
final bool single, interactive;
final FilterCallback? onTap, onRemove;
const _Chip({
required this.filter,
required this.single,
required this.interactive,
required this.onTap,
required this.onRemove,
});
@ -148,6 +152,7 @@ class _Chip extends StatelessWidget {
heroType: HeroType.always,
onTap: onTap,
onRemove: onRemove,
onLongPress: interactive ? AvesFilterChip.showDefaultLongPressMenu : null,
),
),
);

View file

@ -50,7 +50,7 @@ class MosaicScaleOverlay extends StatelessWidget {
child: Stack(
alignment: Alignment.center,
children: [
_buildBar(extentMax, colorScheme.onPrimary.withOpacity(.1)),
_buildBar(extentMax, colorScheme.onBackground.withOpacity(.2)),
_buildBar(scaledSize.width, colorScheme.primary),
],
),

View file

@ -20,9 +20,6 @@ class AvesFab extends StatelessWidget {
child: FloatingActionButton(
tooltip: tooltip,
onPressed: onPressed,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(16)),
),
child: const Icon(AIcons.apply),
),
);

View file

@ -22,7 +22,7 @@ class AvesOutlinedButton extends StatelessWidget {
);
}),
foregroundColor: MaterialStateProperty.resolveWith<Color>((states) {
return states.contains(MaterialState.disabled) ? theme.disabledColor : theme.colorScheme.onPrimary;
return states.contains(MaterialState.disabled) ? theme.disabledColor : theme.colorScheme.onBackground;
}),
);
return icon != null

View file

@ -61,7 +61,11 @@ class SettingsCollectionTile extends StatelessWidget {
],
),
),
if (filters.isNotEmpty) FilterBar(filters: filters),
if (filters.isNotEmpty)
FilterBar(
filters: filters,
interactive: false,
),
],
),
),

View file

@ -275,7 +275,7 @@ class _QuickActionEditorBodyState<T extends Object> extends State<QuickActionEdi
effect: WormEffect(
dotWidth: 8,
dotHeight: 8,
dotColor: colorScheme.onPrimary.withOpacity(.3),
dotColor: colorScheme.onBackground.withOpacity(.2),
activeDotColor: colorScheme.primary,
),
),