Skip to content

Commit 04b599b

Browse files
committed
style(win): make album art immersive without fixed boundaries
- Removed the fixed border around the album art\n- Set the album art to cover the background of the page with a uniform-to-fill stretch\n- Added a gradient overlay fading to the system background color to smoothly blend the bottom half into the UI
1 parent e89827f commit 04b599b

2 files changed

Lines changed: 42 additions & 16 deletions

File tree

Windows/ViewModels/PlayerViewModel.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ public partial class PlayerViewModel : ObservableObject
4848
[ObservableProperty]
4949
public partial Microsoft.UI.Xaml.Media.Imaging.BitmapImage? AlbumArtImage { get; set; }
5050

51+
partial void OnAlbumArtImageChanged(Microsoft.UI.Xaml.Media.Imaging.BitmapImage? value)
52+
{
53+
OnPropertyChanged(nameof(NoAlbumArtVisibility));
54+
}
55+
56+
public Microsoft.UI.Xaml.Visibility NoAlbumArtVisibility => AlbumArtImage == null ? Microsoft.UI.Xaml.Visibility.Visible : Microsoft.UI.Xaml.Visibility.Collapsed;
57+
5158
public DevicesViewModel DevicesVM { get; }
5259

5360
public PlayerViewModel(INetworkService networkService, ISmtcService smtcService, DevicesViewModel devicesVm)

Windows/Views/PlayerPage.xaml

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,45 @@
88
Background="Transparent"
99
mc:Ignorable="d">
1010

11-
<Grid Padding="24">
12-
<Grid MaxWidth="440" HorizontalAlignment="Center" VerticalAlignment="Center">
11+
<Grid>
12+
<!-- Background Immersive Image -->
13+
<Image
14+
Source="{x:Bind ViewModel.AlbumArtImage, Mode=OneWay}"
15+
Stretch="UniformToFill"
16+
VerticalAlignment="Top"
17+
HorizontalAlignment="Stretch"
18+
Opacity="0.5" />
19+
20+
<!-- Fade out gradient overlay -->
21+
<Border VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
22+
<Border.Background>
23+
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
24+
<GradientStop Offset="0.0" Color="#00000000" />
25+
<GradientStop Offset="0.5" Color="#00000000" />
26+
<GradientStop Offset="1.0" Color="{ThemeResource SystemAltHighColor}" />
27+
</LinearGradientBrush>
28+
</Border.Background>
29+
</Border>
30+
31+
<!-- Placeholder Icon -->
32+
<FontIcon
33+
FontFamily="Segoe Fluent Icons"
34+
Glyph="&#xE8D6;"
35+
FontSize="120"
36+
Foreground="{ThemeResource TextFillColorTertiaryBrush}"
37+
VerticalAlignment="Top"
38+
Margin="0,100,0,0"
39+
Visibility="{x:Bind ViewModel.NoAlbumArtVisibility, Mode=OneWay}" />
40+
41+
<!-- Foreground Content -->
42+
<Grid Padding="24">
1343
<Grid.RowDefinitions>
14-
<RowDefinition Height="Auto" />
1544
<RowDefinition Height="Auto" />
1645
<RowDefinition Height="*" />
1746
<RowDefinition Height="Auto" />
1847
</Grid.RowDefinitions>
1948

49+
<!-- Device Selector -->
2050
<ComboBox
2151
Grid.Row="0"
2252
x:Uid="SelectDevice"
@@ -34,19 +64,8 @@
3464
</ComboBox.ItemTemplate>
3565
</ComboBox>
3666

37-
<Grid Grid.Row="1" Height="24" />
38-
39-
<!-- Album Art Container (Responsive) -->
40-
<Viewbox Grid.Row="2" Stretch="Uniform" StretchDirection="DownOnly" HorizontalAlignment="Center" VerticalAlignment="Center">
41-
<Border Width="320" Height="320" CornerRadius="16" BorderBrush="{ThemeResource SurfaceStrokeColorDefault}" BorderThickness="1" Background="{ThemeResource LayerFillColorDefaultBrush}">
42-
<Grid>
43-
<FontIcon FontFamily="Segoe Fluent Icons" Glyph="&#xE8D6;" FontSize="64" Foreground="{ThemeResource TextFillColorTertiaryBrush}" />
44-
<Image Source="{x:Bind ViewModel.AlbumArtImage, Mode=OneWay}" Stretch="UniformToFill" />
45-
</Grid>
46-
</Border>
47-
</Viewbox>
48-
49-
<StackPanel Grid.Row="3" Spacing="16" Margin="16,24,16,0">
67+
<!-- Info & Controls -->
68+
<StackPanel Grid.Row="2" Spacing="16" MaxWidth="560" HorizontalAlignment="Stretch" VerticalAlignment="Bottom">
5069
<!-- Text -->
5170
<StackPanel Spacing="4">
5271
<TextBlock Text="{x:Bind ViewModel.DisplayTitle, Mode=OneWay}" Style="{ThemeResource TitleTextBlockStyle}" FontWeight="Bold" TextTrimming="CharacterEllipsis" MaxLines="1" HorizontalAlignment="Left" />

0 commit comments

Comments
 (0)