feat: WIP dialog window.
This commit is contained in:
52
src/Ursa.Themes.Semi/Controls/Dialog.axaml
Normal file
52
src/Ursa.Themes.Semi/Controls/Dialog.axaml
Normal file
@@ -0,0 +1,52 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:u="https://irihi.tech/ursa">
|
||||
<!-- Add Resources Here -->
|
||||
<ControlTheme x:Key="{x:Type u:DialogControl}" TargetType="u:DialogControl">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="u:DialogControl">
|
||||
<Border HorizontalAlignment="Center" VerticalAlignment="Center" Theme="{DynamicResource CardBorder}" Width="100" Height="100" IsHitTestVisible="True">
|
||||
<Grid RowDefinitions="Auto, *, Auto">
|
||||
<ContentPresenter Content="{TemplateBinding Content}"></ContentPresenter>
|
||||
</Grid>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="{x:Type u:DialogWindow}" TargetType="u:DialogWindow">
|
||||
<Setter Property="Title" Value="{x:Null}" />
|
||||
<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="Padding" Value="48 24" />
|
||||
<Setter Property="SizeToContent" Value="WidthAndHeight" />
|
||||
<Setter Property="WindowStartupLocation" Value="CenterOwner" />
|
||||
<Setter Property="ExtendClientAreaTitleBarHeightHint" Value="1" />
|
||||
<Setter Property="ExtendClientAreaToDecorationsHint" Value="True" />
|
||||
<Setter Property="ExtendClientAreaChromeHints" Value="SystemChrome"/>
|
||||
<Setter Property="SystemDecorations">
|
||||
<OnPlatform >
|
||||
<OnPlatform.Windows><SystemDecorations>Full</SystemDecorations></OnPlatform.Windows>
|
||||
<OnPlatform.Default><SystemDecorations>BorderOnly</SystemDecorations></OnPlatform.Default>
|
||||
</OnPlatform>
|
||||
</Setter>
|
||||
<Setter Property="CanResize" Value="False" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="u:DialogWindow">
|
||||
<Panel>
|
||||
<Border Name="PART_TransparencyFallback" IsHitTestVisible="False" />
|
||||
<Border Background="{TemplateBinding Background}" IsHitTestVisible="False" />
|
||||
<Panel Margin="{TemplateBinding WindowDecorationMargin}" Background="Transparent" />
|
||||
<ChromeOverlayLayer></ChromeOverlayLayer>
|
||||
<Grid RowDefinitions="Auto, *, Auto">
|
||||
<Button Name="{x:Static u:DialogWindow.PART_CloseButton}" VerticalAlignment="Top">Close</Button>
|
||||
<ContentPresenter Content="{TemplateBinding Content}"></ContentPresenter>
|
||||
</Grid>
|
||||
</Panel>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
Reference in New Issue
Block a user