Skip to content

Commit

Permalink
Add tooltips to icon buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed Oct 9, 2023
1 parent 8b8d306 commit 78c1c5e
Show file tree
Hide file tree
Showing 47 changed files with 328 additions and 276 deletions.
5 changes: 5 additions & 0 deletions app/lib/dialogs/add.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class AddDialog extends StatelessWidget {
onPressed: () =>
handler.onSelected(bloc, currentIndexCubit, false),
icon: const PhosphorIcon(PhosphorIconsLight.playCircle),
tooltip: AppLocalizations.of(context).play,
),
],
],
Expand Down Expand Up @@ -82,6 +83,7 @@ class AddDialog extends StatelessWidget {
IconButton(
onPressed: () => openHelp(['tools']),
icon: const PhosphorIcon(PhosphorIconsLight.sealQuestion),
tooltip: AppLocalizations.of(context).help,
),
],
),
Expand Down Expand Up @@ -186,6 +188,9 @@ class AddDialog extends StatelessWidget {
IconButton(
onPressed: () => addTool(
Tool.asset(importType: e)),
tooltip:
AppLocalizations.of(context)
.pin,
icon: const PhosphorIcon(
PhosphorIconsLight.pushPin),
),
Expand Down
1 change: 1 addition & 0 deletions app/lib/dialogs/area/dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class AreasDialog extends StatelessWidget {
leading: IconButton(
icon: const PhosphorIcon(PhosphorIconsLight.x),
onPressed: () => Navigator.of(context).pop(),
tooltip: AppLocalizations.of(context).close,
),
),
Flexible(
Expand Down
8 changes: 4 additions & 4 deletions app/lib/dialogs/background/dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ class BackgroundDialog extends StatelessWidget {
leading: const PhosphorIcon(PhosphorIconsLight.image),
actions: [
IconButton(
tooltip: AppLocalizations.of(context).help,
icon:
const PhosphorIcon(PhosphorIconsLight.sealQuestion),
onPressed: () => openHelp(['background', 'intro'])),
tooltip: AppLocalizations.of(context).help,
icon: const PhosphorIcon(PhosphorIconsLight.sealQuestion),
onPressed: () => openHelp(['background', 'intro']),
),
],
),
TabBar(
Expand Down
2 changes: 2 additions & 0 deletions app/lib/dialogs/color_pick.dart
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ class _ColorPalettePickerDialogState extends State<ColorPalettePickerDialog> {
_selected = result;
});
},
tooltip:
AppLocalizations.of(context).select,
icon: const PhosphorIcon(
PhosphorIconsLight.package),
)
Expand Down
1 change: 1 addition & 0 deletions app/lib/dialogs/file_system/tree.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class FileSystemDirectoryTreeViewState
trailing: IconButton(
icon: const PhosphorIcon(PhosphorIconsLight.folderPlus),
onPressed: _newFolder,
tooltip: AppLocalizations.of(context).newFolder,
),
onTap: () {
if (_selected == widget.path) {
Expand Down
4 changes: 3 additions & 1 deletion app/lib/dialogs/layer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ class LayerDialog extends StatelessWidget {
Widget build(BuildContext context) {
if (popupMenu) {
return MenuAnchor(
builder: defaultMenuButton(),
builder: defaultMenuButton(
tooltip: AppLocalizations.of(context).actions,
),
menuChildren: _buildMenuItems(context).toList());
}
return AlertDialog(
Expand Down
1 change: 1 addition & 0 deletions app/lib/dialogs/packs/asset.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class AssetDialog extends StatelessWidget {
if (pack == null) return;
bloc.add(PackAdded(pack));
},
tooltip: AppLocalizations.of(context).createPack,
),
],
),
Expand Down
2 changes: 2 additions & 0 deletions app/lib/dialogs/packs/components.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:butterfly_api/butterfly_api.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:phosphor_flutter/phosphor_flutter.dart';

class ComponentsPackView extends StatelessWidget {
Expand Down Expand Up @@ -34,6 +35,7 @@ class ComponentsPackView extends StatelessWidget {
onPressed: () async {
onChanged(value.removeComponent(e));
},
tooltip: AppLocalizations.of(context).delete,
),
),
),
Expand Down
10 changes: 8 additions & 2 deletions app/lib/dialogs/packs/dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,10 @@ class _PacksDialogState extends State<PacksDialog>
PackUpdated(metadata.name, newPack));
},
trailing: MenuAnchor(
builder: defaultMenuButton(),
builder: defaultMenuButton(
tooltip:
AppLocalizations.of(context).copy,
),
menuChildren: [
MenuItemButton(
leadingIcon: const PhosphorIcon(
Expand Down Expand Up @@ -257,7 +260,10 @@ class _PacksDialogState extends State<PacksDialog>
setState(() {});
},
trailing: MenuAnchor(
builder: defaultMenuButton(),
builder: defaultMenuButton(
tooltip:
AppLocalizations.of(context).copy,
),
menuChildren: [
if (!widget.globalOnly)
MenuItemButton(
Expand Down
1 change: 1 addition & 0 deletions app/lib/dialogs/packs/palettes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class PalettesPackView extends StatelessWidget {
onPressed: () async {
onChanged(value.removePalette(e));
},
tooltip: AppLocalizations.of(context).delete,
),
),
),
Expand Down
1 change: 1 addition & 0 deletions app/lib/dialogs/packs/select.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class SelectPackAssetDialog extends StatelessWidget {
const SizedBox(width: 8),
IconButton(
icon: const PhosphorIcon(PhosphorIconsLight.plusCircle),
tooltip: AppLocalizations.of(context).addAsset,
onPressed: () async {
final result = await showDialog<PackAssetLocation>(
context: context,
Expand Down
Loading

0 comments on commit 78c1c5e

Please sign in to comment.