Add button tooltips

This commit is contained in:
problematicconsumer
2023-08-24 22:19:36 +03:30
parent 49519b7fd7
commit f8964cab46
2 changed files with 28 additions and 19 deletions

View File

@@ -153,30 +153,38 @@ class ProfileActionButton extends HookConsumerWidget {
); );
if (!showAllActions) { if (!showAllActions) {
return InkWell( return Tooltip(
onTap: () { message: t.profile.update.buttonTxt,
if (updateProfileMutation.state.isInProgress) { child: InkWell(
return; onTap: () {
} if (updateProfileMutation.state.isInProgress) {
updateProfileMutation.setFuture( return;
ref.read(profilesNotifierProvider.notifier).updateProfile(profile), }
); updateProfileMutation.setFuture(
}, ref
child: const Icon(Icons.update), .read(profilesNotifierProvider.notifier)
.updateProfile(profile),
);
},
child: const Icon(Icons.update),
),
); );
} }
return ProfileActionsMenu( return ProfileActionsMenu(
profile, profile,
(context, controller, child) { (context, controller, child) {
return InkWell( return Tooltip(
onTap: () { message: MaterialLocalizations.of(context).showMenuTooltip,
if (controller.isOpen) { child: InkWell(
controller.close(); onTap: () {
} else { if (controller.isOpen) {
controller.open(); controller.close();
} } else {
}, controller.open();
child: const Icon(Icons.more_vert), }
},
child: const Icon(Icons.more_vert),
),
); );
}, },
); );

View File

@@ -39,6 +39,7 @@ class HomePage extends HookConsumerWidget {
IconButton( IconButton(
onPressed: () => const AddProfileRoute().push(context), onPressed: () => const AddProfileRoute().push(context),
icon: const Icon(Icons.add_circle), icon: const Icon(Icons.add_circle),
tooltip: t.profile.add.buttonText,
), ),
], ],
), ),