mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
feat: shuffle keep playing track at top, linux title bar drag no working
This commit is contained in:
parent
00d0d38b54
commit
1223cf2629
@ -207,28 +207,28 @@ class Settings extends HookConsumerWidget {
|
||||
leading: const Icon(Icons.ad_units_rounded),
|
||||
title: const PlatformText("Mimic Platform"),
|
||||
trailing: (context, update) =>
|
||||
PlatformDropDownMenu<TargetPlatform>(
|
||||
DropdownButton<TargetPlatform>(
|
||||
value: Spotube.of(context).appPlatform,
|
||||
items: [
|
||||
PlatformDropDownMenuItem(
|
||||
items: const [
|
||||
DropdownMenuItem(
|
||||
value: TargetPlatform.android,
|
||||
child: const PlatformText("Android (Material You)"),
|
||||
child: PlatformText("Android (Material You)"),
|
||||
),
|
||||
PlatformDropDownMenuItem(
|
||||
DropdownMenuItem(
|
||||
value: TargetPlatform.iOS,
|
||||
child: const PlatformText("iOS (Cupertino)"),
|
||||
child: PlatformText("iOS (Cupertino)"),
|
||||
),
|
||||
PlatformDropDownMenuItem(
|
||||
DropdownMenuItem(
|
||||
value: TargetPlatform.macOS,
|
||||
child: const PlatformText("macOS (Aqua)"),
|
||||
child: PlatformText("macOS (Aqua)"),
|
||||
),
|
||||
PlatformDropDownMenuItem(
|
||||
DropdownMenuItem(
|
||||
value: TargetPlatform.linux,
|
||||
child: const PlatformText("Linux (GTK+Libadwaita)"),
|
||||
child: PlatformText("Linux (GTK+Libadwaita)"),
|
||||
),
|
||||
PlatformDropDownMenuItem(
|
||||
DropdownMenuItem(
|
||||
value: TargetPlatform.windows,
|
||||
child: const PlatformText("Windows 11 (Fluent UI)"),
|
||||
child: PlatformText("Windows 11 (Fluent UI)"),
|
||||
),
|
||||
],
|
||||
onChanged: (value) {
|
||||
|
@ -23,9 +23,14 @@ class PageWindowTitleBar extends PlatformAppBar {
|
||||
}) : super(
|
||||
actions: [
|
||||
...?actions,
|
||||
if (!kIsMacOS && !kIsMobile) const PlatformWindowButtons(),
|
||||
if (!kIsMacOS && !kIsMobile)
|
||||
platform == TargetPlatform.linux
|
||||
? MoveWindow(child: const PlatformWindowButtons())
|
||||
: const PlatformWindowButtons(),
|
||||
],
|
||||
title: center,
|
||||
title: platform == TargetPlatform.linux
|
||||
? MoveWindow(child: Center(child: center))
|
||||
: center,
|
||||
);
|
||||
|
||||
@override
|
||||
|
@ -90,11 +90,15 @@ class CurrentPlaylist {
|
||||
|
||||
List<String> get trackIds => tracks.map((e) => e.id!).toList();
|
||||
|
||||
bool shuffle() {
|
||||
bool shuffle(Track? topTrack) {
|
||||
// won't shuffle if already shuffled
|
||||
if (_tempTrack == null) {
|
||||
_tempTrack = [...tracks];
|
||||
tracks.shuffle();
|
||||
if (topTrack != null) {
|
||||
tracks.remove(topTrack);
|
||||
tracks.insert(0, topTrack);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -290,7 +290,7 @@ class Playback extends PersistedChangeNotifier {
|
||||
switch (playbackMode) {
|
||||
case PlaybackMode.normal:
|
||||
playbackMode = PlaybackMode.shuffle;
|
||||
playlist?.shuffle();
|
||||
playlist?.shuffle(track);
|
||||
break;
|
||||
case PlaybackMode.shuffle:
|
||||
playbackMode = PlaybackMode.repeat;
|
||||
|
Loading…
Reference in New Issue
Block a user