Skip to content
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
7 changes: 2 additions & 5 deletions src/UniGetUI/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@
Grid.ColumnSpan="3"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
/>
<!-- Splash: Height matches the 620:300 aspect ratio of SplashScreen.svg so the image fills the grid exactly. SvgImageSource is used so the host window's background shows through the transparent SVG. The tagline's 90px left margin shifts its centering from the image center (x=270) to the wordmark center (x≈315) within the 540-wide grid. -->
<!-- Splash: 540x261 keeps the 620:300 aspect ratio of the artwork. Source is a transparent PNG set theme-aware in code-behind (SvgImageSource renders blank here). The tagline's 90px left margin shifts its centering to the wordmark center (x≈315) within the 540-wide grid. -->
<Grid Grid.Row="1" Grid.Column="1" Width="540" Height="261">
<Image Stretch="Uniform">
<Image x:Name="SplashImage" Stretch="Uniform">
<animations:Explicit.Animations>
<animations:AnimationSet x:Name="InAnimation_Border">
<animations:TranslationAnimation
Expand All @@ -132,9 +132,6 @@
/>
</animations:AnimationSet>
</animations:Explicit.Animations>
<Image.Source>
<SvgImageSource UriSource="ms-appx:///Assets/SplashScreen.svg" RasterizePixelWidth="540" RasterizePixelHeight="261" />
</Image.Source>
</Image>
<widgets:TranslatedTextBlock
HorizontalAlignment="Center"
Expand Down
8 changes: 8 additions & 0 deletions src/UniGetUI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public MainWindow()

LoadTrayMenu();
ApplyTheme();
ApplySplashImage();
ApplyProxyVariableToProcess();
_applySubtitleToWindow();

Expand Down Expand Up @@ -706,6 +707,13 @@ public void ShowFromTray()
Activate();
}

private void ApplySplashImage()
{
bool dark = MainApp.Instance.ThemeListener.CurrentTheme == ApplicationTheme.Dark;
string asset = dark ? "SplashScreen.theme-dark.png" : "SplashScreen.png";
SplashImage.Source = new Microsoft.UI.Xaml.Media.Imaging.BitmapImage(new Uri($"ms-appx:///Assets/{asset}"));
}

public void ApplyTheme()
{
string preferredTheme = Settings.GetValue(Settings.K.PreferredTheme);
Expand Down
Loading