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,22 +153,29 @@ class ProfileActionButton extends HookConsumerWidget {
); );
if (!showAllActions) { if (!showAllActions) {
return InkWell( return Tooltip(
message: t.profile.update.buttonTxt,
child: InkWell(
onTap: () { onTap: () {
if (updateProfileMutation.state.isInProgress) { if (updateProfileMutation.state.isInProgress) {
return; return;
} }
updateProfileMutation.setFuture( updateProfileMutation.setFuture(
ref.read(profilesNotifierProvider.notifier).updateProfile(profile), ref
.read(profilesNotifierProvider.notifier)
.updateProfile(profile),
); );
}, },
child: const Icon(Icons.update), child: const Icon(Icons.update),
),
); );
} }
return ProfileActionsMenu( return ProfileActionsMenu(
profile, profile,
(context, controller, child) { (context, controller, child) {
return InkWell( return Tooltip(
message: MaterialLocalizations.of(context).showMenuTooltip,
child: InkWell(
onTap: () { onTap: () {
if (controller.isOpen) { if (controller.isOpen) {
controller.close(); controller.close();
@@ -177,6 +184,7 @@ class ProfileActionButton extends HookConsumerWidget {
} }
}, },
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,
), ),
], ],
), ),