commit
c7fc804ec1
15
README.md
15
README.md
@ -11,7 +11,7 @@ Avalonia Theme inspired by Semi Design
|
||||
|
||||
## Installation
|
||||
```bash
|
||||
dotnet add package Semi.Avalonia --version 0.1.0-preview5.4
|
||||
dotnet add package Semi.Avalonia --version 0.1.0-preview6
|
||||
```
|
||||
Include Semi Design Styles in application:
|
||||
|
||||
@ -25,8 +25,8 @@ That's all.
|
||||
|
||||
DataGrid and ColorPicker are distributed in separated packages. Please install if you need.
|
||||
```bash
|
||||
dotnet add package Semi.Avalonia.ColorPicker --version 0.1.0-preview5.2
|
||||
dotnet add package Semi.Avalonia.DataGrid --version 0.1.0-preview5.2
|
||||
dotnet add package Semi.Avalonia.ColorPicker --version 0.1.0-preview6
|
||||
dotnet add package Semi.Avalonia.DataGrid --version 0.1.0-preview6
|
||||
```
|
||||
```xaml
|
||||
<Application.Styles>
|
||||
@ -42,10 +42,11 @@ https://github.com/irihitech/Semi.Avalonia/releases
|
||||
|
||||
## Version compatibility
|
||||
|
||||
| Semi Design Version | Avalonia Version|
|
||||
|:--------------------|:---|
|
||||
| 0.1.0-preview3 |11.0-preview4|
|
||||
| 0.1.0-preview5.x |11.0-preview5|
|
||||
| Semi Design Version | Avalonia Version |
|
||||
|:--------------------|:-----------------|
|
||||
| 0.1.0-preview3 | 11.0-preview4 |
|
||||
| 0.1.0-preview5.x | 11.0-preview5 |
|
||||
| 0.1.0-preview6.x | 11.0-preview6 |
|
||||
|
||||
## TODO
|
||||
* DataValidationErrors
|
||||
|
@ -13,7 +13,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia.Android" Version="11.0.0-preview5" />
|
||||
<PackageReference Include="Avalonia.Android" Version="11.0.0-preview6" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -20,9 +20,9 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia.Desktop" Version="11.0.0-preview5" />
|
||||
<PackageReference Include="Avalonia.Desktop" Version="11.0.0-preview6" />
|
||||
<!--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-preview5" />
|
||||
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.0-preview6" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -10,7 +10,7 @@ internal partial class Program
|
||||
{
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
BuildAvaloniaApp().SetupBrowserApp("out");
|
||||
BuildAvaloniaApp(); //.SetupBrowserApp("out");
|
||||
}
|
||||
|
||||
public static AppBuilder BuildAvaloniaApp()
|
||||
|
@ -19,8 +19,8 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia.Browser" Version="11.0.0-preview5" />
|
||||
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.0-preview5" />
|
||||
<PackageReference Include="Avalonia.Browser" Version="11.0.0-preview6" />
|
||||
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.0-preview6" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -8,7 +8,6 @@ namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class ThemeVariantDemo : UserControl
|
||||
{
|
||||
private ThemeVariant _variant = ThemeVariant.Default;
|
||||
public ThemeVariantDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
@ -16,15 +15,6 @@ public partial class ThemeVariantDemo : UserControl
|
||||
|
||||
private void Switch_OnIsCheckedChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (_variant == ThemeVariant.Dark)
|
||||
{
|
||||
scope.RequestedThemeVariant = ThemeVariant.Default;
|
||||
_variant = ThemeVariant.Default;
|
||||
}
|
||||
else
|
||||
{
|
||||
scope.RequestedThemeVariant = ThemeVariant.Dark;
|
||||
_variant = ThemeVariant.Dark;
|
||||
}
|
||||
scope.RequestedThemeVariant = scope.ActualThemeVariant == ThemeVariant.Dark ? ThemeVariant.Light : ThemeVariant.Dark;
|
||||
}
|
||||
}
|
@ -11,12 +11,11 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia" Version="11.0.0-preview5" />
|
||||
<PackageReference Include="Avalonia.Controls.DataGrid" Version="11.0.0-preview5" />
|
||||
<PackageReference Include="Avalonia" Version="11.0.0-preview6" />
|
||||
<PackageReference Include="Avalonia.Controls.DataGrid" Version="11.0.0-preview6" />
|
||||
<!--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-preview5" />
|
||||
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.0-preview6" />
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.1.0" />
|
||||
<PackageReference Include="XamlNameReferenceGenerator" Version="1.5.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -3,10 +3,10 @@
|
||||
<TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks>
|
||||
<Nullable>enable</Nullable>
|
||||
<LangVersion>10</LangVersion>
|
||||
<Version>0.1.0-preview5.4</Version>
|
||||
<Version>0.1.0-preview6</Version>
|
||||
<Authors>IRIHI Technology</Authors>
|
||||
<Description>Avalonia Theme inspired by Semi Design. </Description>
|
||||
<PackageProjectUrl>https://github.com/irihitech/Semi.Avalonia</PackageProjectUrl>
|
||||
<AvaloniaVersion>11.0.0-preview5</AvaloniaVersion>
|
||||
<AvaloniaVersion>11.0.0-preview6</AvaloniaVersion>
|
||||
</PropertyGroup>
|
||||
</Project>
|
@ -61,7 +61,7 @@
|
||||
</Panel>
|
||||
</DropDownButton.Content>
|
||||
<DropDownButton.Flyout>
|
||||
<Flyout FlyoutPresenterClasses="nopadding" Placement="Auto">
|
||||
<Flyout FlyoutPresenterClasses="nopadding" Placement="AnchorAndGravity">
|
||||
|
||||
<!--
|
||||
The following is copy-pasted from the ColorView's control template.
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<Title>Semi.Avalonia.ColorPicker</Title>
|
||||
<PackageReleaseNotes>Add Native AOT support.</PackageReleaseNotes>
|
||||
<PackageReleaseNotes>Upgrade to Avalonia 11.0.0-preview6.</PackageReleaseNotes>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<Title>Semi.Avalonia.DataGrid</Title>
|
||||
<PackageReleaseNotes>Add Native AOT support.</PackageReleaseNotes>
|
||||
<PackageReleaseNotes>Upgrade to Avalonia 11.0.0-preview6.</PackageReleaseNotes>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -86,9 +86,6 @@
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ TextBlock#PART_Watermark">
|
||||
<Setter Property="TextElement.Foreground" Value="{DynamicResource CalendarDatePickerTextForegroundDisabled}" />
|
||||
</Style>
|
||||
</Style>
|
||||
</TextBox.Styles>
|
||||
</TextBox>
|
||||
|
@ -141,7 +141,7 @@
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
ItemContainerTheme="{DynamicResource CarouselIndicatorDotListBoxItem}"
|
||||
Items="{TemplateBinding Items,
|
||||
ItemsSource="{TemplateBinding Items,
|
||||
Converter={StaticResource ItemsConverter}}"
|
||||
SelectedIndex="{Binding SelectedIndex, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}">
|
||||
<ListBox.ItemsPanel>
|
||||
|
@ -31,9 +31,7 @@
|
||||
<Setter Property="Padding" Value="{DynamicResource ComboBoxSelectorDefaultPadding}" />
|
||||
<Setter Property="FocusAdorner" Value="{x:Null}" />
|
||||
<Setter Property="MaxDropDownHeight" Value="504" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxForeground}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ComboBoxSelectorBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxBorderBrush}" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource ComboBoxSelectorCornerRadius}" />
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
|
||||
@ -63,6 +61,7 @@
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
IsVisible="{TemplateBinding SelectionBoxItem,
|
||||
Converter={x:Static ObjectConverters.IsNull}}"
|
||||
Opacity="0.3"
|
||||
|
@ -92,8 +92,7 @@
|
||||
<PathIcon
|
||||
Width="12"
|
||||
Height="12"
|
||||
Data="{DynamicResource DateTimePickerAcceptGlyph}"
|
||||
Foreground="{Binding $parent[ContentPresenter].Foreground}" />
|
||||
Data="{DynamicResource DateTimePickerAcceptGlyph}" />
|
||||
</Button>
|
||||
<Button
|
||||
Name="PART_DismissButton"
|
||||
@ -105,8 +104,7 @@
|
||||
<PathIcon
|
||||
Width="12"
|
||||
Height="12"
|
||||
Data="{DynamicResource DateTimePickerDismissGlyph}"
|
||||
Foreground="{Binding $parent[ContentPresenter].Foreground}" />
|
||||
Data="{DynamicResource DateTimePickerDismissGlyph}" />
|
||||
</Button>
|
||||
<Rectangle
|
||||
Grid.ColumnSpan="2"
|
||||
|
@ -103,8 +103,7 @@
|
||||
Height="8"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Data="{DynamicResource DateTimePickerButtonUpGlyph}"
|
||||
Foreground="{Binding $parent[ContentPresenter].Foreground}" />
|
||||
Data="{DynamicResource DateTimePickerButtonUpGlyph}" />
|
||||
</Template>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
@ -125,8 +124,7 @@
|
||||
Height="8"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Data="{DynamicResource DateTimePickerButtonDownGlyph}"
|
||||
Foreground="{Binding $parent[ContentPresenter].Foreground}" />
|
||||
Data="{DynamicResource DateTimePickerButtonDownGlyph}" />
|
||||
</Template>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
|
@ -44,7 +44,7 @@
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Data="{DynamicResource DropdownButtonIconGlyph}"
|
||||
Foreground="{DynamicResource ComboBoxDropDownGlyphForeground}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
IsHitTestVisible="False"
|
||||
UseLayoutRounding="False" />
|
||||
</Grid>
|
||||
@ -137,7 +137,7 @@
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Data="{DynamicResource DropdownButtonIconGlyph}"
|
||||
Foreground="{DynamicResource ComboBoxDropDownGlyphForeground}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
IsHitTestVisible="False"
|
||||
UseLayoutRounding="False" />
|
||||
</Grid>
|
||||
|
@ -6,6 +6,7 @@
|
||||
<Setter Property="Focusable" Value="True" />
|
||||
<Setter Property="MinWidth" Value="6" />
|
||||
<Setter Property="MinHeight" Value="6" />
|
||||
<Setter Property="GridSplitter.ClipToBounds" Value="False" />
|
||||
<Setter Property="GridSplitter.Padding" Value="2" />
|
||||
<Setter Property="Background" Value="{DynamicResource GridSplitterBackground}" />
|
||||
<Setter Property="PreviewContent">
|
||||
|
@ -81,9 +81,6 @@
|
||||
</DockPanel>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
<Style Selector="^ /template/ RepeatButton:pointerover > PathIcon">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ScrollBarButtonArrowForegroundPointerOver}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="{x:Type Separator}" TargetType="Separator">
|
||||
|
@ -96,8 +96,7 @@
|
||||
<PathIcon
|
||||
Width="12"
|
||||
Height="12"
|
||||
Data="{DynamicResource DateTimePickerAcceptGlyph}"
|
||||
Foreground="{Binding $parent[ContentPresenter].Foreground}" />
|
||||
Data="{DynamicResource DateTimePickerAcceptGlyph}" />
|
||||
</Button>
|
||||
<Button
|
||||
Name="PART_DismissButton"
|
||||
@ -109,8 +108,7 @@
|
||||
<PathIcon
|
||||
Width="12"
|
||||
Height="12"
|
||||
Data="{DynamicResource DateTimePickerDismissGlyph}"
|
||||
Foreground="{Binding $parent[ContentPresenter].Foreground}" />
|
||||
Data="{DynamicResource DateTimePickerDismissGlyph}" />
|
||||
</Button>
|
||||
<Rectangle
|
||||
Grid.ColumnSpan="2"
|
||||
|
@ -11,12 +11,10 @@
|
||||
</StackPanel>
|
||||
</Design.PreviewWith>
|
||||
<ControlTheme x:Key="{x:Type ToggleSwitch}" TargetType="ToggleSwitch">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ToggleSwitchContentForeground}" />
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="ToggleSwitch">
|
||||
<Grid
|
||||
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using Avalonia.Collections;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Data.Converters;
|
||||
|
||||
namespace Semi.Avalonia.Converters;
|
||||
@ -11,7 +12,7 @@ public class ItemToObjectConverter: IValueConverter
|
||||
{
|
||||
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is AvaloniaList<object> list)
|
||||
if (value is ItemCollection list)
|
||||
{
|
||||
return list.Select(a => new object());
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<Title>Semi.Avalonia</Title>
|
||||
<PackageReleaseNotes>Add new CheckBox Theme, Bug fixes. </PackageReleaseNotes>
|
||||
<PackageReleaseNotes>Upgrade to Avalonia 11.0.0-preview6. </PackageReleaseNotes>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -1,6 +1,7 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- -->
|
||||
<SolidColorBrush x:Key="CalendarDatePickerIconForeground" Opacity="0.62" Color="#F9F9F9" />
|
||||
<SolidColorBrush x:Key="CalendarDatePickerForeground" Color="#F9F9F9" />
|
||||
<SolidColorBrush x:Key="CalendarDatePickerIconPointeroverForeground" Color="#F9F9F9" />
|
||||
<PathGeometry x:Key="CalendarDatePickerIconGlyph">M4 20V8H20V20H4ZM2 4C2 2.89543 2.89543 2 4 2H20C21.1046 2 22 2.89543 22 4V20C22 21.1046 21.1046 22 20 22H4C2.89543 22 2 21.1046 2 20V4ZM6 10.5C6 10.2239 6.22386 10 6.5 10H8.5C8.77614 10 9 10.2239 9 10.5V12.5C9 12.7761 8.77614 13 8.5 13H6.5C6.22386 13 6 12.7761 6 12.5V10.5ZM6.5 15C6.22386 15 6 15.2239 6 15.5V17.5C6 17.7761 6.22386 18 6.5 18H8.5C8.77614 18 9 17.7761 9 17.5V15.5C9 15.2239 8.77614 15 8.5 15H6.5ZM10.5 10.5C10.5 10.2239 10.7239 10 11 10H13C13.2761 10 13.5 10.2239 13.5 10.5V12.5C13.5 12.7761 13.2761 13 13 13H11C10.7239 13 10.5 12.7761 10.5 12.5V10.5ZM11 15C10.7239 15 10.5 15.2239 10.5 15.5V17.5C10.5 17.7761 10.7239 18 11 18H13C13.2761 18 13.5 17.7761 13.5 17.5V15.5C13.5 15.2239 13.2761 15 13 15H11ZM15 10.5C15 10.2239 15.2239 10 15.5 10H17.5C17.7761 10 18 10.2239 18 10.5V12.5C18 12.7761 17.7761 13 17.5 13H15.5C15.2239 13 15 12.7761 15 12.5V10.5ZM15.5 15C15.2239 15 15 15.2239 15 15.5V17.5C15 17.7761 15.2239 18 15.5 18H17.5C17.7761 18 18 17.7761 18 17.5V15.5C18 15.2239 17.7761 15 17.5 15H15.5Z</PathGeometry>
|
||||
<SolidColorBrush x:Key="CalendarDatePickerBackground" Opacity="0.12" Color="White" />
|
||||
|
@ -1,6 +1,7 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- -->
|
||||
<SolidColorBrush x:Key="CalendarDatePickerIconForeground" Opacity="0.62" Color="#1C1F23" />
|
||||
<SolidColorBrush x:Key="CalendarDatePickerForeground" Color="#1C1F23" />
|
||||
<SolidColorBrush x:Key="CalendarDatePickerIconPointeroverForeground" Color="#1C1F23" />
|
||||
<PathGeometry x:Key="CalendarDatePickerIconGlyph">M4 20V8H20V20H4ZM2 4C2 2.89543 2.89543 2 4 2H20C21.1046 2 22 2.89543 22 4V20C22 21.1046 21.1046 22 20 22H4C2.89543 22 2 21.1046 2 20V4ZM6 10.5C6 10.2239 6.22386 10 6.5 10H8.5C8.77614 10 9 10.2239 9 10.5V12.5C9 12.7761 8.77614 13 8.5 13H6.5C6.22386 13 6 12.7761 6 12.5V10.5ZM6.5 15C6.22386 15 6 15.2239 6 15.5V17.5C6 17.7761 6.22386 18 6.5 18H8.5C8.77614 18 9 17.7761 9 17.5V15.5C9 15.2239 8.77614 15 8.5 15H6.5ZM10.5 10.5C10.5 10.2239 10.7239 10 11 10H13C13.2761 10 13.5 10.2239 13.5 10.5V12.5C13.5 12.7761 13.2761 13 13 13H11C10.7239 13 10.5 12.7761 10.5 12.5V10.5ZM11 15C10.7239 15 10.5 15.2239 10.5 15.5V17.5C10.5 17.7761 10.7239 18 11 18H13C13.2761 18 13.5 17.7761 13.5 17.5V15.5C13.5 15.2239 13.2761 15 13 15H11ZM15 10.5C15 10.2239 15.2239 10 15.5 10H17.5C17.7761 10 18 10.2239 18 10.5V12.5C18 12.7761 17.7761 13 17.5 13H15.5C15.2239 13 15 12.7761 15 12.5V10.5ZM15.5 15C15.2239 15 15 15.2239 15 15.5V17.5C15 17.7761 15.2239 18 15.5 18H17.5C17.7761 18 18 17.7761 18 17.5V15.5C18 15.2239 17.7761 15 17.5 15H15.5Z</PathGeometry>
|
||||
<SolidColorBrush x:Key="CalendarDatePickerBackground" Opacity="0.05" Color="#FF2E3238" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user