Skip to content

Commit

Permalink
improved contrast for now playing bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaphasilor committed Jan 6, 2024
1 parent 2c2e6bc commit 2ea2156
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
4 changes: 3 additions & 1 deletion lib/components/favourite_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ class FavoriteButton extends StatefulWidget {
this.onToggle,
this.onlyIfFav = false,
this.inPlayer = false,
this.color,
}) : super(key: key);

final BaseItemDto? item;
final void Function(bool isFavorite)? onToggle;
final bool onlyIfFav;
final bool inPlayer;
final Color? color;

@override
State<FavoriteButton> createState() => _FavoriteButtonState();
Expand Down Expand Up @@ -49,7 +51,7 @@ class _FavoriteButtonState extends State<FavoriteButton> {
return IconButton(
icon: Icon(
isFav ? Icons.favorite : Icons.favorite_outline,
color: isFav ? Theme.of(context).colorScheme.secondary : null,
color: widget.color ?? IconTheme.of(context).color,
size: 24.0,
),
tooltip: AppLocalizations.of(context)!.favourite,
Expand Down
12 changes: 5 additions & 7 deletions lib/components/now_playing_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class NowPlayingBar extends ConsumerWidget {
}) : super(key: key);

Widget buildLoadingQueueBar(BuildContext context, Function()? retryCallback) {
const elevation = 16.0;
const albumImageSize = 70.0;

return SimpleGestureDetector(
Expand All @@ -40,13 +39,13 @@ class NowPlayingBar extends ConsumerWidget {
padding: const EdgeInsets.only(left: 12.0, bottom: 12.0, right: 12.0),
child: Material(
shadowColor:
Theme.of(context).colorScheme.primary.withOpacity(0.75),
Theme.of(context).colorScheme.primary.withOpacity(Theme.of(context).brightness == Brightness.light ? 0.75 : 0.3),
borderRadius: BorderRadius.circular(12.0),
clipBehavior: Clip.antiAlias,
color: Theme.of(context).brightness == Brightness.dark
? IconTheme.of(context).color!.withOpacity(0.1)
: Theme.of(context).cardColor,
elevation: elevation,
elevation: 8.0,
child: SafeArea(
child: Container(
width: MediaQuery.of(context).size.width,
Expand Down Expand Up @@ -102,7 +101,6 @@ class NowPlayingBar extends ConsumerWidget {

Widget buildNowPlayingBar(
BuildContext context, FinampQueueItem currentTrack) {
const elevation = 16.0;
const horizontalPadding = 8.0;
const albumImageSize = 70.0;

Expand All @@ -124,13 +122,13 @@ class NowPlayingBar extends ConsumerWidget {
child: Padding(
padding: const EdgeInsets.only(left: 12.0, bottom: 12.0, right: 12.0),
child: Material(
shadowColor: Theme.of(context).colorScheme.primary.withOpacity(0.75),
shadowColor: Theme.of(context).colorScheme.primary.withOpacity(Theme.of(context).brightness == Brightness.light ? 0.75 : 0.3),
borderRadius: BorderRadius.circular(12.0),
clipBehavior: Clip.antiAlias,
color: Theme.of(context).brightness == Brightness.dark
? IconTheme.of(context).color!.withOpacity(0.1)
: Theme.of(context).cardColor,
elevation: elevation,
elevation: 8.0,
child: SafeArea(
//TODO use a PageView instead of a Dismissible, and only wrap dynamic items (not the buttons)
child: Dismissible(
Expand Down Expand Up @@ -417,6 +415,7 @@ class NowPlayingBar extends ConsumerWidget {
top: 4.0, right: 4.0),
child: FavoriteButton(
item: currentTrackBaseItem,
color: Colors.white,
onToggle: (isFavorite) {
currentTrackBaseItem!.userData!
.isFavorite = isFavorite;
Expand Down Expand Up @@ -452,7 +451,6 @@ class NowPlayingBar extends ConsumerWidget {

@override
Widget build(BuildContext context, WidgetRef ref) {
// BottomNavBar's default elevation is 8 (https://api.flutter.dev/flutter/material/BottomNavigationBar/elevation.html)
final queueService = GetIt.instance<QueueService>();
var imageTheme =
ref.watch(playerScreenThemeProvider(Theme.of(context).brightness));
Expand Down
1 change: 0 additions & 1 deletion lib/services/queue_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,6 @@ class QueueService {
List<FinampQueueItem> newItems = [];
List<int> newLinearOrder = [];
List<int> newShuffledOrder;
_queueServiceLogger.severe("I have $itemList");
for (int i = 0; i < itemList.length; i++) {
jellyfin_models.BaseItemDto item = itemList[i];
try {
Expand Down

0 comments on commit 2ea2156

Please sign in to comment.