feat: replace pure rectangle in several places. use pure rectangle in public repo.

This commit is contained in:
rabbitism
2024-02-26 02:01:52 +08:00
parent 6fe134ba49
commit fc80e1bda1
11 changed files with 22 additions and 111 deletions

View File

@@ -1,14 +1,14 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa"
xmlns:shapes="clr-namespace:Ursa.Controls.Shapes;assembly=Ursa">
xmlns:iri="https://irihi.tech/shared">
<!-- Add Resources Here -->
<ControlTheme TargetType="u:DisableContainer" x:Key="{x:Type u:DisableContainer}">
<Setter Property="Template">
<ControlTemplate TargetType="u:DisableContainer">
<Panel>
<ContentPresenter Content="{TemplateBinding Content}"></ContentPresenter>
<shapes:PureRectangle Background="Transparent" IsVisible="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content.IsEnabled, Converter={x:Static BoolConverters.Not}}" Cursor="No" ToolTip.Tip="{TemplateBinding DisabledTip}"/>
<iri:PureRectangle Background="Transparent" IsVisible="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content.IsEnabled, Converter={x:Static BoolConverters.Not}}" Cursor="No" ToolTip.Tip="{TemplateBinding DisabledTip}"/>
</Panel>
</ControlTemplate>
</Setter>

View File

@@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Ursa.Themes.Semi.Converters"
xmlns:u="clr-namespace:Ursa.Controls;assembly=Ursa"
xmlns:shapes="clr-namespace:Ursa.Controls.Shapes;assembly=Ursa">
xmlns:iri="https://irihi.tech/shared">
<!-- Add Resources Here -->
<converters:BrushToColorConverter x:Key="BrushToColorConverter" />
<ControlTheme x:Key="{x:Type u:LoadingIcon}" TargetType="u:LoadingIcon">
@@ -68,9 +68,10 @@
<Setter Property="Template">
<ControlTemplate TargetType="u:Loading">
<Panel IsVisible="{TemplateBinding IsLoading}">
<shapes:PureRectangle
<iri:PureRectangle
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
IsHitTestVisible="True"
Background="{TemplateBinding Background}" />
<Grid
HorizontalAlignment="Center"

View File

@@ -1,7 +1,8 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa">
xmlns:u="https://irihi.tech/ursa"
xmlns:iri="https://irihi.tech/shared">
<Design.PreviewWith>
<Border Padding="20">
<!-- Add Controls for Previewer Here -->
@@ -24,19 +25,19 @@
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" />
<Border
<iri:PureRectangle
x:Name="PART_LoadingBorder"
Classes.Active="{Binding Path= IsActive, RelativeSource={RelativeSource TemplatedParent}}"
IsHitTestVisible="{TemplateBinding IsLoading}"
Background="{DynamicResource SkeletonDefaultBackground}"
IsVisible="{TemplateBinding IsLoading}">
</Border>
<Border
</iri:PureRectangle>
<iri:PureRectangle
x:Name="PART_ActiveBorder"
IsHitTestVisible="{TemplateBinding IsLoading}"
IsVisible="{TemplateBinding IsLoading}"
>
</Border>
</iri:PureRectangle>
</Panel>
</Border>
</ControlTemplate>