Skip to content

Commit

Permalink
Merge branch 'Catrobat:develop' into PAINTROID-704
Browse files Browse the repository at this point in the history
  • Loading branch information
bhav-khurana authored Jan 21, 2024
2 parents 00a5ef1 + ebf601d commit 1f59b5b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/ui/drawing_space/bottom_brush_tool_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,14 @@ class _BottomBrushToolOptionsState
spacing: 8,
children: [
CustomActionChip(
hint: 'Round stroke',
chipIcon: const Icon(Icons.circle),
onPressed: () =>
_changeActionChipBackgroundColor(StrokeCap.round),
chipBackgroundColor: _roundChipBackgroundColor,
),
CustomActionChip(
hint: 'Square stroke',
chipIcon: const Icon(Icons.square),
onPressed: () =>
_changeActionChipBackgroundColor(StrokeCap.square),
Expand Down
3 changes: 3 additions & 0 deletions lib/ui/landing_page/custom_action_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ class CustomActionButton extends StatelessWidget {
final String heroTag;
final IconData icon;
final VoidCallback onPressed;
final String hint;

const CustomActionButton({
Key? key,
required this.heroTag,
required this.icon,
required this.onPressed,
required this.hint,
}) : super(key: key);

@override
Expand All @@ -18,6 +20,7 @@ class CustomActionButton extends StatelessWidget {
heroTag: heroTag,
backgroundColor: const Color(0xFFFFAB08),
foregroundColor: const Color(0xFFFFFFFF),
tooltip: hint,
child: Icon(icon),
onPressed: () async => onPressed(),
);
Expand Down
2 changes: 2 additions & 0 deletions lib/ui/landing_page/landing_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ class _LandingPageState extends ConsumerState<LandingPage> {
CustomActionButton(
heroTag: 'import_image',
icon: Icons.file_download,
hint: 'Load image',
onPressed: () async {
final bool imageLoaded =
await ioHandler.loadImage(context, this, false);
Expand All @@ -175,6 +176,7 @@ class _LandingPageState extends ConsumerState<LandingPage> {
CustomActionButton(
heroTag: 'new_image',
icon: Icons.add,
hint: 'New image',
onPressed: () async {
_clearCanvas();
_navigateToPocketPaint();
Expand Down
3 changes: 3 additions & 0 deletions lib/ui/shared/custom_action_chip.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ class CustomActionChip extends StatelessWidget {
final Color chipBackgroundColor;
final EdgeInsetsGeometry? padding;
final MaterialTapTargetSize? materialTapTargetSize;
final String hint;

const CustomActionChip({
super.key,
required this.chipIcon,
required this.onPressed,
required this.chipBackgroundColor,
required this.hint,
this.shape,
this.padding,
this.materialTapTargetSize,
Expand All @@ -21,6 +23,7 @@ class CustomActionChip extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ActionChip(
tooltip: hint,
label: chipIcon,
onPressed: onPressed,
shape: shape ??
Expand Down

0 comments on commit 1f59b5b

Please sign in to comment.