From 7624e24ea6880f45c9218859af3bd3000464330f Mon Sep 17 00:00:00 2001 From: zarzet Date: Thu, 4 Jun 2026 21:03:12 +0700 Subject: [PATCH] fix(queue): simplify queue header and rate-limit indicator layout --- lib/screens/queue_tab.dart | 131 ++++++++++++++----------------------- 1 file changed, 49 insertions(+), 82 deletions(-) diff --git a/lib/screens/queue_tab.dart b/lib/screens/queue_tab.dart index edb32a1e..301ef3a5 100644 --- a/lib/screens/queue_tab.dart +++ b/lib/screens/queue_tab.dart @@ -3033,49 +3033,22 @@ class _QueueTabState extends ConsumerState { child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - LayoutBuilder( - builder: (context, constraints) { - final title = Text( - context.l10n.queueDownloadingCount(queueCount), - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: Theme.of(context).textTheme.titleMedium?.copyWith( - fontWeight: FontWeight.bold, + Row( + children: [ + Expanded( + child: Text( + context.l10n.queueDownloadingCount(queueCount), + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: Theme.of(context).textTheme.titleMedium + ?.copyWith(fontWeight: FontWeight.bold), ), - ); - final actions = Wrap( - spacing: 4, - runSpacing: 4, - alignment: WrapAlignment.end, - crossAxisAlignment: WrapCrossAlignment.center, - children: [ - _buildPauseResumeButton(context, ref, colorScheme), - _buildClearAllButton(context, ref, colorScheme), - ], - ); - - if (constraints.maxWidth < 420) { - return Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - title, - const SizedBox(height: 4), - Align( - alignment: Alignment.centerRight, - child: actions, - ), - ], - ); - } - - return Row( - children: [ - Expanded(child: title), - const SizedBox(width: 8), - Flexible(child: actions), - ], - ); - }, + ), + const SizedBox(width: 8), + _buildPauseResumeButton(context, ref, colorScheme), + const SizedBox(width: 4), + _buildClearAllButton(context, ref, colorScheme), + ], ), if (failedCount > 0 && !isProcessing) ...[ const SizedBox(height: 6), @@ -5787,51 +5760,45 @@ class _QueueTabState extends ConsumerState { ); } - return Container( - width: double.infinity, - padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8), - decoration: BoxDecoration( - color: colorScheme.tertiaryContainer.withValues(alpha: 0.45), - borderRadius: BorderRadius.circular(8), - border: Border.all(color: colorScheme.tertiary.withValues(alpha: 0.35)), - ), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Icon( + return Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only(top: 1), + child: Icon( Icons.hourglass_top_rounded, - size: 16, - color: colorScheme.onTertiaryContainer, + size: 14, + color: colorScheme.tertiary, ), - const SizedBox(width: 8), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - Text( - context.l10n.queueRateLimitTitle, - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: Theme.of(context).textTheme.labelSmall?.copyWith( - color: colorScheme.onTertiaryContainer, - fontWeight: FontWeight.w700, - ), + ), + const SizedBox(width: 6), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + context.l10n.queueRateLimitTitle, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: Theme.of(context).textTheme.labelSmall?.copyWith( + color: colorScheme.tertiary, + fontWeight: FontWeight.w700, ), - const SizedBox(height: 2), - Text( - context.l10n.queueRateLimitMessage, - maxLines: 2, - overflow: TextOverflow.ellipsis, - style: Theme.of(context).textTheme.labelSmall?.copyWith( - color: colorScheme.onTertiaryContainer, - ), + ), + const SizedBox(height: 1), + Text( + context.l10n.queueRateLimitMessage, + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: Theme.of(context).textTheme.labelSmall?.copyWith( + color: colorScheme.tertiary.withValues(alpha: 0.8), ), - ], - ), + ), + ], ), - ], - ), + ), + ], ); }