From 768bab8bbbf2f7667a80c16cb69a44dbc7ceacd2 Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Thu, 23 Jan 2025 21:11:59 +0600 Subject: [PATCH] chore: settings popup menu constraints --- lib/components/adaptive/adaptive_select_tile.dart | 7 +++++++ lib/pages/settings/sections/playback.dart | 2 ++ 2 files changed, 9 insertions(+) diff --git a/lib/components/adaptive/adaptive_select_tile.dart b/lib/components/adaptive/adaptive_select_tile.dart index 40308711..2e2e7041 100644 --- a/lib/components/adaptive/adaptive_select_tile.dart +++ b/lib/components/adaptive/adaptive_select_tile.dart @@ -23,6 +23,9 @@ class AdaptiveSelectTile extends HookWidget { final bool? breakLayout; + final BoxConstraints? popupConstraints; + final PopoverConstraint? popupWidthConstraint; + const AdaptiveSelectTile({ required this.title, required this.value, @@ -34,6 +37,8 @@ class AdaptiveSelectTile extends HookWidget { this.breakLayout, this.showValueWhenUnfolded = true, super.key, + this.popupConstraints, + this.popupWidthConstraint, }); @override @@ -47,6 +52,8 @@ class AdaptiveSelectTile extends HookWidget { }, value: value, onChanged: onChanged, + popupConstraints: popupConstraints ?? const BoxConstraints(maxWidth: 200), + popupWidthConstraint: popupWidthConstraint ?? PopoverConstraint.flexible, children: options, ); diff --git a/lib/pages/settings/sections/playback.dart b/lib/pages/settings/sections/playback.dart index 6888e3a9..be3fc15b 100644 --- a/lib/pages/settings/sections/playback.dart +++ b/lib/pages/settings/sections/playback.dart @@ -281,6 +281,7 @@ class SettingsPlaybackSection extends HookConsumerWidget { ), if (preferences.audioSource != AudioSource.jiosaavn) ...[ AdaptiveSelectTile( + popupConstraints: const BoxConstraints(maxWidth: 300), secondary: const Icon(SpotubeIcons.stream), title: Text(context.l10n.streaming_music_codec), value: preferences.streamMusicCodec, @@ -300,6 +301,7 @@ class SettingsPlaybackSection extends HookConsumerWidget { }, ), AdaptiveSelectTile( + popupConstraints: const BoxConstraints(maxWidth: 300), secondary: const Icon(SpotubeIcons.file), title: Text(context.l10n.download_music_codec), value: preferences.downloadMusicCodec,