From b91a8f9e06ad82efc815283637f5d8448646a5f2 Mon Sep 17 00:00:00 2001 From: Ming Ming <nkming2@gmail.com> Date: Sat, 22 Jun 2024 01:35:03 +0800 Subject: [PATCH] Tweak button style in viewer detail pane --- app/lib/widget/viewer_detail_pane.dart | 50 +++++++++++++++----------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/app/lib/widget/viewer_detail_pane.dart b/app/lib/widget/viewer_detail_pane.dart index 65e5bbcb..8efd9db0 100644 --- a/app/lib/widget/viewer_detail_pane.dart +++ b/app/lib/widget/viewer_detail_pane.dart @@ -162,9 +162,11 @@ class _ViewerDetailPaneState extends State<ViewerDetailPane> { crossAxisAlignment: CrossAxisAlignment.start, children: [ if (_file != null) ...[ + const SizedBox(height: 8), SingleChildScrollView( scrollDirection: Axis.horizontal, child: Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ if (_canRemoveFromAlbum) _DetailPaneButton( @@ -535,28 +537,34 @@ class _DetailPaneButton extends StatelessWidget { }); @override - build(BuildContext context) { - return TextButton( - onPressed: onPressed, - style: ButtonStyle( - foregroundColor: - MaterialStateProperty.all(Theme.of(context).colorScheme.onSurface), - ), - child: SizedBox( - width: 96, - height: 96, - child: Padding( - padding: const EdgeInsets.fromLTRB(8, 16, 8, 0), - child: Column( - children: [ - Icon(icon), - const SizedBox(height: 4), - Text( - label, - textAlign: TextAlign.center, - style: Theme.of(context).textTheme.labelMedium, + Widget build(BuildContext context) { + return ClipRRect( + borderRadius: BorderRadius.circular(80), + child: Material( + type: MaterialType.transparency, + child: InkWell( + onTap: onPressed, + child: Padding( + padding: const EdgeInsets.all(12), + child: Container( + constraints: const BoxConstraints( + maxWidth: 72, + minWidth: 72, + minHeight: 72, ), - ], + alignment: Alignment.topCenter, + child: Column( + children: [ + Icon(icon), + const SizedBox(height: 4), + Text( + label, + textAlign: TextAlign.center, + style: Theme.of(context).textTheme.labelMedium, + ), + ], + ), + ), ), ), ),