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') {
|
if (lowMime == 'video') {
|
||||||
_label = 'Video';
|
_label = 'Video';
|
||||||
_icon = AIcons.video;
|
_icon = AIcons.video;
|
||||||
|
} else if (lowMime == 'image') {
|
||||||
|
_label = 'Image';
|
||||||
|
_icon = AIcons.image;
|
||||||
}
|
}
|
||||||
_label ??= lowMime.split('/')[0].toUpperCase();
|
_label ??= lowMime.split('/')[0].toUpperCase();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -75,18 +75,18 @@ class _CollectionDrawerState extends State<CollectionDrawer> {
|
||||||
title: 'All media',
|
title: 'All media',
|
||||||
filter: null,
|
filter: null,
|
||||||
);
|
);
|
||||||
|
final imageEntry = _FilteredCollectionNavTile(
|
||||||
|
source: source,
|
||||||
|
leading: const Icon(AIcons.image),
|
||||||
|
title: 'Images',
|
||||||
|
filter: MimeFilter(MimeTypes.ANY_IMAGE),
|
||||||
|
);
|
||||||
final videoEntry = _FilteredCollectionNavTile(
|
final videoEntry = _FilteredCollectionNavTile(
|
||||||
source: source,
|
source: source,
|
||||||
leading: const Icon(AIcons.video),
|
leading: const Icon(AIcons.video),
|
||||||
title: 'Videos',
|
title: 'Videos',
|
||||||
filter: MimeFilter(MimeTypes.ANY_VIDEO),
|
filter: MimeFilter(MimeTypes.ANY_VIDEO),
|
||||||
);
|
);
|
||||||
final animatedEntry = _FilteredCollectionNavTile(
|
|
||||||
source: source,
|
|
||||||
leading: const Icon(AIcons.animated),
|
|
||||||
title: 'Animated',
|
|
||||||
filter: MimeFilter(MimeFilter.animated),
|
|
||||||
);
|
|
||||||
final favouriteEntry = _FilteredCollectionNavTile(
|
final favouriteEntry = _FilteredCollectionNavTile(
|
||||||
source: source,
|
source: source,
|
||||||
leading: const Icon(AIcons.favourite),
|
leading: const Icon(AIcons.favourite),
|
||||||
|
@ -170,8 +170,8 @@ class _CollectionDrawerState extends State<CollectionDrawer> {
|
||||||
final drawerItems = <Widget>[
|
final drawerItems = <Widget>[
|
||||||
header,
|
header,
|
||||||
allMediaEntry,
|
allMediaEntry,
|
||||||
|
imageEntry,
|
||||||
videoEntry,
|
videoEntry,
|
||||||
animatedEntry,
|
|
||||||
favouriteEntry,
|
favouriteEntry,
|
||||||
if (specialAlbums.isNotEmpty) ...[
|
if (specialAlbums.isNotEmpty) ...[
|
||||||
const Divider(),
|
const Divider(),
|
||||||
|
|
|
@ -62,7 +62,13 @@ class ImageSearchDelegate extends SearchDelegate<CollectionFilter> {
|
||||||
children: [
|
children: [
|
||||||
_buildFilterRow(
|
_buildFilterRow(
|
||||||
context: context,
|
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(
|
_buildFilterRow(
|
||||||
context: context,
|
context: context,
|
||||||
|
|
Loading…
Reference in a new issue