diff --git a/lib/pages/pgc_review/child/view.dart b/lib/pages/pgc_review/child/view.dart index ba63ea2e7..54e5b653c 100644 --- a/lib/pages/pgc_review/child/view.dart +++ b/lib/pages/pgc_review/child/view.dart @@ -304,64 +304,65 @@ class _PgcReviewChildPageState extends State builder: (context) { final Color color = theme.colorScheme.outline; final Color primary = theme.colorScheme.primary; - final ButtonStyle style = TextButton.styleFrom( - padding: EdgeInsets.zero, - tapTargetSize: MaterialTapTargetSize.shrinkWrap, - visualDensity: VisualDensity.compact, - ); final isLike = item.stat?.liked == 1; late final isDislike = item.stat?.disliked == 1; return Row( - mainAxisAlignment: MainAxisAlignment.end, + mainAxisAlignment: .end, children: [ if (!isLongReview) - SizedBox( - height: 32, - child: TextButton( - style: style, - onPressed: () => _controller.onDislike( - item, - isDislike, - item.reviewId, - ), - child: Icon( - isDislike - ? BiliIcons.ic_disliked - : BiliIcons.ic_dislike, - size: 16, - color: isDislike ? primary : color, - ), + TextButton( + style: const ButtonStyle( + visualDensity: .compact, + tapTargetSize: .shrinkWrap, + padding: WidgetStatePropertyAll(.zero), + minimumSize: WidgetStatePropertyAll(.square(40)), + ), + onPressed: () => _controller.onDislike( + item, + isDislike, + item.reviewId, + ), + child: Icon( + isDislike + ? BiliIcons.ic_disliked + : BiliIcons.ic_dislike, + size: 16, + color: isDislike ? primary : color, ), ), - SizedBox( - height: 32, - child: TextButton( - style: style, - onPressed: isLongReview - ? null - : () => _controller.onLike( - item, - isLike, - item.reviewId, - ), - child: Row( - spacing: 4, - children: [ - Icon( - isLike ? BiliIcons.ic_liked : BiliIcons.ic_like, - size: 16, - color: isLike ? primary : color, - ), - Text( - NumUtils.numFormat(item.stat?.likes ?? 0), - style: TextStyle( - color: isLike ? primary : color, - fontSize: 12, - ), - ), - ], + TextButton( + style: const ButtonStyle( + visualDensity: .compact, + tapTargetSize: .shrinkWrap, + minimumSize: WidgetStatePropertyAll(.square(40)), + padding: WidgetStatePropertyAll( + .symmetric(horizontal: 8), ), ), + onPressed: isLongReview + ? null + : () => _controller.onLike( + item, + isLike, + item.reviewId, + ), + child: Row( + spacing: 4, + children: [ + Icon( + isLike ? BiliIcons.ic_liked : BiliIcons.ic_like, + size: 16, + color: isLike ? primary : color, + ), + Text( + NumUtils.numFormat(item.stat?.likes ?? 0), + style: TextStyle( + color: isLike ? primary : color, + fontSize: 12, + ), + ), + ], + ), ), ], ); diff --git a/lib/pages/video/introduction/ugc/widgets/action_item.dart b/lib/pages/video/introduction/ugc/widgets/action_item.dart index f85e1e57b..ba3c5f808 100644 --- a/lib/pages/video/introduction/ugc/widgets/action_item.dart +++ b/lib/pages/video/introduction/ugc/widgets/action_item.dart @@ -38,7 +38,12 @@ class ActionItem extends StatelessWidget { Widget child = Icon( icon.icon, size: icon.size ?? 20.5, - color: selectStatus ? primary : icon.color ?? colorScheme.outline, + color: selectStatus + ? primary + : icon.color ?? + (colorScheme.isDark + ? colorScheme.outline + : colorScheme.outline.withValues(alpha: .85)), ); if (animation != null) { diff --git a/lib/pages/video/reply/widgets/zan_grpc.dart b/lib/pages/video/reply/widgets/zan_grpc.dart index 283bdf138..70a279e01 100644 --- a/lib/pages/video/reply/widgets/zan_grpc.dart +++ b/lib/pages/video/reply/widgets/zan_grpc.dart @@ -106,70 +106,69 @@ class ZanButtonGrpc extends StatelessWidget { final isDislike = action == $fixnum.Int64.TWO; final outline = theme.colorScheme.outline; final primary = theme.colorScheme.primary; - final ButtonStyle style = TextButton.styleFrom( - padding: EdgeInsets.zero, - tapTargetSize: MaterialTapTargetSize.shrinkWrap, - visualDensity: VisualDensity.compact, - ); return Row( - mainAxisSize: MainAxisSize.min, + mainAxisSize: .min, children: [ - SizedBox( - height: 32, - child: TextButton( - style: style, - onPressed: () => EasyThrottle.throttle( - 'interactAction', - const Duration(milliseconds: 200), - () => onHateReply( - context, - isProcessing, - () => isProcessing = false, - isLike: isLike, - isDislike: isDislike, - ), - ), - child: Icon( - isDislike ? BiliIcons.ic_disliked : BiliIcons.ic_dislike, - size: 16, - color: isDislike ? primary : outline, - semanticLabel: isDislike ? '已踩' : '点踩', + TextButton( + style: const ButtonStyle( + visualDensity: .compact, + tapTargetSize: .shrinkWrap, + padding: WidgetStatePropertyAll(.zero), + minimumSize: WidgetStatePropertyAll(.square(40)), + ), + onPressed: () => EasyThrottle.throttle( + 'interactAction', + const Duration(milliseconds: 200), + () => onHateReply( + context, + isProcessing, + () => isProcessing = false, + isLike: isLike, + isDislike: isDislike, ), ), + child: Icon( + isDislike ? BiliIcons.ic_disliked : BiliIcons.ic_dislike, + size: 16, + color: isDislike ? primary : outline, + semanticLabel: isDislike ? '已踩' : '点踩', + ), ), - SizedBox( - height: 32, - child: TextButton( - style: style, - onPressed: () => EasyThrottle.throttle( - 'interactAction', - const Duration(milliseconds: 200), - () => onLikeReply( - context, - isProcessing, - () => isProcessing = false, - isLike: isLike, - isDislike: isDislike, + TextButton( + style: const ButtonStyle( + visualDensity: .compact, + tapTargetSize: .shrinkWrap, + minimumSize: WidgetStatePropertyAll(.square(40)), + padding: WidgetStatePropertyAll(.symmetric(horizontal: 8)), + ), + onPressed: () => EasyThrottle.throttle( + 'interactAction', + const Duration(milliseconds: 200), + () => onLikeReply( + context, + isProcessing, + () => isProcessing = false, + isLike: isLike, + isDislike: isDislike, + ), + ), + child: Row( + spacing: 4, + children: [ + Icon( + isLike ? BiliIcons.ic_liked : BiliIcons.ic_like, + size: 16, + color: isLike ? primary : outline, + semanticLabel: isLike ? '已赞' : '点赞', ), - ), - child: Row( - spacing: 4, - children: [ - Icon( - isLike ? BiliIcons.ic_liked : BiliIcons.ic_like, - size: 16, + Text( + NumUtils.numFormat(replyItem.like.toInt()), + style: TextStyle( color: isLike ? primary : outline, - semanticLabel: isLike ? '已赞' : '点赞', + fontSize: theme.textTheme.labelSmall!.fontSize, ), - Text( - NumUtils.numFormat(replyItem.like.toInt()), - style: TextStyle( - color: isLike ? primary : outline, - fontSize: theme.textTheme.labelSmall!.fontSize, - ), - ), - ], - ), + ), + ], ), ), ],