Skip to content

Commit

Permalink
feat: add default Theme to SplashWindow.
Browse files Browse the repository at this point in the history
  • Loading branch information
zdpcdt committed Feb 24, 2025
1 parent 92011c7 commit b20137e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 13 deletions.
15 changes: 2 additions & 13 deletions demo/Ursa.Demo/Views/MainSplashWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,11 @@
x:Class="Ursa.Demo.Views.MainSplashWindow"
xmlns="/~https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:iri="https://irihi.tech/shared"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:u="https://irihi.tech/ursa"
Title="MainSplashWindow"
Width="400"
Height="400"
d:DesignHeight="450"
d:DesignWidth="800"
CountDown="0:0:3"
ExtendClientAreaChromeHints="NoChrome"
ExtendClientAreaTitleBarHeightHint="0"
ExtendClientAreaToDecorationsHint="True"
SystemDecorations="None"
WindowStartupLocation="CenterScreen"
mc:Ignorable="d">
Height="400">
<Grid
HorizontalAlignment="Center"
VerticalAlignment="Center"
Expand Down Expand Up @@ -51,4 +40,4 @@
Text="Aesthetic Evolution of Productivity" />
</StackPanel>
</Grid>
</u:SplashWindow>
</u:SplashWindow>
27 changes: 27 additions & 0 deletions src/Ursa.Themes.Semi/Controls/SplashWindow.axaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<ResourceDictionary
xmlns="/~https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa">
<ControlTheme x:Key="{x:Type u:SplashWindow}" TargetType="u:SplashWindow">
<Setter Property="CountDown" Value="0:0:3" />
<Setter Property="Background" Value="{DynamicResource WindowDefaultBackground}" />
<Setter Property="TransparencyBackgroundFallback" Value="{DynamicResource WindowDefaultBackground}" />
<Setter Property="Foreground" Value="{DynamicResource WindowDefaultForeground}" />
<Setter Property="FontSize" Value="{DynamicResource DefaultFontSize}" />
<Setter Property="FontFamily" Value="{DynamicResource DefaultFontFamily}" />
<Setter Property="ExtendClientAreaChromeHints" Value="NoChrome" />
<Setter Property="ExtendClientAreaTitleBarHeightHint" Value="0" />
<Setter Property="ExtendClientAreaToDecorationsHint" Value="True" />
<Setter Property="WindowStartupLocation" Value="CenterScreen" />
<Setter Property="SystemDecorations">
<OnPlatform>
<On Options="Default, Windows, macOS">
<SystemDecorations>Full</SystemDecorations>
</On>
<On Options="Linux">
<SystemDecorations>None</SystemDecorations>
</On>
</OnPlatform>
</Setter>
</ControlTheme>
</ResourceDictionary>
1 change: 1 addition & 0 deletions src/Ursa.Themes.Semi/Controls/_index.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,6 @@
<ResourceInclude Source="UrsaWindow.axaml"/>
<ResourceInclude Source="PinCode.axaml" />
<ResourceInclude Source="PathPicker.axaml"/>
<ResourceInclude Source="SplashWindow.axaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
2 changes: 2 additions & 0 deletions src/Ursa/Windows/SplashWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ namespace Ursa.Controls;

public abstract class SplashWindow: Window
{
protected override Type StyleKeyOverride => typeof(SplashWindow);

public static readonly StyledProperty<TimeSpan?> CountDownProperty = AvaloniaProperty.Register<SplashWindow, TimeSpan?>(
nameof(CountDown));

Expand Down

0 comments on commit b20137e

Please sign in to comment.