From 512711183c7d751534ffc45d5725cbba82eb9716 Mon Sep 17 00:00:00 2001 From: julian Date: Mon, 9 Jan 2023 13:22:05 -0600 Subject: [PATCH] add hover color to desktop new follow button --- lib/pages/paynym/paynym_home_view.dart | 47 +++++++++++++++++--------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/lib/pages/paynym/paynym_home_view.dart b/lib/pages/paynym/paynym_home_view.dart index cdfba4529..4d4efeb0d 100644 --- a/lib/pages/paynym/paynym_home_view.dart +++ b/lib/pages/paynym/paynym_home_view.dart @@ -27,6 +27,7 @@ import 'package:stackwallet/widgets/desktop/secondary_button.dart'; import 'package:stackwallet/widgets/icon_widgets/copy_icon.dart'; import 'package:stackwallet/widgets/icon_widgets/qrcode_icon.dart'; import 'package:stackwallet/widgets/icon_widgets/share_icon.dart'; +import 'package:stackwallet/widgets/rounded_container.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; import 'package:stackwallet/widgets/toggle.dart'; @@ -49,6 +50,8 @@ class _PaynymHomeViewState extends ConsumerState { int secretCount = 0; Timer? timer; + bool _followButtonHoverState = false; + @override void dispose() { timer?.cancel(); @@ -107,22 +110,34 @@ class _PaynymHomeViewState extends ConsumerState { ], ), trailing: Padding( - padding: const EdgeInsets.only(right: 22), - child: MouseRegion( - cursor: SystemMouseCursors.click, - child: GestureDetector( - onTap: () { - showDialog( - context: context, - builder: (context) => AddNewPaynymFollowView( - walletId: widget.walletId, - ), - ); - }, - child: Container( - color: Colors.transparent, - child: Padding( - padding: const EdgeInsets.all(10.0), + padding: const EdgeInsets.only(right: 12), + child: SizedBox( + height: 56, + child: MouseRegion( + cursor: SystemMouseCursors.click, + onEnter: (_) => setState(() { + _followButtonHoverState = true; + }), + onExit: (_) => setState(() { + _followButtonHoverState = false; + }), + child: GestureDetector( + onTap: () { + showDialog( + context: context, + builder: (context) => AddNewPaynymFollowView( + walletId: widget.walletId, + ), + ); + }, + child: RoundedContainer( + padding: const EdgeInsets.symmetric(horizontal: 24.0), + color: _followButtonHoverState + ? Theme.of(context) + .extension()! + .highlight + : Colors.transparent, + radiusMultiplier: 100, child: Row( children: [ SvgPicture.asset(