added image filter
This commit is contained in:
parent
5966d3b513
commit
667303cb96
3 changed files with 17 additions and 8 deletions
|
@ -28,6 +28,9 @@ class MimeFilter extends CollectionFilter {
|
|||
if (lowMime == 'video') {
|
||||
_label = 'Video';
|
||||
_icon = AIcons.video;
|
||||
} else if (lowMime == 'image') {
|
||||
_label = 'Image';
|
||||
_icon = AIcons.image;
|
||||
}
|
||||
_label ??= lowMime.split('/')[0].toUpperCase();
|
||||
} else {
|
||||
|
|
|
@ -75,18 +75,18 @@ class _CollectionDrawerState extends State<CollectionDrawer> {
|
|||
title: 'All media',
|
||||
filter: null,
|
||||
);
|
||||
final imageEntry = _FilteredCollectionNavTile(
|
||||
source: source,
|
||||
leading: const Icon(AIcons.image),
|
||||
title: 'Images',
|
||||
filter: MimeFilter(MimeTypes.ANY_IMAGE),
|
||||
);
|
||||
final videoEntry = _FilteredCollectionNavTile(
|
||||
source: source,
|
||||
leading: const Icon(AIcons.video),
|
||||
title: 'Videos',
|
||||
filter: MimeFilter(MimeTypes.ANY_VIDEO),
|
||||
);
|
||||
final animatedEntry = _FilteredCollectionNavTile(
|
||||
source: source,
|
||||
leading: const Icon(AIcons.animated),
|
||||
title: 'Animated',
|
||||
filter: MimeFilter(MimeFilter.animated),
|
||||
);
|
||||
final favouriteEntry = _FilteredCollectionNavTile(
|
||||
source: source,
|
||||
leading: const Icon(AIcons.favourite),
|
||||
|
@ -170,8 +170,8 @@ class _CollectionDrawerState extends State<CollectionDrawer> {
|
|||
final drawerItems = <Widget>[
|
||||
header,
|
||||
allMediaEntry,
|
||||
imageEntry,
|
||||
videoEntry,
|
||||
animatedEntry,
|
||||
favouriteEntry,
|
||||
if (specialAlbums.isNotEmpty) ...[
|
||||
const Divider(),
|
||||
|
|
|
@ -62,7 +62,13 @@ class ImageSearchDelegate extends SearchDelegate<CollectionFilter> {
|
|||
children: [
|
||||
_buildFilterRow(
|
||||
context: context,
|
||||
filters: [FavouriteFilter(), MimeFilter(MimeTypes.ANY_VIDEO), MimeFilter(MimeFilter.animated), MimeFilter(MimeTypes.SVG)].where((f) => containQuery(f.label)),
|
||||
filters: [
|
||||
FavouriteFilter(),
|
||||
MimeFilter(MimeTypes.ANY_IMAGE),
|
||||
MimeFilter(MimeTypes.ANY_VIDEO),
|
||||
MimeFilter(MimeFilter.animated),
|
||||
MimeFilter(MimeTypes.SVG),
|
||||
].where((f) => containQuery(f.label)),
|
||||
),
|
||||
_buildFilterRow(
|
||||
context: context,
|
||||
|
|
Loading…
Reference in a new issue