From 7836bd729ac153b407c777353f926da9f7f5691d Mon Sep 17 00:00:00 2001 From: Feichtmeier Date: Wed, 4 Dec 2024 00:18:52 +0100 Subject: [PATCH] fix: show radio history list on queue overlay for radio --- lib/player/view/full_height_player.dart | 32 ++++++++++++++----------- lib/player/view/queue_button.dart | 6 ++++- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/lib/player/view/full_height_player.dart b/lib/player/view/full_height_player.dart index 14550d355..b7a3bb9ac 100644 --- a/lib/player/view/full_height_player.dart +++ b/lib/player/view/full_height_player.dart @@ -47,14 +47,28 @@ class FullHeightPlayer extends StatelessWidget with WatchItMixin { playerPosition: playerPosition, ); } else { + final queueOrHistory = audio?.audioType == AudioType.radio + ? const SizedBox( + width: 400, + height: 500, + child: RadioHistoryList( + simpleList: true, + ), + ) + : QueueBody( + selectedColor: theme.colorScheme.onSurface, + ); final column = Column( mainAxisAlignment: MainAxisAlignment.center, mainAxisSize: MainAxisSize.min, children: [ if (showQueue && !playerWithSidePanel) - const Padding( - padding: EdgeInsets.only(bottom: 2 * kLargestSpace), - child: QueueBody(), + Padding( + padding: const EdgeInsets.only( + bottom: 2 * kLargestSpace, + top: kLargestSpace, + ), + child: queueOrHistory, ) else ...[ if (!isMobilePlatform || context.isPortrait) @@ -94,17 +108,7 @@ class FullHeightPlayer extends StatelessWidget with WatchItMixin { mainAxisAlignment: MainAxisAlignment.center, children: [ SizedBox(width: 490, child: column), - audio?.audioType == AudioType.radio - ? const SizedBox( - width: 400, - height: 500, - child: RadioHistoryList( - simpleList: true, - ), - ) - : QueueBody( - selectedColor: theme.colorScheme.onSurface, - ), + queueOrHistory, ], ) : column, diff --git a/lib/player/view/queue_button.dart b/lib/player/view/queue_button.dart index 6f6e5e1e1..199b8073d 100644 --- a/lib/player/view/queue_button.dart +++ b/lib/player/view/queue_button.dart @@ -4,6 +4,7 @@ import 'package:watch_it/watch_it.dart'; import '../../app/app_model.dart'; import '../../common/data/audio.dart'; +import '../../common/data/audio_type.dart'; import '../../common/view/icons.dart'; import '../../common/view/modals.dart'; import '../../common/view/ui_constants.dart'; @@ -24,13 +25,16 @@ class QueueButton extends StatelessWidget with WatchItMixin { final theme = context.theme; final playerToTheRight = context.mediaQuerySize.width > kSideBarThreshHold; final isFullScreen = watchPropertyValue((AppModel m) => m.fullWindowMode); + final radio = watchPropertyValue( + (PlayerModel m) => m.audio?.audioType == AudioType.radio, + ); return IconButton( isSelected: isSelected ?? watchPropertyValue((AppModel m) => m.showQueueOverlay), color: color ?? theme.colorScheme.onSurface, padding: EdgeInsets.zero, - tooltip: context.l10n.queue, + tooltip: radio ? context.l10n.hearingHistory : context.l10n.queue, icon: Icon( Iconz.playlist, color: color ?? theme.colorScheme.onSurface,