Skip to content

Commit

Permalink
Merge pull request #300 from irihitech/trim
Browse files Browse the repository at this point in the history
Fix several trimming issue
  • Loading branch information
rabbitism authored Jul 22, 2024
2 parents 96ec5b6 + 25d6a00 commit 0c3c237
Show file tree
Hide file tree
Showing 32 changed files with 102 additions and 60 deletions.
2 changes: 2 additions & 0 deletions demo/Ursa.Demo.Browser/Ursa.Demo.Browser.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
</PropertyGroup>

<ItemGroup>
<!--
<TrimmerRootDescriptor Include="Roots.xml"/>
-->
<AvaloniaResource Include="Assets\**"/>
</ItemGroup>

Expand Down
6 changes: 5 additions & 1 deletion demo/Ursa.Demo.Desktop/Ursa.Demo.Desktop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<AvaloniaUseCompiledBindingsByDefault>false</AvaloniaUseCompiledBindingsByDefault>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
</PropertyGroup>

<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>

<ItemGroup>
<TrimmerRootAssembly Include="Ursa.Demo" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)"/>
Expand Down
2 changes: 2 additions & 0 deletions demo/Ursa.Demo/Pages/AvatarDemo.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:u="https://irihi.tech/ursa"
xmlns:vm="clr-namespace:Ursa.Demo.ViewModels"
x:CompileBindings="True"
x:DataType="vm:AvatarDemoViewModel"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Ursa.Demo.Pages.AvatarDemo">
<Design.DataContext>
Expand Down
1 change: 1 addition & 0 deletions demo/Ursa.Demo/Pages/BannerDemo.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pages="clr-namespace:Ursa.Demo.Pages"
xmlns:u="https://irihi.tech/ursa"
x:DataType="pages:BannerDemoViewModel"
mc:Ignorable="d">
<Design.DataContext>
<pages:BannerDemoViewModel />
Expand Down
1 change: 1 addition & 0 deletions demo/Ursa.Demo/Pages/IntroductionDemo.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:u="https://irihi.tech/ursa"
xmlns:vm="using:Ursa.Demo.ViewModels"
x:DataType="vm:IntroductionDemoViewModel"
d:DesignHeight="800"
d:DesignWidth="1600"
mc:Ignorable="d">
Expand Down
1 change: 1 addition & 0 deletions demo/Ursa.Demo/Pages/PaginationDemo.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
xmlns:viewModels="clr-namespace:Ursa.Demo.ViewModels"
d:DesignHeight="450"
d:DesignWidth="800"
x:DataType="viewModels:PaginationDemoViewModel"
mc:Ignorable="d">
<Design.DataContext>
<viewModels:PaginationDemoViewModel />
Expand Down
26 changes: 13 additions & 13 deletions demo/Ursa.Demo/Pages/TimelineDemo.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
xmlns:viewModels="clr-namespace:Ursa.Demo.ViewModels"
d:DesignHeight="450"
d:DesignWidth="800"
x:CompileBindings="True"
x:CompileBindings="False"
x:DataType="viewModels:TimelineDemoViewModel"
mc:Ignorable="d">
<UserControl.Resources>
Expand All @@ -27,33 +27,33 @@
<u:Timeline
Mode="Alternate"
HorizontalAlignment="Left"
ContentMemberBinding="{ReflectionBinding Description}"
HeaderMemberBinding="{ReflectionBinding Header}"
IconMemberBinding="{ReflectionBinding ItemType}"
ContentMemberBinding="{Binding Description}"
HeaderMemberBinding="{Binding Header}"
IconMemberBinding="{Binding ItemType}"
IconTemplate="{StaticResource IconSelector}"
ItemsSource="{Binding Items}"
TimeMemberBinding="{ReflectionBinding Time}" >
TimeMemberBinding="{Binding Time}" >

</u:Timeline>
<u:Timeline
Mode="Left"
HorizontalAlignment="Left"
ContentMemberBinding="{ReflectionBinding Description}"
HeaderMemberBinding="{ReflectionBinding Header}"
IconMemberBinding="{ReflectionBinding ItemType}"
ContentMemberBinding="{Binding Description}"
HeaderMemberBinding="{Binding Header}"
IconMemberBinding="{Binding ItemType}"
IconTemplate="{StaticResource IconSelector}"
ItemsSource="{Binding Items}"
TimeMemberBinding="{ReflectionBinding Time}" >
TimeMemberBinding="{Binding Time}" >
</u:Timeline>
<u:Timeline
Mode="Right"
HorizontalAlignment="Left"
ContentMemberBinding="{ReflectionBinding Description}"
HeaderMemberBinding="{ReflectionBinding Header}"
IconMemberBinding="{ReflectionBinding ItemType}"
ContentMemberBinding="{Binding Description}"
HeaderMemberBinding="{Binding Header}"
IconMemberBinding="{Binding ItemType}"
IconTemplate="{StaticResource IconSelector}"
ItemsSource="{Binding Items}"
TimeMemberBinding="{ReflectionBinding Time}" >
TimeMemberBinding="{Binding Time}" >
</u:Timeline>
<u:Timeline HorizontalAlignment="Left" Mode="Alternate">
<u:TimelineItem
Expand Down
1 change: 0 additions & 1 deletion demo/Ursa.Demo/Roots.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<linker>
<!-- Can be removed if CompiledBinding and no reflection are used -->
<assembly fullname="Ursa.Demo" preserve="All" />
<assembly fullname="Avalonia.Themes.Fluent" preserve="All" />
</linker>
4 changes: 2 additions & 2 deletions demo/Ursa.Demo/Ursa.Demo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<AvaloniaUseCompiledBindingsByDefault>false</AvaloniaUseCompiledBindingsByDefault>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
</PropertyGroup>

<ItemGroup>
Expand All @@ -19,7 +19,7 @@
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.0" />
<PackageReference Include="Semi.Avalonia" Version="11.1.0-rc2" />
<PackageReference Include="Semi.Avalonia" Version="11.1.0-rc2.1" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion demo/Ursa.PrismDialogDemo/Ursa.PrismDialogDemo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)"/>
<PackageReference Include="Prism.DryIoc.Avalonia" Version="8.1.97.11072" />
<PackageReference Include="Semi.Avalonia" Version="11.1.0-rc2" />
<PackageReference Include="Semi.Avalonia" Version="11.1.0-rc2.1" />
</ItemGroup>


Expand Down
2 changes: 1 addition & 1 deletion src/Ursa.PrismExtension/Ursa.PrismExtension.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Version>0.3.0-beta20240226</Version>
<ImplicitUsings>enable</ImplicitUsings>
<Authors>IRIHI Technology Co., Ltd.</Authors>
Expand Down
13 changes: 7 additions & 6 deletions src/Ursa.Themes.Semi/Controls/DateRangePicker.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:contracts="https://irihi.tech/shared"
xmlns:u="https://irihi.tech/ursa">
xmlns:u="https://irihi.tech/ursa"
x:CompileBindings="True">
<!-- Add Resources Here -->
<ControlTheme x:Key="{x:Type u:DateRangePicker}" TargetType="u:DateRangePicker">
<Setter Property="Background" Value="{DynamicResource TextBoxDefaultBackground}" />
Expand Down Expand Up @@ -59,7 +60,7 @@
Name="ClearButton"
Grid.Column="3"
Padding="8,0"
Command="{Binding $parent[contracts:IClearControl].Clear}"
Command="{Binding $parent[u:DateRangePicker].Clear}"
Content="{DynamicResource IconButtonClearData}"
Focusable="False"
IsVisible="False"
Expand All @@ -68,9 +69,9 @@
Name="{x:Static u:DateRangePicker.PART_Button}"
Grid.Column="3"
Padding="8,0"
IsVisible="{Binding !#ClearButton.IsVisible}"
Content="{DynamicResource CalendarDatePickerIconGlyph}"
Focusable="False"
IsVisible="{Binding !#ClearButton.IsVisible}"
Theme="{DynamicResource InnerIconButton}" />
</Grid>
<Popup
Expand Down Expand Up @@ -120,18 +121,18 @@
Grid.Column="0"
Margin="8"
BorderThickness="0"
FontSize="{DynamicResource DefaultFontSize}"
CornerRadius="{Binding $parent[Border].CornerRadius}"
FirstDayOfWeek="{TemplateBinding FirstDayOfWeek}"
FontSize="{DynamicResource DefaultFontSize}"
IsTodayHighlighted="{TemplateBinding IsTodayHighlighted}" />
<u:CalendarView
Name="{x:Static u:DateRangePicker.PART_EndCalendar}"
Grid.Column="1"
Margin="8"
BorderThickness="0"
FontSize="{DynamicResource DefaultFontSize}"
CornerRadius="{Binding $parent[Border].CornerRadius}"
FirstDayOfWeek="{TemplateBinding FirstDayOfWeek}"
FontSize="{DynamicResource DefaultFontSize}"
IsTodayHighlighted="{TemplateBinding IsTodayHighlighted}" />
</Grid>
</DockPanel>
Expand All @@ -144,7 +145,7 @@

<Style Selector="^.clearButton, ^.ClearButton">
<Style Selector="^:not(:empty):pointerover /template/ Button#ClearButton">
<Setter Property="IsVisible" Value="{Binding $parent[u:DatePicker].start, Converter={x:Static ObjectConverters.IsNotNull}}" />
<Setter Property="IsVisible" Value="True" />
</Style>
</Style>

Expand Down
21 changes: 16 additions & 5 deletions src/Ursa.Themes.Semi/Controls/Divider.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
<Setter Property="TextElement.FontFamily" Value="{TemplateBinding FontFamily}" />
<Setter Property="TextElement.FontWeight" Value="{TemplateBinding FontWeight}" />
<Setter Property="TextElement.FontSize" Value="{TemplateBinding FontSize}" />
<Setter Property="ContentPresenter.IsVisible" Value="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}" />
<Setter Property="ContentPresenter.Margin" Value="{DynamicResource ThicknessDividerTextMargin}" />
<Setter Property="VerticalAlignment" Value="Center" />
</ControlTheme>
Expand All @@ -48,7 +47,10 @@
Height="{TemplateBinding Height}"
ColumnDefinitions="Auto,Auto,*">
<Rectangle Theme="{StaticResource DividerLeftLine}" />
<ContentPresenter Grid.Column="1" Theme="{StaticResource DividerContentPresenter}" />
<ContentPresenter
Grid.Column="1"
IsVisible="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}"
Theme="{StaticResource DividerContentPresenter}" />
<Rectangle Grid.Column="2" Theme="{StaticResource DividerRightLine}" />
</Grid>
</ControlTemplate>
Expand All @@ -62,7 +64,10 @@
Height="{TemplateBinding Height}"
ColumnDefinitions="*,Auto,Auto">
<Rectangle Theme="{StaticResource DividerLeftLine}" />
<ContentPresenter Grid.Column="1" Theme="{StaticResource DividerContentPresenter}" />
<ContentPresenter
Grid.Column="1"
IsVisible="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}"
Theme="{StaticResource DividerContentPresenter}" />
<Rectangle Grid.Column="2" Theme="{StaticResource DividerRightLine}" />
</Grid>
</ControlTemplate>
Expand All @@ -76,7 +81,10 @@
Height="{TemplateBinding Height}"
ColumnDefinitions="*,Auto,*">
<Rectangle Theme="{StaticResource DividerLeftLine}" />
<ContentPresenter Grid.Column="1" Theme="{StaticResource DividerContentPresenter}" />
<ContentPresenter
Grid.Column="1"
IsVisible="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}"
Theme="{StaticResource DividerContentPresenter}" />
<Rectangle Grid.Column="2" Theme="{StaticResource DividerRightLine}" />
</Grid>
</ControlTemplate>
Expand All @@ -90,7 +98,10 @@
Height="{TemplateBinding Height}"
ColumnDefinitions="*,Auto,*">
<Rectangle Theme="{StaticResource DividerLeftLine}" />
<ContentPresenter Grid.Column="1" Theme="{StaticResource DividerContentPresenter}" />
<ContentPresenter
Grid.Column="1"
IsVisible="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}"
Theme="{StaticResource DividerContentPresenter}" />
<Rectangle Grid.Column="2" Theme="{StaticResource DividerRightLine}" />
</Grid>
</ControlTemplate>
Expand Down
2 changes: 1 addition & 1 deletion src/Ursa.Themes.Semi/Controls/MessageBox.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
<Style Selector="^ /template/ Panel#PART_TitleArea">
<Setter Property="ContextFlyout">
<MenuFlyout>
<MenuItem Command="{Binding $parent[u:CustomDialogControl].CloseDialog}" Header="{DynamicResource STRING_MENU_DIALOG_CLOSE}">
<MenuItem Command="{Binding $parent[u:CustomDialogControl].Close}" Header="{DynamicResource STRING_MENU_DIALOG_CLOSE}">
<MenuItem.Icon>
<PathIcon
Width="12"
Expand Down
6 changes: 3 additions & 3 deletions src/Ursa.Themes.Semi/Controls/NumericUpDown.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
</ControlTheme>

<ControlTheme x:Key="{x:Type u:NumericUpDown}" TargetType="{x:Type u:NumericUpDown}">
<Setter Property="NumericUpDown.VerticalContentAlignment" Value="Center" />
<Setter Property="NumericUpDown.CornerRadius" Value="{DynamicResource NumericUpDownCornerRadius}" />
<Setter Property="CornerRadius" Value="{DynamicResource NumericUpDownCornerRadius}" />
<Setter Property="MinHeight" Value="{DynamicResource NumericUpDownDefaultHeight}"></Setter>
<Setter Property="Template">
<ControlTemplate TargetType="u:NumericUpDown">
<DataValidationErrors>
Expand All @@ -44,7 +44,7 @@
<TextBox
Name="PART_TextBox"
Height="{TemplateBinding Height}"
MinHeight="{DynamicResource NumericUpDownWrapperDefaultHeight}"
MinHeight="{TemplateBinding MinHeight}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
AcceptsReturn="False"
CornerRadius="{TemplateBinding CornerRadius}"
Expand Down
8 changes: 4 additions & 4 deletions src/Ursa.Themes.Semi/Controls/RangeSlider.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
RowDefinitions="Auto,Auto,Auto">
<Grid.Styles>
<Style Selector="TickBar">
<Setter Property="ReservedSpace" Value="{Binding #PART_Track.LowerThumb.Bounds}" />
<Setter Property="ReservedSpace" Value="{ReflectionBinding #PART_Track.LowerThumb.Bounds}" />
</Style>
</Grid.Styles>
<TickBar
Expand Down Expand Up @@ -50,7 +50,7 @@
TickFrequency="{TemplateBinding u:RangeSlider.TickFrequency}"
Ticks="{TemplateBinding Ticks}" />
<u:RangeTrack
Name="{x:Static u:RangeSlider.PART_Track}"
Name="PART_Track"
Grid.Row="1"
Cursor="Hand"
HorizontalAlignment="Stretch"
Expand Down Expand Up @@ -110,7 +110,7 @@
ColumnDefinitions="Auto,Auto,Auto">
<Grid.Styles>
<Style Selector="TickBar">
<Setter Property="ReservedSpace" Value="{Binding #PART_Track.LowerThumb.Bounds}" />
<Setter Property="ReservedSpace" Value="{ReflectionBinding #PART_Track.LowerThumb.Bounds}" />
</Style>
</Grid.Styles>
<TickBar
Expand Down Expand Up @@ -142,7 +142,7 @@
TickFrequency="{TemplateBinding u:RangeSlider.TickFrequency}"
Ticks="{TemplateBinding Ticks}" />
<u:RangeTrack
Name="{x:Static u:RangeSlider.PART_Track}"
Name="PART_Track"
Cursor="Hand"
Grid.Column="1"
HorizontalAlignment="Stretch"
Expand Down
2 changes: 1 addition & 1 deletion src/Ursa.Themes.Semi/Controls/TagInput.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="ItemTemplate">
<DataTemplate>
<u:ClosableTag Command="{Binding $parent[u:TagInput].Close}" Content="{Binding}" />
<u:ClosableTag Command="{Binding $parent[u:TagInput].Close}" Content="{ReflectionBinding}" />
</DataTemplate>
</Setter>
<Setter Property="Template">
Expand Down
2 changes: 1 addition & 1 deletion src/Ursa.Themes.Semi/Controls/TimePicker.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
Name="ClearButton"
Grid.Column="1"
Padding="0,0,8,0"
Command="{Binding $parent[iri:IClearControl].Clear}"
Command="{Binding $parent[u:TimePicker].Clear}"
Content="{DynamicResource IconButtonClearData}"
Focusable="False"
IsVisible="False"
Expand Down
3 changes: 2 additions & 1 deletion src/Ursa.Themes.Semi/Controls/TimeRangePicker.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
Name="ClearButton"
Grid.Column="3"
Padding="8,0"
Command="{Binding $parent[iri:IClearControl].Clear}"
Command="{Binding $parent[u:TimeRangePicker
].Clear}"
Content="{DynamicResource IconButtonClearData}"
Focusable="False"
IsVisible="False"
Expand Down
2 changes: 1 addition & 1 deletion src/Ursa.Themes.Semi/Controls/TreeComboBox.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<Button
Name="PART_ClearButton"
Grid.Column="2"
Command="{Binding $parent[iri:IClearControl].Clear}"
Command="{Binding $parent[u:TreeComboBox].Clear}"
IsVisible="False"
Theme="{DynamicResource InnerIconButton}"
Content="{DynamicResource IconButtonClearData}" />
Expand Down
Loading

0 comments on commit 0c3c237

Please sign in to comment.