Skip to content

Commit

Permalink
Align "search" icons in context menu
Browse files Browse the repository at this point in the history
Fixes #734
  • Loading branch information
Feichtmeier committed May 17, 2024
1 parent 9fe76f9 commit f7ddf09
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 8 deletions.
8 changes: 8 additions & 0 deletions lib/src/common/icons.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ class Iconz {
: Icons.arrow_circle_up;
}

IconData get remove {
return yaruStyled
? YaruIcons.minus
: appleStyled
? CupertinoIcons.minus
: Icons.remove;
}

IconData get check => yaruStyled
? YaruIcons.checkmark
: appleStyled
Expand Down
34 changes: 26 additions & 8 deletions lib/src/common/like_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,23 @@ class LikeButton extends StatelessWidget {
borderRadius: BorderRadius.circular(100),
),
),
padding: const EdgeInsets.symmetric(horizontal: 10),
itemBuilder: (context) {
return [
PopupMenuItem(
onTap: insertIntoQueue,
child: Text(context.l10n.playNext),
child: YaruTile(
leading: Icon(Iconz().insertIntoQueue),
title: Text(context.l10n.playNext),
),
),
if (allowRemove)
PopupMenuItem(
onTap: () =>
libraryModel.removeAudioFromPlaylist(playlistId, audio),
child: Text('${context.l10n.removeFrom} $playlistId'),
child: YaruTile(
leading: Icon(Iconz().remove),
),
),
PopupMenuItem(
onTap: () => showDialog(
Expand All @@ -85,8 +91,11 @@ class LikeButton extends StatelessWidget {
);
},
),
child: Text(
'${context.l10n.addToPlaylist} ...',
child: YaruTile(
leading: Icon(Iconz().plus),
title: Text(
'${context.l10n.addToPlaylist} ...',
),
),
),
PopupMenuItem(
Expand All @@ -96,14 +105,23 @@ class LikeButton extends StatelessWidget {
return MetaDataDialog(audio: audio);
},
),
child: Text(
'${context.l10n.showMetaData} ...',
child: YaruTile(
leading: Icon(Iconz().info),
title: Text(
'${context.l10n.showMetaData} ...',
),
),
),
PopupMenuItem(
padding: EdgeInsets.zero,
child: StreamProviderRow(
text: '${audio.artist ?? ''} - ${audio.title ?? ''}',
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: StreamProviderRow(
iconColor: theme.colorScheme.onSurface,
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.start,
text: '${audio.artist ?? ''} - ${audio.title ?? ''}',
),
),
),
];
Expand Down

0 comments on commit f7ddf09

Please sign in to comment.