Skip to content

Commit 80a6e0f

Browse files
authored
chore: less annoying colors (#1297)
1 parent 0d869a4 commit 80a6e0f

9 files changed

+35
-29
lines changed

lib/app/view/master_tile.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ class __PlayAbleMasterTileState extends State<_PlayAbleMasterTile> {
194194
icon: Icon(
195195
isPlaying && isEnQueued ? Iconz.pause : Iconz.playFilled,
196196
size: kTinyButtonIconSize,
197-
color: context.theme.colorScheme.primary,
197+
color: context.theme.colorScheme.onSurface,
198198
),
199199
),
200200
),

lib/app/view/mobile_bottom_bar.dart

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,19 @@ class MobileBottomBar extends StatelessWidget with WatchItMixin {
1313

1414
@override
1515
Widget build(BuildContext context) {
16-
final color = watchPropertyValue(
17-
(PlayerModel m) {
18-
final theme = context.theme;
19-
return Color.alphaBlend(
20-
m.color?.withAlpha(theme.isLight ? 20 : 40) ??
21-
theme.scaffoldBackgroundColor,
22-
context.theme.scaffoldBackgroundColor,
23-
);
24-
},
25-
);
16+
final theme = context.theme;
17+
final color = watchPropertyValue((PlayerModel m) => m.color);
18+
2619
return SizedBox(
2720
width: context.mediaQuerySize.width,
2821
child: RepaintBoundary(
2922
child: Material(
30-
color: color,
23+
color: color == null
24+
? theme.cardColor
25+
: Color.alphaBlend(
26+
color.withAlpha(theme.isLight ? 20 : 40),
27+
theme.scaffoldBackgroundColor,
28+
),
3129
child: Column(
3230
mainAxisSize: MainAxisSize.min,
3331
children: [

lib/app/view/mobile_page.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import 'package:collection/collection.dart';
22
import 'package:flutter/material.dart';
33
import 'package:watch_it/watch_it.dart';
44

5+
import '../../common/page_ids.dart';
6+
import '../../common/view/icons.dart';
57
import '../../common/view/ui_constants.dart';
68
import '../../extensions/build_context_x.dart';
79
import '../../player/player_model.dart';
@@ -117,9 +119,13 @@ class MasterRail extends StatelessWidget with WatchItMixin {
117119
final destinations = permanentMasterItems
118120
.map(
119121
(e) => NavigationRailDestination(
120-
icon: e.iconBuilder(false),
122+
icon: e.pageId == PageIDs.likedAudios
123+
? Icon(Iconz.heart)
124+
: e.iconBuilder(false),
121125
label: e.titleBuilder(context),
122-
selectedIcon: e.iconBuilder(true),
126+
selectedIcon: e.pageId == PageIDs.likedAudios
127+
? Icon(Iconz.heartFilled)
128+
: e.iconBuilder(true),
123129
padding: const EdgeInsets.symmetric(vertical: kSmallestSpace),
124130
),
125131
)

lib/player/view/bottom_player_image.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class BottomPlayerImage extends StatelessWidget with WatchItMixin {
5252
Widget child;
5353

5454
final fallBackImage = PlayerFallBackImage(
55-
audio: audio,
55+
audioType: audio?.audioType,
5656
height: size,
5757
width: size,
5858
);

lib/player/view/full_height_player_image.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class FullHeightPlayerImage extends StatelessWidget with WatchItMixin {
3838

3939
final fallBackImage = PlayerFallBackImage(
4040
noIcon: emptyFallBack,
41-
audio: audio,
41+
audioType: audio?.audioType,
4242
height: theHeight,
4343
width: theWidth,
4444
);

lib/player/view/player_color.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@ class PlayerColor extends StatelessWidget with WatchItMixin {
2525
final baseColor =
2626
watchPropertyValue((PlayerModel m) => m.color?.withValues(alpha: 0.4));
2727

28-
final color = (baseColor ?? theme.cardColor).scale(
29-
lightness: theme.isLight ? -0.1 : 0.2,
30-
saturation: theme.isLight ? 0.9 : 0.5,
31-
);
28+
final color = baseColor?.scale(lightness: theme.isLight ? -0.1 : 0.2) ??
29+
theme.scaffoldBackgroundColor;
30+
3231
return Opacity(
3332
opacity: alpha * 0.8,
3433
child: Container(

lib/player/view/player_fall_back_image.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
import 'package:flutter/material.dart';
22
import 'package:yaru/yaru.dart';
33

4-
import '../../common/data/audio.dart';
4+
import '../../common/data/audio_type.dart';
55
import '../../common/view/icons.dart';
66
import '../../extensions/build_context_x.dart';
77
import '../../extensions/theme_data_x.dart';
88

99
class PlayerFallBackImage extends StatelessWidget {
1010
const PlayerFallBackImage({
1111
super.key,
12-
this.audio,
12+
this.audioType,
1313
required this.height,
1414
required this.width,
1515
this.noIcon = false,
16-
this.color,
1716
});
1817

19-
final Audio? audio;
18+
final AudioType? audioType;
2019
final double height;
2120
final double width;
2221
final bool noIcon;
23-
final Color? color;
2422

2523
@override
2624
Widget build(BuildContext context) {
2725
final iconSize = width * 0.7;
2826
final theme = context.theme;
29-
final color = this.color ?? theme.primaryColor;
27+
final color = theme.cardColor.scale(
28+
lightness: theme.isLight ? -0.15 : 0.3,
29+
);
3030
return Center(
3131
child: Container(
3232
decoration: BoxDecoration(
@@ -50,7 +50,7 @@ class PlayerFallBackImage extends StatelessWidget {
5050
child: noIcon
5151
? null
5252
: Icon(
53-
audio?.audioType?.iconData ?? Iconz.musicNote,
53+
audioType?.iconData ?? Iconz.musicNote,
5454
size: iconSize,
5555
color: contrastColor(color),
5656
),

lib/player/view/player_remote_source_image.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'package:flutter/material.dart';
2+
import 'package:phoenix_theme/phoenix_theme.dart';
23
import 'package:watch_it/watch_it.dart';
34

45
import '../../common/view/safe_network_image.dart';
@@ -26,7 +27,9 @@ class PlayerRemoteSourceImage extends StatelessWidget with WatchItMixin {
2627
final theme = context.theme;
2728

2829
return Container(
29-
color: theme.cardColor,
30+
color: theme.cardColor.scale(
31+
lightness: theme.isLight ? -0.15 : 0.3,
32+
),
3033
height: height,
3134
width: width,
3235
child: SafeNetworkImage(

lib/settings/view/settings_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class _SettingsPageState extends State<SettingsPage> {
6464
constraints: constraints,
6565
limit: 600,
6666
min: 0,
67-
).copyWith(bottom: bottomPlayerDefaultHeight),
67+
).copyWith(bottom: bottomPlayerDefaultHeight * 2),
6868
children: const [
6969
ThemeSection(),
7070
PodcastSection(),

0 commit comments

Comments
 (0)