#68 thumbnail overlay: smaller icons & intra padding, icon color / size follows text color / scale factor

This commit is contained in:
Thibault Deckers 2021-09-24 12:27:24 +09:00
parent ff8a7b0688
commit 245085b3df
2 changed files with 12 additions and 6 deletions

View file

@ -18,10 +18,11 @@ class GridTheme extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ProxyProvider<Settings, GridThemeData>(
update: (_, settings, __) {
final iconSize = min(28.0, (extent / 4)).roundToDouble();
final fontSize = (iconSize / 2).floorToDouble();
return ProxyProvider2<Settings, MediaQueryData, GridThemeData>(
update: (context, settings, mq, previous) {
var iconSize = min(24.0, (extent / 5)).roundToDouble();
final fontSize = (iconSize * .7).floorToDouble();
iconSize *= mq.textScaleFactor;
final highlightBorderWidth = extent * .1;
return GridThemeData(
iconSize: iconSize,

View file

@ -158,7 +158,12 @@ class OverlayIcon extends StatelessWidget {
@override
Widget build(BuildContext context) {
final size = context.select<GridThemeData, double>((t) => t.iconSize);
final iconChild = Icon(icon, size: size);
final iconChild = Icon(
icon,
size: size,
// consistent with the color used for the text next to it
color: DefaultTextStyle.of(context).style.color,
);
final iconBox = SizedBox(
width: size,
height: size,
@ -172,7 +177,7 @@ class OverlayIcon extends StatelessWidget {
);
return Container(
margin: const EdgeInsets.all(1),
margin: const EdgeInsets.only(left: 1, right: 1, bottom: 1),
padding: text != null ? EdgeInsets.only(right: size / 4) : null,
decoration: BoxDecoration(
color: const Color(0xBB000000),