Skip to content

Commit

Permalink
fix: dialog logo in android, lyrics visible timer adjust button
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Nov 24, 2022
1 parent be56ad4 commit 3c6803b
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 48 deletions.
61 changes: 32 additions & 29 deletions lib/components/Lyrics/LyricDelayAdjustDialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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";
},
),
],
),
),
);
}
Expand Down
30 changes: 18 additions & 12 deletions lib/components/Lyrics/SyncedLyrics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
},
),
),
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/components/Playlist/PlaylistCreateDialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion lib/components/Settings/ColorSchemePickerDialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion lib/components/Shared/AdaptiveListTile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lib/components/Shared/DownloadConfirmationDialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion lib/components/Shared/ReplaceDownloadedFileDialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lib/components/Shared/TrackTile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class TrackTile extends HookConsumerWidget {
return HookBuilder(builder: (context) {
final playlistsCheck = useState(<String, bool>{});
return PlatformAlertDialog(
icon: Sidebar.brandLogo(),
macosAppIcon: Sidebar.brandLogo(),
title: PlatformText(
"Add `${track.value.name}` to following Playlists",
style: const TextStyle(
Expand Down
2 changes: 1 addition & 1 deletion lib/hooks/useUpdateChecker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 3c6803b

Please sign in to comment.