From 5914bd2cdf1dae2de478a840ea7b04fbcdeb1d41 Mon Sep 17 00:00:00 2001 From: Feichtmeier Date: Tue, 26 Nov 2024 19:04:49 +0100 Subject: [PATCH] fix: wrong radius for play button on desktop --- lib/common/view/avatar_play_button.dart | 2 +- lib/common/view/theme.dart | 4 ++-- lib/player/view/player_main_controls.dart | 6 ++++-- lib/podcasts/view/podcast_audio_tile.dart | 2 +- lib/podcasts/view/podcast_tile_play_button.dart | 4 ++-- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/common/view/avatar_play_button.dart b/lib/common/view/avatar_play_button.dart index d307fe03..326113e9 100644 --- a/lib/common/view/avatar_play_button.dart +++ b/lib/common/view/avatar_play_button.dart @@ -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, diff --git a/lib/common/view/theme.dart b/lib/common/view/theme.dart index c3b1e70a..de636f84 100644 --- a/lib/common/view/theme.dart +++ b/lib/common/view/theme.dart @@ -217,7 +217,7 @@ double get likeButtonWidth => yaruStyled ? 62 : 70; double get progressStrokeWidth => 3.0; -double get avatarIconRadius => +double get smallAvatarButtonRadius => (yaruStyled ? kYaruTitleBarItemHeight : isMobile @@ -225,7 +225,7 @@ double get avatarIconRadius => : 38) / 2; -double get bigPlayButtonRadius => yaruStyled +double get bigAvatarButtonRadius => yaruStyled ? 22 : isMobile ? 26 diff --git a/lib/player/view/player_main_controls.dart b/lib/player/view/player_main_controls.dart index 4cab1a97..5f380c60 100644 --- a/lib/player/view/player_main_controls.dart +++ b/lib/player/view/player_main_controls.dart @@ -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'; @@ -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, ), ) diff --git a/lib/podcasts/view/podcast_audio_tile.dart b/lib/podcasts/view/podcast_audio_tile.dart index e9c592f6..cbe156e1 100644 --- a/lib/podcasts/view/podcast_audio_tile.dart +++ b/lib/podcasts/view/podcast_audio_tile.dart @@ -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( diff --git a/lib/podcasts/view/podcast_tile_play_button.dart b/lib/podcasts/view/podcast_tile_play_button.dart index 8c0a5152..3047a3a0 100644 --- a/lib/podcasts/view/podcast_tile_play_button.dart +++ b/lib/podcasts/view/podcast_tile_play_button.dart @@ -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(