Skip to content

Commit c3330f0

Browse files
committed
fix(queue, settings): persist saveDownloadHistory and move queue actions to overflow menu
Add saveDownloadHistory to settings.g.dart fromJson/toJson so the toggle persists across sessions. Replace standalone retry-failed and clear-all buttons with a single overflow menu to avoid pushing buttons off screen.
1 parent 858353c commit c3330f0

2 files changed

Lines changed: 41 additions & 14 deletions

File tree

lib/models/settings.g.dart

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/screens/queue_tab.dart

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3035,9 +3035,7 @@ class _QueueTabState extends ConsumerState<QueueTab> {
30353035
const Spacer(),
30363036
_buildPauseResumeButton(context, ref, colorScheme),
30373037
const SizedBox(width: 4),
3038-
_buildRetryAllFailedButton(context, ref, colorScheme),
3039-
const SizedBox(width: 4),
3040-
_buildClearAllButton(context, ref, colorScheme),
3038+
_buildQueueOverflowMenu(context, ref, colorScheme),
30413039
],
30423040
),
30433041
),
@@ -3993,24 +3991,51 @@ class _QueueTabState extends ConsumerState<QueueTab> {
39933991
);
39943992
}
39953993

3996-
Widget _buildRetryAllFailedButton(
3994+
Widget _buildQueueOverflowMenu(
39973995
BuildContext context,
39983996
WidgetRef ref,
39993997
ColorScheme colorScheme,
40003998
) {
40013999
final failedCount = ref.watch(
40024000
downloadQueueProvider.select((s) => s.failedCount),
40034001
);
4004-
if (failedCount == 0) return const SizedBox.shrink();
4005-
return TextButton.icon(
4006-
onPressed: () =>
4007-
ref.read(downloadQueueProvider.notifier).retryAllFailed(),
4008-
icon: const Icon(Icons.replay_rounded, size: 18),
4009-
label: Text(context.l10n.queueRetryAllFailed(failedCount)),
4010-
style: TextButton.styleFrom(
4011-
visualDensity: VisualDensity.compact,
4012-
foregroundColor: colorScheme.error,
4013-
),
4002+
return PopupMenuButton<String>(
4003+
icon: const Icon(Icons.more_vert),
4004+
tooltip: MaterialLocalizations.of(context).moreButtonTooltip,
4005+
itemBuilder: (ctx) => [
4006+
if (failedCount > 0)
4007+
PopupMenuItem(
4008+
value: 'retry_failed',
4009+
child: ListTile(
4010+
leading: const Icon(Icons.replay_rounded),
4011+
title: Text(context.l10n.queueRetryAllFailed(failedCount)),
4012+
dense: true,
4013+
contentPadding: EdgeInsets.zero,
4014+
),
4015+
),
4016+
PopupMenuItem(
4017+
value: 'clear_all',
4018+
child: ListTile(
4019+
leading: Icon(Icons.clear_all, color: colorScheme.error),
4020+
title: Text(
4021+
context.l10n.queueClearAll,
4022+
style: TextStyle(color: colorScheme.error),
4023+
),
4024+
dense: true,
4025+
contentPadding: EdgeInsets.zero,
4026+
),
4027+
),
4028+
],
4029+
onSelected: (value) {
4030+
switch (value) {
4031+
case 'retry_failed':
4032+
ref.read(downloadQueueProvider.notifier).retryAllFailed();
4033+
break;
4034+
case 'clear_all':
4035+
_showClearAllDialog(context, ref, colorScheme);
4036+
break;
4037+
}
4038+
},
40144039
);
40154040
}
40164041

0 commit comments

Comments
 (0)