Skip to content

Commit

Permalink
feat: WIP fix xaml updates in 11.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rabbitism committed Sep 14, 2024
1 parent 388992f commit c312b48
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 52 deletions.
2 changes: 1 addition & 1 deletion demo/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Nullable>enable</Nullable>
<AvaloniaVersion>11.1.3</AvaloniaVersion>
<AvaloniaVersion>11.2.0-beta1</AvaloniaVersion>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion src/Package.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<Version>1.3.0</Version>
<AvaloniaVersion>11.1.1</AvaloniaVersion>
<AvaloniaVersion>11.2.0-beta1</AvaloniaVersion>
<Authors>IRIHI Technology Co., Ltd.</Authors>
<RepositoryUrl>https://github.com/irihitech/Ursa.Avalonia</RepositoryUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
44 changes: 24 additions & 20 deletions src/Ursa.Themes.Semi/Controls/Divider.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,6 @@
<Setter Property="VerticalAlignment" Value="Center" />
</ControlTheme>

<ControlTheme x:Key="DividerContentPresenter" TargetType="{x:Type ContentPresenter}">
<Setter Property="ContentPresenter.Content" Value="{TemplateBinding Content}" />
<Setter Property="ContentPresenter.Background" Value="{TemplateBinding Background}" />
<Setter Property="TextElement.Foreground" Value="{TemplateBinding Foreground}" />
<Setter Property="ContentPresenter.ContentTemplate" Value="{TemplateBinding ContentTemplate}" />
<Setter Property="TextElement.FontFamily" Value="{TemplateBinding FontFamily}" />
<Setter Property="TextElement.FontWeight" Value="{TemplateBinding FontWeight}" />
<Setter Property="TextElement.FontSize" Value="{TemplateBinding FontSize}" />
<Setter Property="ContentPresenter.Margin" Value="{DynamicResource ThicknessDividerTextMargin}" />
<Setter Property="VerticalAlignment" Value="Center" />
</ControlTheme>

<ControlTheme x:Key="{x:Type u:Divider}" TargetType="u:Divider">
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="FontSize" Value="14" />
Expand All @@ -49,8 +37,12 @@
<Rectangle Theme="{StaticResource DividerLeftLine}" />
<ContentPresenter
Grid.Column="1"
IsVisible="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}"
Theme="{StaticResource DividerContentPresenter}" />
Content="{TemplateBinding Content}"
Background="{TemplateBinding Background}"
Foreground="{TemplateBinding Foreground}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Margin="{DynamicResource ThicknessDividerTextMargin}"
IsVisible="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}"/>
<Rectangle Grid.Column="2" Theme="{StaticResource DividerRightLine}" />
</Grid>
</ControlTemplate>
Expand All @@ -66,8 +58,12 @@
<Rectangle Theme="{StaticResource DividerLeftLine}" />
<ContentPresenter
Grid.Column="1"
IsVisible="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}"
Theme="{StaticResource DividerContentPresenter}" />
Content="{TemplateBinding Content}"
Background="{TemplateBinding Background}"
Foreground="{TemplateBinding Foreground}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Margin="{DynamicResource ThicknessDividerTextMargin}"
IsVisible="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}"/>
<Rectangle Grid.Column="2" Theme="{StaticResource DividerRightLine}" />
</Grid>
</ControlTemplate>
Expand All @@ -83,8 +79,12 @@
<Rectangle Theme="{StaticResource DividerLeftLine}" />
<ContentPresenter
Grid.Column="1"
IsVisible="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}"
Theme="{StaticResource DividerContentPresenter}" />
Content="{TemplateBinding Content}"
Background="{TemplateBinding Background}"
Foreground="{TemplateBinding Foreground}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Margin="{DynamicResource ThicknessDividerTextMargin}"
IsVisible="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}"/>
<Rectangle Grid.Column="2" Theme="{StaticResource DividerRightLine}" />
</Grid>
</ControlTemplate>
Expand All @@ -100,8 +100,12 @@
<Rectangle Theme="{StaticResource DividerLeftLine}" />
<ContentPresenter
Grid.Column="1"
IsVisible="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}"
Theme="{StaticResource DividerContentPresenter}" />
Content="{TemplateBinding Content}"
Background="{TemplateBinding Background}"
Foreground="{TemplateBinding Foreground}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Margin="{DynamicResource ThicknessDividerTextMargin}"
IsVisible="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}"/>
<Rectangle Grid.Column="2" Theme="{StaticResource DividerRightLine}" />
</Grid>
</ControlTemplate>
Expand Down
37 changes: 7 additions & 30 deletions src/Ursa.Themes.Semi/Controls/UrsaWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,13 @@
<Setter Property="ExtendClientAreaTitleBarHeightHint" Value="-1" />
<Setter Property="ExtendClientAreaToDecorationsHint" Value="True" />
<Setter Property="u:OverlayDialogHost.IsModalStatusScope" Value="True" />
<Setter Property="IsMinimizeButtonVisible">
<OnPlatform>
<On Options="Default, Windows, Linux">
<x:Boolean>True</x:Boolean>
</On>
<On Options="macOS">
<x:Boolean>False</x:Boolean>
</On>
</OnPlatform>
</Setter>
<Setter Property="IsRestoreButtonVisible">
<OnPlatform>
<On Options="Default, Windows, Linux">
<x:Boolean>True</x:Boolean>
</On>
<On Options="macOS">
<x:Boolean>False</x:Boolean>
</On>
</OnPlatform>
</Setter>
<Setter Property="IsCloseButtonVisible">
<OnPlatform>
<On Options="Default, Windows, Linux">
<x:Boolean>True</x:Boolean>
</On>
<On Options="macOS">
<x:Boolean>False</x:Boolean>
</On>
</OnPlatform>
</Setter>
<!--
<Setter Property="IsMinimizeButtonVisible" Value="{OnPlatform Default=True, Windows=True, Linux=True, macOS=False}" />
<Setter Property="IsRestoreButtonVisible" Value="{OnPlatform Default=True, Windows=True, Linux=True, macOS=False}" />
<Setter Property="IsCloseButtonVisible" Value="{OnPlatform Default=True, Windows=True, Linux=True, macOS=False}" />
-->
<Setter Property="SystemDecorations">
<OnPlatform>
<On Options="Default, Windows, macOS">
Expand Down

0 comments on commit c312b48

Please sign in to comment.