diff --git a/app/lib/widget/viewer.dart b/app/lib/widget/viewer.dart index 1c60efa0..180d9a67 100644 --- a/app/lib/widget/viewer.dart +++ b/app/lib/widget/viewer.dart @@ -249,11 +249,12 @@ class _ViewerState extends State tooltip: L10n.global().downloadTooltip, onPressed: _onDownloadPressed, ), - IconButton( - icon: const Icon(Icons.delete_outlined), - tooltip: L10n.global().deleteTooltip, - onPressed: () => _onDeletePressed(context), - ), + if (widget.fromCollection == null) + IconButton( + icon: const Icon(Icons.delete_outlined), + tooltip: L10n.global().deleteTooltip, + onPressed: () => _onDeletePressed(context), + ), ], ); } @@ -332,6 +333,7 @@ class _ViewerState extends State onArchivePressed: _onArchivePressed, onUnarchivePressed: _onUnarchivePressed, onSlideshowPressed: _onSlideshowPressed, + onDeletePressed: _onDeletePressed, ), ), ); diff --git a/app/lib/widget/viewer_detail_pane.dart b/app/lib/widget/viewer_detail_pane.dart index 21955b3e..88444ffa 100644 --- a/app/lib/widget/viewer_detail_pane.dart +++ b/app/lib/widget/viewer_detail_pane.dart @@ -61,6 +61,7 @@ class ViewerDetailPane extends StatefulWidget { required this.onRemoveFromCollectionPressed, required this.onArchivePressed, required this.onUnarchivePressed, + required this.onDeletePressed, this.onSlideshowPressed, }) : super(key: key); @@ -76,6 +77,7 @@ class ViewerDetailPane extends StatefulWidget { final void Function(BuildContext context) onRemoveFromCollectionPressed; final void Function(BuildContext context) onArchivePressed; final void Function(BuildContext context) onUnarchivePressed; + final void Function(BuildContext context) onDeletePressed; final VoidCallback? onSlideshowPressed; } @@ -192,6 +194,12 @@ class _ViewerDetailPaneState extends State { label: L10n.global().archiveTooltip, onPressed: () => widget.onArchivePressed(context), ), + if (widget.fromCollection != null) + _DetailPaneButton( + icon: Icons.delete_outlined, + label: L10n.global().deleteTooltip, + onPressed: () => widget.onDeletePressed(context), + ), _DetailPaneButton( icon: Icons.slideshow_outlined, label: L10n.global().slideshowTooltip,