Procházet zdrojové kódy

Show icon for pinned albums

Neeraj Gupta před 2 roky
rodič
revize
2860a56198

+ 1 - 0
lib/ui/collections/album/row_item.dart

@@ -161,6 +161,7 @@ class _CollectionItemThumbnailWidgetState
           ? ThumbnailWidget(
               widget.c.thumbnail,
               shouldShowArchiveStatus: widget.c.collection.isArchived(),
+              shouldShowPinIcon: widget.c.collection.isPinned,
               showFavForAlbumOnly: true,
               key: Key(widget.heroTag),
             )

+ 12 - 0
lib/ui/viewer/file/file_icons_widget.dart

@@ -80,6 +80,18 @@ class ArchiveOverlayIcon extends StatelessWidget {
   }
 }
 
+class PinOverlayIcon extends StatelessWidget {
+  const PinOverlayIcon({Key? key}) : super(key: key);
+
+  @override
+  Widget build(BuildContext context) {
+    return const _BottomRightOverlayIcon(
+      Icons.bookmark_add_outlined,
+      color: fixedStrokeMutedWhite,
+    );
+  }
+}
+
 class LivePhotoOverlayIcon extends StatelessWidget {
   const LivePhotoOverlayIcon({Key? key}) : super(key: key);
 

+ 5 - 0
lib/ui/viewer/file/thumbnail_widget.dart

@@ -25,6 +25,7 @@ class ThumbnailWidget extends StatefulWidget {
   final BoxFit fit;
   final bool shouldShowSyncStatus;
   final bool shouldShowArchiveStatus;
+  final bool shouldShowPinIcon;
   final bool showFavForAlbumOnly;
   final bool shouldShowLivePhotoOverlay;
   final Duration? diskLoadDeferDuration;
@@ -39,6 +40,7 @@ class ThumbnailWidget extends StatefulWidget {
     this.shouldShowSyncStatus = true,
     this.shouldShowLivePhotoOverlay = false,
     this.shouldShowArchiveStatus = false,
+    this.shouldShowPinIcon = false,
     this.showFavForAlbumOnly = false,
     this.shouldShowOwnerAvatar = false,
     this.diskLoadDeferDuration,
@@ -191,6 +193,9 @@ class _ThumbnailWidgetState extends State<ThumbnailWidget> {
     if (widget.shouldShowArchiveStatus) {
       viewChildren.add(const ArchiveOverlayIcon());
     }
+    if (widget.shouldShowPinIcon) {
+      viewChildren.add(const PinOverlayIcon());
+    }
 
     return Stack(
       fit: StackFit.expand,