feat: uppdate to latest nightly. add clear button to ComboBox and DatePicker
This commit is contained in:
parent
e563f860ad
commit
d638b0603d
@ -1,6 +1,6 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<Nullable>enable</Nullable>
|
||||
<AvaloniaVersion>11.0.0</AvaloniaVersion>
|
||||
<AvaloniaVersion>11.1.999-cibuild0040425</AvaloniaVersion>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
@ -15,6 +15,13 @@
|
||||
<ComboBoxItem>Mr. 17</ComboBoxItem>
|
||||
<ComboBoxItem>Cass</ComboBoxItem>
|
||||
</ComboBox>
|
||||
<ComboBox Width="150" Classes="ClearButton">
|
||||
<ComboBoxItem>Ding</ComboBoxItem>
|
||||
<ComboBoxItem>Otter</ComboBoxItem>
|
||||
<ComboBoxItem>Husky</ComboBoxItem>
|
||||
<ComboBoxItem>Mr. 17</ComboBoxItem>
|
||||
<ComboBoxItem>Cass</ComboBoxItem>
|
||||
</ComboBox>
|
||||
<ComboBox Width="150" PlaceholderText="Please Select">
|
||||
<ComboBoxItem>Ding</ComboBoxItem>
|
||||
<ComboBoxItem>Otter</ComboBoxItem>
|
||||
|
@ -9,6 +9,7 @@
|
||||
mc:Ignorable="d">
|
||||
<StackPanel Spacing="20">
|
||||
<DatePicker />
|
||||
<DatePicker Classes="ClearButton" />
|
||||
<DatePicker DayFormat="d (ddd)" YearVisible="False" />
|
||||
<DatePicker IsEnabled="False" />
|
||||
<DatePicker Classes="Large" />
|
||||
|
@ -8,14 +8,15 @@
|
||||
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="../Directory.Build.props" />
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia" Version="11.0.0" />
|
||||
<PackageReference Include="Avalonia.Desktop" Version="11.0.0" />
|
||||
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.0" />
|
||||
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.0.0" />
|
||||
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)" />
|
||||
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
|
||||
<PackageReference Include="Avalonia.Themes.Fluent" Version="$(AvaloniaVersion)" />
|
||||
<PackageReference Include="Avalonia.Fonts.Inter" Version="$(AvaloniaVersion)" />
|
||||
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
|
||||
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.0" />
|
||||
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.1" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
<Authors>IRIHI Technology</Authors>
|
||||
<Description>Avalonia Theme inspired by Semi Design.</Description>
|
||||
<PackageProjectUrl>https://github.com/irihitech/Semi.Avalonia</PackageProjectUrl>
|
||||
<AvaloniaVersion>11.0.0</AvaloniaVersion>
|
||||
<AvaloniaVersion>11.1.999-cibuild0040425</AvaloniaVersion>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
</PropertyGroup>
|
||||
</Project>
|
@ -204,4 +204,26 @@
|
||||
</Style>
|
||||
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="ButtonInputInnerButton" TargetType="Button">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonInputInnerForeground}" />
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="Button">
|
||||
<ContentControl Background="Transparent">
|
||||
<PathIcon
|
||||
Width="16"
|
||||
Height="16"
|
||||
Data="{TemplateBinding Content}"
|
||||
Foreground="{TemplateBinding Foreground}" />
|
||||
</ContentControl>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonInputInnerPointeroverForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonInputInnerPressedForeground}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
|
@ -33,6 +33,7 @@
|
||||
<Setter Property="MaxDropDownHeight" Value="504" />
|
||||
<Setter Property="Background" Value="{DynamicResource ComboBoxSelectorBackground}" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource ComboBoxSelectorCornerRadius}" />
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
|
||||
@ -43,11 +44,11 @@
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="ComboBox">
|
||||
<DataValidationErrors>
|
||||
<Grid ColumnDefinitions="*,32">
|
||||
<Grid ColumnDefinitions="*, Auto, 32">
|
||||
<Border
|
||||
x:Name="Background"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Grid.ColumnSpan="3"
|
||||
MinWidth="{DynamicResource ComboBoxThemeMinWidth}"
|
||||
MinHeight="{DynamicResource ComboBoxDefaultHeight}"
|
||||
Background="{TemplateBinding Background}"
|
||||
@ -73,10 +74,16 @@
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Content="{TemplateBinding SelectionBoxItem}"
|
||||
ContentTemplate="{TemplateBinding ItemTemplate}" />
|
||||
|
||||
<Button
|
||||
Grid.Column="1"
|
||||
Name="ClearButton"
|
||||
Content="{DynamicResource TextBoxClearButtonData}"
|
||||
IsVisible="False"
|
||||
Command="{Binding $parent[ComboBox].Clear}"
|
||||
Theme="{DynamicResource ButtonInputInnerButton}" />
|
||||
<Border
|
||||
x:Name="DropDownOverlay"
|
||||
Grid.Column="1"
|
||||
Grid.Column="2"
|
||||
Width="30"
|
||||
Margin="0,1,1,1"
|
||||
HorizontalAlignment="Right"
|
||||
@ -85,7 +92,7 @@
|
||||
|
||||
<PathIcon
|
||||
x:Name="DropDownGlyph"
|
||||
Grid.Column="1"
|
||||
Grid.Column="2"
|
||||
Width="12"
|
||||
Height="12"
|
||||
Margin="0,0,10,0"
|
||||
@ -131,6 +138,12 @@
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^.clearButton, ^.ClearButton">
|
||||
<Style Selector="^:pointerover /template/ Button#ClearButton" >
|
||||
<Setter Property="IsVisible" Value="{Binding $parent[ComboBox].SelectionBoxItem, Converter={x:Static ObjectConverters.IsNotNull}}"></Setter>
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^.Large /template/ Border#Background">
|
||||
<Setter Property="ComboBox.MinHeight" Value="{DynamicResource ComboBoxLargeHeight}" />
|
||||
</Style>
|
||||
|
@ -135,11 +135,17 @@
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="DatePicker">
|
||||
<DataValidationErrors>
|
||||
<Grid Name="LayoutRoot" Margin="{TemplateBinding Padding}">
|
||||
<Grid
|
||||
Name="LayoutRoot"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
ColumnDefinitions="*, Auto">
|
||||
<Button
|
||||
Name="PART_FlyoutButton"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Width="298"
|
||||
MinWidth="298"
|
||||
MinHeight="{DynamicResource DateTimePickerButtonDefaultHeight}"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Background="{TemplateBinding Background}"
|
||||
@ -150,7 +156,6 @@
|
||||
DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
IsEnabled="{TemplateBinding IsEnabled}"
|
||||
MinHeight="{DynamicResource DateTimePickerButtonDefaultHeight}"
|
||||
Theme="{StaticResource DateTimePickerFlyoutButton}">
|
||||
<Grid ColumnDefinitions="*, Auto">
|
||||
<Grid
|
||||
@ -210,21 +215,38 @@
|
||||
Foreground="{DynamicResource DateTimePickerIconForeground}" />
|
||||
</Grid>
|
||||
</Button>
|
||||
|
||||
<Popup
|
||||
Name="PART_Popup"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
IsLightDismissEnabled="True"
|
||||
Placement="Bottom"
|
||||
PlacementTarget="{TemplateBinding}"
|
||||
WindowManagerAddShadowHint="False">
|
||||
<DatePickerPresenter Name="PART_PickerPresenter" />
|
||||
</Popup>
|
||||
|
||||
<Button
|
||||
Name="ClearButton"
|
||||
Grid.Column="1"
|
||||
Command="{Binding $parent[DatePicker].Clear}"
|
||||
Content="{DynamicResource TextBoxClearButtonData}"
|
||||
IsVisible="False"
|
||||
Margin="0 0 8 0"
|
||||
Theme="{DynamicResource ButtonInputInnerButton}" />
|
||||
</Grid>
|
||||
</DataValidationErrors>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^.clearButton:pointerover, ^.ClearButton:pointerover">
|
||||
<Style Selector="^:not(:hasnodate) /template/ Button#ClearButton">
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
<Style Selector="^:not(:hasnodate) /template/ PathIcon#PART_Icon">
|
||||
<Setter Property="Opacity" Value="0" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:disabled /template/ PathIcon#PART_Icon">
|
||||
<Setter Property="Foreground" Value="{DynamicResource DateTimePickerButtonDisabledIconForeground}" />
|
||||
</Style>
|
||||
|
@ -75,4 +75,8 @@
|
||||
|
||||
<SolidColorBrush x:Key="ButtonSolidDisabledBorderBrush" Color="#FF2E3238" />
|
||||
<!-- end Solid -->
|
||||
|
||||
<SolidColorBrush x:Key="ButtonInputInnerForeground" Color="#888D92" />
|
||||
<SolidColorBrush x:Key="ButtonInputInnerPointeroverForeground" Color="#A7ABB0" />
|
||||
<SolidColorBrush x:Key="ButtonInputInnerPressedForeground" Color="#C6CACD" />
|
||||
</ResourceDictionary>
|
@ -78,4 +78,8 @@
|
||||
|
||||
<SolidColorBrush x:Key="ButtonSolidDisabledBorderBrush" Color="Gray" />
|
||||
<!-- end Solid -->
|
||||
|
||||
<SolidColorBrush x:Key="ButtonInputInnerForeground" Color="#6B7075" />
|
||||
<SolidColorBrush x:Key="ButtonInputInnerPointeroverForeground" Color="#555B61" />
|
||||
<SolidColorBrush x:Key="ButtonInputInnerPressedForeground" Color="#41464C" />
|
||||
</ResourceDictionary>
|
Loading…
x
Reference in New Issue
Block a user