Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: wrong radius for play button on desktop #1053

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/common/view/avatar_play_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class AvatarPlayButton extends StatelessWidget with WatchItMixin {
return Padding(
padding: bigPlayButtonPadding,
child: CircleAvatar(
radius: bigPlayButtonRadius,
radius: bigAvatarButtonRadius,
backgroundColor: theme.colorScheme.inverseSurface,
child: IconButton(
tooltip: context.l10n.playAll,
Expand Down
4 changes: 2 additions & 2 deletions lib/common/view/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,15 @@ double get likeButtonWidth => yaruStyled ? 62 : 70;

double get progressStrokeWidth => 3.0;

double get avatarIconRadius =>
double get smallAvatarButtonRadius =>
(yaruStyled
? kYaruTitleBarItemHeight
: isMobile
? 42
: 38) /
2;

double get bigPlayButtonRadius => yaruStyled
double get bigAvatarButtonRadius => yaruStyled
? 22
: isMobile
? 26
Expand Down
6 changes: 4 additions & 2 deletions lib/player/view/player_main_controls.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:watch_it/watch_it.dart';
import 'package:yaru/yaru.dart';

import '../../app/connectivity_model.dart';
import '../../common/data/audio_type.dart';
Expand Down Expand Up @@ -48,13 +49,14 @@ class PlayerMainControls extends StatelessWidget with WatchItMixin {
active: active,
);

final radius = isMobile ? bigAvatarButtonRadius : smallAvatarButtonRadius;
final playButton = avatarPlayButton
? CircleAvatar(
radius: bigPlayButtonRadius,
radius: radius,
backgroundColor:
avatarColor ?? (theme.isLight ? Colors.black : Colors.white),
child: SizedBox.square(
dimension: 2 * bigPlayButtonRadius,
dimension: 2 * radius,
child: rawPlayButton,
),
)
Expand Down
2 changes: 1 addition & 1 deletion lib/podcasts/view/podcast_audio_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class PodcastAudioTile extends StatelessWidget {
padding: isMobile
? const EdgeInsets.symmetric(horizontal: 10)
: EdgeInsets.only(
left: (avatarIconRadius * 2) + 30,
left: (smallAvatarButtonRadius * 2) + 30,
right: 60,
),
child: Column(
Expand Down
4 changes: 2 additions & 2 deletions lib/podcasts/view/podcast_tile_play_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ class PodcastTilePlayButton extends StatelessWidget {
: Duration(milliseconds: audio.durationMs!.toInt()),
),
CircleAvatar(
radius: avatarIconRadius,
radius: smallAvatarButtonRadius,
backgroundColor: selected
? theme.colorScheme.primary.withOpacity(0.08)
: theme.colorScheme.onSurface.withOpacity(0.09),
child: SizedBox.square(
dimension: avatarIconRadius * 2,
dimension: smallAvatarButtonRadius * 2,
child: IconButton(
icon: (isPlayerPlaying && selected)
? Icon(
Expand Down