Skip to content

Commit

Permalink
Minor UI fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Komodo5197 committed Feb 11, 2024
1 parent caea382 commit 27465cf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 24 deletions.
16 changes: 8 additions & 8 deletions lib/components/PlayerScreen/artist_chip.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ class ArtistChips extends StatelessWidget {
final currentArtist = artists![index];

return ArtistChip(
backgroundColor: backgroundColor,
color: color,
artist: BaseItemDto(
id: currentArtist.id,
name: currentArtist.name,
type: "MusicArtist",
),
);
backgroundColor: backgroundColor,
color: color,
artist: BaseItemDto(
id: currentArtist.id,
name: currentArtist.name,
type: "MusicArtist",
),
key: ValueKey(currentArtist.id));
}),
),
),
Expand Down
16 changes: 2 additions & 14 deletions lib/components/PlayerScreen/song_name_content.dart
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
import 'package:audio_service/audio_service.dart';
import 'package:balanced_text/balanced_text.dart';
import 'package:finamp/components/PlayerScreen/player_buttons_more.dart';
import 'package:finamp/models/finamp_models.dart';
import 'package:finamp/models/jellyfin_models.dart' as jellyfin_models;
import 'package:flutter/material.dart';
import 'package:balanced_text/balanced_text.dart';

import '../favourite_button.dart';
import 'album_chip.dart';
import 'artist_chip.dart';

class SongNameContent extends StatelessWidget {
const SongNameContent(
{Key? key,
required this.currentTrack,
required this.secondaryTextColour})
{Key? key, required this.currentTrack, required this.secondaryTextColour})
: super(key: key);
final FinampQueueItem currentTrack;
final Color? secondaryTextColour;
Expand Down Expand Up @@ -58,15 +55,6 @@ class SongNameContent extends StatelessWidget {
child: ArtistChips(
baseItem: songBaseItemDto,
backgroundColor: IconTheme.of(context).color!.withOpacity(0.1),
key: songBaseItemDto?.albumArtist == null
? null
// We have to add -artist and -album to the keys because otherwise
// self-titled albums (e.g. Aerosmith by Aerosmith) will break due
// to duplicate keys.
// Its probably more efficient to put a single character instead
// of a whole 6-7 characters, but I think we can spare the CPU
// cycles.
: ValueKey("${songBaseItemDto!.albumArtist}-artist"),
),
),
FavoriteButton(
Expand Down
5 changes: 3 additions & 2 deletions lib/components/icon_and_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ class IconAndText extends StatelessWidget {
),
const Padding(padding: EdgeInsets.symmetric(horizontal: 2)),
Expanded(
child: RichText(
text: textSpan,
// RichText blocks theming. Text.rich does not.
child: Text.rich(
textSpan,
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
Expand Down

0 comments on commit 27465cf

Please sign in to comment.