mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-12 23:45:18 +00:00
chore: settings popup menu constraints
This commit is contained in:
parent
082f711018
commit
768bab8bbb
@ -23,6 +23,9 @@ class AdaptiveSelectTile<T> 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<T> extends HookWidget {
|
||||
this.breakLayout,
|
||||
this.showValueWhenUnfolded = true,
|
||||
super.key,
|
||||
this.popupConstraints,
|
||||
this.popupWidthConstraint,
|
||||
});
|
||||
|
||||
@override
|
||||
@ -47,6 +52,8 @@ class AdaptiveSelectTile<T> extends HookWidget {
|
||||
},
|
||||
value: value,
|
||||
onChanged: onChanged,
|
||||
popupConstraints: popupConstraints ?? const BoxConstraints(maxWidth: 200),
|
||||
popupWidthConstraint: popupWidthConstraint ?? PopoverConstraint.flexible,
|
||||
children: options,
|
||||
);
|
||||
|
||||
|
@ -281,6 +281,7 @@ class SettingsPlaybackSection extends HookConsumerWidget {
|
||||
),
|
||||
if (preferences.audioSource != AudioSource.jiosaavn) ...[
|
||||
AdaptiveSelectTile<SourceCodecs>(
|
||||
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<SourceCodecs>(
|
||||
popupConstraints: const BoxConstraints(maxWidth: 300),
|
||||
secondary: const Icon(SpotubeIcons.file),
|
||||
title: Text(context.l10n.download_music_codec),
|
||||
value: preferences.downloadMusicCodec,
|
||||
|
Loading…
Reference in New Issue
Block a user