Skip to content

Commit ebf601d

Browse files
authored
PAINTROID-701: Addition of Tooltips (#42)
* Add tooltips * Address requested changes
1 parent 8063d84 commit ebf601d

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

lib/ui/drawing_space/bottom_brush_tool_options.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,14 @@ class _BottomBrushToolOptionsState
5757
spacing: 8,
5858
children: [
5959
CustomActionChip(
60+
hint: 'Round stroke',
6061
chipIcon: const Icon(Icons.circle),
6162
onPressed: () =>
6263
_changeActionChipBackgroundColor(StrokeCap.round),
6364
chipBackgroundColor: _roundChipBackgroundColor,
6465
),
6566
CustomActionChip(
67+
hint: 'Square stroke',
6668
chipIcon: const Icon(Icons.square),
6769
onPressed: () =>
6870
_changeActionChipBackgroundColor(StrokeCap.square),

lib/ui/landing_page/custom_action_button.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ class CustomActionButton extends StatelessWidget {
44
final String heroTag;
55
final IconData icon;
66
final VoidCallback onPressed;
7+
final String hint;
78

89
const CustomActionButton({
910
Key? key,
1011
required this.heroTag,
1112
required this.icon,
1213
required this.onPressed,
14+
required this.hint,
1315
}) : super(key: key);
1416

1517
@override
@@ -18,6 +20,7 @@ class CustomActionButton extends StatelessWidget {
1820
heroTag: heroTag,
1921
backgroundColor: const Color(0xFFFFAB08),
2022
foregroundColor: const Color(0xFFFFFFFF),
23+
tooltip: hint,
2124
child: Icon(icon),
2225
onPressed: () async => onPressed(),
2326
);

lib/ui/landing_page/landing_page.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ class _LandingPageState extends ConsumerState<LandingPage> {
161161
CustomActionButton(
162162
heroTag: 'import_image',
163163
icon: Icons.file_download,
164+
hint: 'Load image',
164165
onPressed: () async {
165166
final bool imageLoaded =
166167
await ioHandler.loadImage(context, this, false);
@@ -175,6 +176,7 @@ class _LandingPageState extends ConsumerState<LandingPage> {
175176
CustomActionButton(
176177
heroTag: 'new_image',
177178
icon: Icons.add,
179+
hint: 'New image',
178180
onPressed: () async {
179181
_clearCanvas();
180182
_navigateToPocketPaint();

lib/ui/shared/custom_action_chip.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ class CustomActionChip extends StatelessWidget {
77
final Color chipBackgroundColor;
88
final EdgeInsetsGeometry? padding;
99
final MaterialTapTargetSize? materialTapTargetSize;
10+
final String hint;
1011

1112
const CustomActionChip({
1213
super.key,
1314
required this.chipIcon,
1415
required this.onPressed,
1516
required this.chipBackgroundColor,
17+
required this.hint,
1618
this.shape,
1719
this.padding,
1820
this.materialTapTargetSize,
@@ -21,6 +23,7 @@ class CustomActionChip extends StatelessWidget {
2123
@override
2224
Widget build(BuildContext context) {
2325
return ActionChip(
26+
tooltip: hint,
2427
label: chipIcon,
2528
onPressed: onPressed,
2629
shape: shape ??

0 commit comments

Comments
 (0)