diff --git a/lib/components/Settings/Settings.dart b/lib/components/Settings/Settings.dart index 5efd3efd8..235395932 100644 --- a/lib/components/Settings/Settings.dart +++ b/lib/components/Settings/Settings.dart @@ -207,28 +207,28 @@ class Settings extends HookConsumerWidget { leading: const Icon(Icons.ad_units_rounded), title: const PlatformText("Mimic Platform"), trailing: (context, update) => - PlatformDropDownMenu( + DropdownButton( 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) { diff --git a/lib/components/Shared/PageWindowTitleBar.dart b/lib/components/Shared/PageWindowTitleBar.dart index 582351262..2aadc7a69 100644 --- a/lib/components/Shared/PageWindowTitleBar.dart +++ b/lib/components/Shared/PageWindowTitleBar.dart @@ -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 diff --git a/lib/models/CurrentPlaylist.dart b/lib/models/CurrentPlaylist.dart index 045f2e0b7..b763cb2ea 100644 --- a/lib/models/CurrentPlaylist.dart +++ b/lib/models/CurrentPlaylist.dart @@ -90,11 +90,15 @@ class CurrentPlaylist { List 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; diff --git a/lib/provider/Playback.dart b/lib/provider/Playback.dart index 4d416f467..e7207fd6e 100644 --- a/lib/provider/Playback.dart +++ b/lib/provider/Playback.dart @@ -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;