From 3c6803bb3fac8eee9166764089724194a48509c6 Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Thu, 24 Nov 2022 11:06:14 +0600 Subject: [PATCH] fix: dialog logo in android, lyrics visible timer adjust button --- .../Lyrics/LyricDelayAdjustDialog.dart | 61 ++++++++++--------- lib/components/Lyrics/SyncedLyrics.dart | 30 +++++---- .../Playlist/PlaylistCreateDialog.dart | 2 +- .../Settings/ColorSchemePickerDialog.dart | 2 +- lib/components/Shared/AdaptiveListTile.dart | 2 +- .../Shared/DownloadConfirmationDialog.dart | 2 +- .../Shared/ReplaceDownloadedFileDialog.dart | 2 +- lib/components/Shared/TrackTile.dart | 2 +- lib/hooks/useUpdateChecker.dart | 2 +- 9 files changed, 57 insertions(+), 48 deletions(-) diff --git a/lib/components/Lyrics/LyricDelayAdjustDialog.dart b/lib/components/Lyrics/LyricDelayAdjustDialog.dart index 65ead135..19dacec7 100644 --- a/lib/components/Lyrics/LyricDelayAdjustDialog.dart +++ b/lib/components/Lyrics/LyricDelayAdjustDialog.dart @@ -18,7 +18,7 @@ class LyricDelayAdjustDialog extends HookConsumerWidget { double.tryParse(controller.text.replaceAll("ms", "")) ?? 0; return PlatformAlertDialog( - icon: Sidebar.brandLogo(), + macosAppIcon: Sidebar.brandLogo(), title: const Center(child: Text("Adjust Lyrics Delay")), secondaryActions: [ PlatformFilledButton( @@ -41,36 +41,39 @@ class LyricDelayAdjustDialog extends HookConsumerWidget { }, ) ], - content: Row( - mainAxisSize: MainAxisSize.min, - children: [ - PlatformIconButton( - icon: const Icon(Icons.remove_rounded), - onPressed: () { - controller.text = "${getValue() - 25}ms"; - }, - ), - Flexible( - child: PlatformTextField( - keyboardType: TextInputType.number, - controller: controller, - placeholder: "Delay in milliseconds", - onSubmitted: (_) { - Navigator.of(context).pop( - Duration( - milliseconds: getValue().toInt(), - ), - ); + content: SizedBox( + height: 100, + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + PlatformIconButton( + icon: const Icon(Icons.remove_rounded), + onPressed: () { + controller.text = "${getValue() - 25}ms"; }, ), - ), - PlatformIconButton( - icon: const Icon(Icons.add_rounded), - onPressed: () { - controller.text = "${getValue() + 25}ms"; - }, - ), - ], + Flexible( + child: PlatformTextField( + keyboardType: TextInputType.number, + controller: controller, + placeholder: "Delay in milliseconds", + onSubmitted: (_) { + Navigator.of(context).pop( + Duration( + milliseconds: getValue().toInt(), + ), + ); + }, + ), + ), + PlatformIconButton( + icon: const Icon(Icons.add_rounded), + onPressed: () { + controller.text = "${getValue() + 25}ms"; + }, + ), + ], + ), ), ); } diff --git a/lib/components/Lyrics/SyncedLyrics.dart b/lib/components/Lyrics/SyncedLyrics.dart index 2b5c197c..ea130908 100644 --- a/lib/components/Lyrics/SyncedLyrics.dart +++ b/lib/components/Lyrics/SyncedLyrics.dart @@ -87,18 +87,24 @@ class SyncedLyrics extends HookConsumerWidget { Positioned.fill( child: Align( alignment: Alignment.centerRight, - child: PlatformIconButton( - tooltip: "Lyrics Delay", - icon: const Icon(Icons.av_timer_rounded), - onPressed: () async { - final delay = await showPlatformAlertDialog( - context, - builder: (context) => const LyricDelayAdjustDialog(), - ); - if (delay != null) { - ref.read(lyricDelayState.notifier).state = delay; - } - }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: PlatformFilledButton( + child: const Icon( + Icons.av_timer_rounded, + size: 16, + ), + onPressed: () async { + final delay = await showPlatformAlertDialog( + context, + builder: (context) => + const LyricDelayAdjustDialog(), + ); + if (delay != null) { + ref.read(lyricDelayState.notifier).state = delay; + } + }, + ), ), ), ), diff --git a/lib/components/Playlist/PlaylistCreateDialog.dart b/lib/components/Playlist/PlaylistCreateDialog.dart index ab96fc77..71fc1b3b 100644 --- a/lib/components/Playlist/PlaylistCreateDialog.dart +++ b/lib/components/Playlist/PlaylistCreateDialog.dart @@ -26,7 +26,7 @@ class PlaylistCreateDialog extends HookConsumerWidget { final collaborative = useState(false); return PlatformAlertDialog( - icon: Sidebar.brandLogo(), + macosAppIcon: Sidebar.brandLogo(), title: const Text("Create a Playlist"), primaryActions: [ PlatformFilledButton( diff --git a/lib/components/Settings/ColorSchemePickerDialog.dart b/lib/components/Settings/ColorSchemePickerDialog.dart index 84a515d4..d965f0d4 100644 --- a/lib/components/Settings/ColorSchemePickerDialog.dart +++ b/lib/components/Settings/ColorSchemePickerDialog.dart @@ -68,7 +68,7 @@ class ColorSchemePickerDialog extends HookConsumerWidget { ).key); return PlatformAlertDialog( - icon: Sidebar.brandLogo(), + macosAppIcon: Sidebar.brandLogo(), title: Text("Pick ${schemeType.name} color scheme"), primaryActions: [ PlatformFilledButton( diff --git a/lib/components/Shared/AdaptiveListTile.dart b/lib/components/Shared/AdaptiveListTile.dart index 9bb07bcd..48616d47 100644 --- a/lib/components/Shared/AdaptiveListTile.dart +++ b/lib/components/Shared/AdaptiveListTile.dart @@ -41,7 +41,7 @@ class AdaptiveListTile extends HookWidget { builder: (context) { return StatefulBuilder(builder: (context, update) { return PlatformAlertDialog( - icon: Sidebar.brandLogo(), + macosAppIcon: Sidebar.brandLogo(), title: title != null ? Row( crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/components/Shared/DownloadConfirmationDialog.dart b/lib/components/Shared/DownloadConfirmationDialog.dart index d2f6d68c..07ef294b 100644 --- a/lib/components/Shared/DownloadConfirmationDialog.dart +++ b/lib/components/Shared/DownloadConfirmationDialog.dart @@ -9,7 +9,7 @@ class DownloadConfirmationDialog extends StatelessWidget { @override Widget build(BuildContext context) { return PlatformAlertDialog( - icon: Sidebar.brandLogo(), + macosAppIcon: Sidebar.brandLogo(), title: Padding( padding: const EdgeInsets.all(15), child: Row( diff --git a/lib/components/Shared/ReplaceDownloadedFileDialog.dart b/lib/components/Shared/ReplaceDownloadedFileDialog.dart index 1c3b16f0..883b1365 100644 --- a/lib/components/Shared/ReplaceDownloadedFileDialog.dart +++ b/lib/components/Shared/ReplaceDownloadedFileDialog.dart @@ -16,7 +16,7 @@ class ReplaceDownloadedFileDialog extends ConsumerWidget { final groupValue = ref.watch(replaceDownloadedFileState); return PlatformAlertDialog( - icon: Sidebar.brandLogo(), + macosAppIcon: Sidebar.brandLogo(), title: Text("Track ${track.name} Already Exists"), content: Column( mainAxisSize: MainAxisSize.min, diff --git a/lib/components/Shared/TrackTile.dart b/lib/components/Shared/TrackTile.dart index d7984c67..232faa56 100644 --- a/lib/components/Shared/TrackTile.dart +++ b/lib/components/Shared/TrackTile.dart @@ -96,7 +96,7 @@ class TrackTile extends HookConsumerWidget { return HookBuilder(builder: (context) { final playlistsCheck = useState({}); return PlatformAlertDialog( - icon: Sidebar.brandLogo(), + macosAppIcon: Sidebar.brandLogo(), title: PlatformText( "Add `${track.value.name}` to following Playlists", style: const TextStyle( diff --git a/lib/hooks/useUpdateChecker.dart b/lib/hooks/useUpdateChecker.dart index 797e6dc3..448c9fb7 100644 --- a/lib/hooks/useUpdateChecker.dart +++ b/lib/hooks/useUpdateChecker.dart @@ -57,7 +57,7 @@ void useUpdateChecker(WidgetRef ref) { const url = "https://spotube.netlify.app/other-downloads/stable-downloads"; return PlatformAlertDialog( - icon: Sidebar.brandLogo(), + macosAppIcon: Sidebar.brandLogo(), title: const PlatformText("Spotube has an update"), primaryActions: [ PlatformFilledButton(