diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9ee4649a..1973f6e0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -2,12 +2,12 @@ name: Deploy to GitHub Pages env: PROJECT_PATH: demo/Ursa.Demo.Browser/Ursa.Demo.Browser.csproj - OUTPUT_PATH: demo/Ursa.Demo.Browser/bin/Release/net7.0/browser-wasm/AppBundle + OUTPUT_PATH: demo/Ursa.Demo.Browser/bin/Release/net8.0-browser/publish/wwwroot on: push: - branches: [ "deploy" ] + branches: [ "action/deploy" ] pull_request: - branches: [ "deploy" ] + branches: [ "action/deploy" ] jobs: deploy-to-github-pages: @@ -16,19 +16,16 @@ jobs: - name: Checkout uses: actions/checkout@v4.1.1 - - name: Setup .NET 7 + - name: Setup .NET 8 uses: actions/setup-dotnet@v4 with: - dotnet-version: 7.0.405 + dotnet-version: 8.0.x - name: Install wasm-tools - run: dotnet workload install wasm-tools wasm-tools-net7 - - - name: Install DotNetCompress - run: dotnet tool install --global DotNetCompress --version 3.0.0 --no-cache + run: dotnet workload install wasm-tools - name: Publish .NET Project - run: dotnet publish $PROJECT_PATH -c Release -o release --nologo + run: dotnet publish $PROJECT_PATH -c Release --nologo - name: Change base-tag in index.html run: sed -i 's///g' $OUTPUT_PATH/index.html @@ -36,12 +33,6 @@ jobs: - name: copy index.html to 404.html run: cp $OUTPUT_PATH/index.html $OUTPUT_PATH/404.html - - name: Compress Output using Brotli - run: DotNetCompress -d $OUTPUT_PATH -p "*.dll" "*.js" "*.wasm" --format br --threads 4 - - - name: Compress Output using GZip - run: DotNetCompress -d $OUTPUT_PATH -p "*.dll" "*.js" "*.wasm" --format gz --threads 4 - - name: Add .nojekyll file run: touch $OUTPUT_PATH/.nojekyll diff --git a/.github/workflows/pack.yml b/.github/workflows/pack.yml new file mode 100644 index 00000000..59889275 --- /dev/null +++ b/.github/workflows/pack.yml @@ -0,0 +1,52 @@ +name: Pack + +on: + push: + branches: [ "action/pack" ] + pull_request: + branches: [ "action/pack" ] + +jobs: + nuget_desktop: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v4.1.1 + + - name: Nuget Ursa + run: dotnet pack ./src/Ursa -o ./nugets + + - name: Nuget Ursa.Themes.Semi + run: dotnet pack ./src/Ursa.Themes.Semi -o ./nugets + + - name: Desktop + run: dotnet publish ./demo/Ursa.Demo.Desktop -r win-x64 -c Release /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true --self-contained true + + - name: Upload a Build Artifact + uses: actions/upload-artifact@v4.3.1 + with: + name: nuget_desktop + path: | + ./nugets + ./**/publish/*.exe + + android: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v4.1.1 + + - name: CD Android + run: cd ./demo/Ursa.Demo.Android + + - name: Restore Dependencies + run: dotnet restore + + - name: Build + run: dotnet publish ./demo/Ursa.Demo.Android -c Release -f net8.0-android --no-restore + + - name: Upload a Build Artifact + uses: actions/upload-artifact@v4.3.1 + with: + name: android + path: ./**/publish/*Signed.apk diff --git a/README.md b/README.md index 3950ab05..dced897b 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Ursa is a UI library for building cross-platform UIs with Avalonia UI. Add nuget package: ```bash -dotnet add package Irihi.Ursa --version 0.2.0-beta20240129 +dotnet add package Irihi.Ursa ``` You can now use Ursa controls in your Avalonia Application. @@ -42,7 +42,7 @@ Ursa.Themes.Semi is a theme package for Ursa inspired by Semi Design. You can ad Add nuget package: ```bash dotnet add package Semi.Avalonia --version 11.0.7 -dotnet add package Irihi.Ursa.Themes.Semi --version 0.2.0-beta20240129 +dotnet add package Irihi.Ursa.Themes.Semi ``` Include Styles in application: @@ -56,3 +56,9 @@ Include Styles in application: ``` + +## Support + +We offer limited free community support for Semi Avalonia and Ursa. Please join our group via FeiShu(Lark) + +![Support](./assets/community-support.png) \ No newline at end of file diff --git a/Ursa.sln b/Ursa.sln index d46008b8..a7328fd6 100644 --- a/Ursa.sln +++ b/Ursa.sln @@ -20,6 +20,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ursa.PrismExtension", "src\ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ursa.PrismDialogDemo", "demo\Ursa.PrismDialogDemo\Ursa.PrismDialogDemo.csproj", "{F99B3D07-4560-4B05-892C-0FF2757FEF2E}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution Files", "{9D34CC2C-9BFA-4138-BA5A-CD3744F9B589}" + ProjectSection(SolutionItems) = preProject + src\Package.props = src\Package.props + demo\Directory.Build.props = demo\Directory.Build.props + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/assets/community-support.png b/assets/community-support.png new file mode 100644 index 00000000..fa4206c0 Binary files /dev/null and b/assets/community-support.png differ diff --git a/demo/Directory.Build.props b/demo/Directory.Build.props index c950d6ac..4832db98 100644 --- a/demo/Directory.Build.props +++ b/demo/Directory.Build.props @@ -1,6 +1,6 @@ enable - 11.0.9 + 11.1.0-rc2 diff --git a/demo/Ursa.Demo.Android/Ursa.Demo.Android.csproj b/demo/Ursa.Demo.Android/Ursa.Demo.Android.csproj index 4071d05e..f5730c19 100644 --- a/demo/Ursa.Demo.Android/Ursa.Demo.Android.csproj +++ b/demo/Ursa.Demo.Android/Ursa.Demo.Android.csproj @@ -1,7 +1,7 @@ Exe - net7.0-android + net8.0-android 21 enable com.irihitech.Ursa diff --git a/demo/Ursa.Demo.Browser/Program.cs b/demo/Ursa.Demo.Browser/Program.cs index 4fa71621..f6656416 100644 --- a/demo/Ursa.Demo.Browser/Program.cs +++ b/demo/Ursa.Demo.Browser/Program.cs @@ -7,9 +7,9 @@ namespace Ursa.Demo.Browser; -internal partial class Program +internal sealed partial class Program { - private static async Task Main(string[] args) => await BuildAvaloniaApp() + private static Task Main(string[] args) => BuildAvaloniaApp() .StartBrowserAppAsync("out"); public static AppBuilder BuildAvaloniaApp() diff --git a/demo/Ursa.Demo.Browser/Ursa.Demo.Browser.csproj b/demo/Ursa.Demo.Browser/Ursa.Demo.Browser.csproj index f51b5fbc..0b2c8c45 100644 --- a/demo/Ursa.Demo.Browser/Ursa.Demo.Browser.csproj +++ b/demo/Ursa.Demo.Browser/Ursa.Demo.Browser.csproj @@ -1,20 +1,18 @@ - + - net7.0 - browser-wasm - AppBundle\main.js Exe + net8.0-browser - + - + - + diff --git a/demo/Ursa.Demo.Browser/linker.xml b/demo/Ursa.Demo.Browser/linker.xml new file mode 100644 index 00000000..1b96c2ac --- /dev/null +++ b/demo/Ursa.Demo.Browser/linker.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/demo/Ursa.Demo.Browser/AppBundle/Logo.svg b/demo/Ursa.Demo.Browser/wwwroot/Logo.svg similarity index 100% rename from demo/Ursa.Demo.Browser/AppBundle/Logo.svg rename to demo/Ursa.Demo.Browser/wwwroot/Logo.svg diff --git a/demo/Ursa.Demo.Browser/AppBundle/app.css b/demo/Ursa.Demo.Browser/wwwroot/app.css similarity index 100% rename from demo/Ursa.Demo.Browser/AppBundle/app.css rename to demo/Ursa.Demo.Browser/wwwroot/app.css diff --git a/demo/Ursa.Demo.Browser/AppBundle/favicon.ico b/demo/Ursa.Demo.Browser/wwwroot/favicon.ico similarity index 100% rename from demo/Ursa.Demo.Browser/AppBundle/favicon.ico rename to demo/Ursa.Demo.Browser/wwwroot/favicon.ico diff --git a/demo/Ursa.Demo.Browser/AppBundle/index.html b/demo/Ursa.Demo.Browser/wwwroot/index.html similarity index 86% rename from demo/Ursa.Demo.Browser/AppBundle/index.html rename to demo/Ursa.Demo.Browser/wwwroot/index.html index 184f7caf..1c9e22f9 100644 --- a/demo/Ursa.Demo.Browser/AppBundle/index.html +++ b/demo/Ursa.Demo.Browser/wwwroot/index.html @@ -7,8 +7,8 @@ - - + + diff --git a/demo/Ursa.Demo.Browser/AppBundle/main.js b/demo/Ursa.Demo.Browser/wwwroot/main.js similarity index 69% rename from demo/Ursa.Demo.Browser/AppBundle/main.js rename to demo/Ursa.Demo.Browser/wwwroot/main.js index 0dbe2e45..2af82e9b 100644 --- a/demo/Ursa.Demo.Browser/AppBundle/main.js +++ b/demo/Ursa.Demo.Browser/wwwroot/main.js @@ -1,4 +1,4 @@ -import { dotnet } from './dotnet.js' +import { dotnet } from './_framework/dotnet.js' const is_browser = typeof window != "undefined"; if (!is_browser) throw new Error(`Expected to be running in a browser`); @@ -10,4 +10,4 @@ const dotnetRuntime = await dotnet const config = dotnetRuntime.getConfig(); -await dotnetRuntime.runMainAndExit(config.mainAssemblyName, [window.location.search]); \ No newline at end of file +await dotnetRuntime.runMain(config.mainAssemblyName, [window.location.search]); \ No newline at end of file diff --git a/demo/Ursa.Demo.Desktop/Ursa.Demo.Desktop.csproj b/demo/Ursa.Demo.Desktop/Ursa.Demo.Desktop.csproj index 64e44cec..6566753f 100644 --- a/demo/Ursa.Demo.Desktop/Ursa.Demo.Desktop.csproj +++ b/demo/Ursa.Demo.Desktop/Ursa.Demo.Desktop.csproj @@ -3,7 +3,7 @@ WinExe - net7.0 + net8.0 enable true false diff --git a/demo/Ursa.Demo.iOS/Ursa.Demo.iOS.csproj b/demo/Ursa.Demo.iOS/Ursa.Demo.iOS.csproj index 5f70ccb3..65fad79e 100644 --- a/demo/Ursa.Demo.iOS/Ursa.Demo.iOS.csproj +++ b/demo/Ursa.Demo.iOS/Ursa.Demo.iOS.csproj @@ -1,7 +1,7 @@  Exe - net6.0-ios + net8.0-ios 13.0 enable diff --git a/demo/Ursa.Demo/App.axaml.cs b/demo/Ursa.Demo/App.axaml.cs index 169a1161..1b2ba8ae 100644 --- a/demo/Ursa.Demo/App.axaml.cs +++ b/demo/Ursa.Demo/App.axaml.cs @@ -24,7 +24,7 @@ public override void OnFrameworkInitializationCompleted() } else if (ApplicationLifetime is ISingleViewApplicationLifetime singleView) { - singleView.MainView = new MainView() + singleView.MainView = new SingleView() { DataContext = new MainViewViewModel(), }; diff --git a/demo/Ursa.Demo/Assets/3x.png b/demo/Ursa.Demo/Assets/3x.png new file mode 100644 index 00000000..6dd5bf10 Binary files /dev/null and b/demo/Ursa.Demo/Assets/3x.png differ diff --git a/demo/Ursa.Demo/Converters/IconNameConverter.cs b/demo/Ursa.Demo/Converters/IconNameConverter.cs index 309a0e87..4d1fe998 100644 --- a/demo/Ursa.Demo/Converters/IconNameConverter.cs +++ b/demo/Ursa.Demo/Converters/IconNameConverter.cs @@ -13,7 +13,7 @@ namespace Ursa.Demo.Converters; public class IconNameConverter: IValueConverter { [Content] - public Dictionary Paths { get; set; } = new(); + public Dictionary Paths { get; set; } = new(); public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) { diff --git a/demo/Ursa.Demo/Dialogs/PlainDialog.axaml b/demo/Ursa.Demo/Dialogs/PlainDialog.axaml index 89dbb0dd..8543273d 100644 --- a/demo/Ursa.Demo/Dialogs/PlainDialog.axaml +++ b/demo/Ursa.Demo/Dialogs/PlainDialog.axaml @@ -9,5 +9,6 @@ x:Class="Ursa.Demo.Dialogs.PlainDialog"> + diff --git a/demo/Ursa.Demo/Dialogs/PlainDialogViewModel.cs b/demo/Ursa.Demo/Dialogs/PlainDialogViewModel.cs index 2e199a6f..b1058c1b 100644 --- a/demo/Ursa.Demo/Dialogs/PlainDialogViewModel.cs +++ b/demo/Ursa.Demo/Dialogs/PlainDialogViewModel.cs @@ -12,4 +12,16 @@ public DateTime? Date get => _date; set => SetProperty(ref _date, value); } -} \ No newline at end of file + + private string? _text; + public string? Text + { + get => _text; + set => SetProperty(ref _text, value); + } + + public PlainDialogViewModel() + { + Text = "I am PlainDialogViewModel!"; + } +} diff --git a/demo/Ursa.Demo/Models/MenuKeys.cs b/demo/Ursa.Demo/Models/MenuKeys.cs index 085be94d..e69de29b 100644 --- a/demo/Ursa.Demo/Models/MenuKeys.cs +++ b/demo/Ursa.Demo/Models/MenuKeys.cs @@ -1,36 +0,0 @@ -namespace Ursa.Demo; - -public static class MenuKeys -{ - public const string MenuKeyIntroduction = "Introduction"; - public const string MenuKeyBadge = "Badge"; - public const string MenuKeyBanner = "Banner"; - public const string MenuKeyButtonGroup = "ButtonGroup"; - public const string MenuKeyClassInput = "Class Input"; - public const string MenuKeyDialog = "Dialog"; - public const string MenuKeyDivider = "Divider"; - public const string MenuKeyDisableContainer = "DisableContainer"; - public const string MenuKeyDrawer = "Drawer"; - public const string MenuKeyDualBadge = "DualBadge"; - public const string MenuKeyEnumSelector = "EnumSelector"; - public const string MenuKeyForm = "Form"; - public const string MenuKeyImageViewer = "ImageViewer"; - public const string MenuKeyIpBox = "IPv4Box"; - public const string MenuKeyIconButton = "IconButton"; - public const string MenuKeyKeyGestureInput = "KeyGestureInput"; - public const string MenuKeyLoading = "Loading"; - public const string MenuKeyMessageBox = "MessageBox"; - public const string MenuKeyNavMenu = "NavMenu"; - public const string MenuKeyNumberDisplayer = "NumberDisplayer"; - public const string MenuKeyNumericUpDown = "NumericUpDown"; - public const string MenuKeyPagination = "Pagination"; - public const string MenuKeyRangeSlider = "RangeSlider"; - public const string MenuKeySelectionList = "SelectionList"; - public const string MenuKeyTagInput = "TagInput"; - public const string MenuKeySkeleton = "Skeleton"; - public const string MenuKeyTimeline = "Timeline"; - public const string MenuKeyTwoTonePathIcon = "TwoTonePathIcon"; - public const string MenuKeyThemeToggler = "ThemeToggler"; - public const string MenuKeyToolBar = "ToolBar"; - -} \ No newline at end of file diff --git a/demo/Ursa.Demo/Pages/AvatarDemo.axaml b/demo/Ursa.Demo/Pages/AvatarDemo.axaml new file mode 100644 index 00000000..1a075437 --- /dev/null +++ b/demo/Ursa.Demo/Pages/AvatarDemo.axaml @@ -0,0 +1,96 @@ + + + + + + M7.44721 3.10557C7.786 2.428 8.47852 2 9.23607 2H14.7639C15.5215 2 16.214 2.428 16.5528 3.10557L17.5 5H20C21.6569 5 23 6.34315 23 8V18C23 19.6569 21.6569 21 20 21H4C2.34315 21 1 19.6569 1 18V8C1 6.34315 2.34315 5 4 5H6.5L7.44721 3.10557ZM9 13C9 11.3431 10.3431 10 12 10C13.6569 10 15 11.3431 15 13C15 14.6569 13.6569 16 12 16C10.3431 16 9 14.6569 9 13ZM12 8C9.23858 8 7 10.2386 7 13C7 15.7614 9.23858 18 12 18C14.7614 18 17 15.7614 17 13C17 10.2386 14.7614 8 12 8Z + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/demo/Ursa.Demo/Pages/AvatarDemo.axaml.cs b/demo/Ursa.Demo/Pages/AvatarDemo.axaml.cs new file mode 100644 index 00000000..5bc2485a --- /dev/null +++ b/demo/Ursa.Demo/Pages/AvatarDemo.axaml.cs @@ -0,0 +1,13 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace Ursa.Demo.Pages; + +public partial class AvatarDemo : UserControl +{ + public AvatarDemo() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/demo/Ursa.Demo/Pages/BadgeDemo.axaml b/demo/Ursa.Demo/Pages/BadgeDemo.axaml index 012ea37b..f46673b6 100644 --- a/demo/Ursa.Demo/Pages/BadgeDemo.axaml +++ b/demo/Ursa.Demo/Pages/BadgeDemo.axaml @@ -8,7 +8,7 @@ d:DesignHeight="850" d:DesignWidth="850" mc:Ignorable="d"> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo/Ursa.Demo/Pages/BreadcrumbDemo.axaml.cs b/demo/Ursa.Demo/Pages/BreadcrumbDemo.axaml.cs new file mode 100644 index 00000000..c119fc7a --- /dev/null +++ b/demo/Ursa.Demo/Pages/BreadcrumbDemo.axaml.cs @@ -0,0 +1,13 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace Ursa.Demo.Pages; + +public partial class BreadcrumbDemo : UserControl +{ + public BreadcrumbDemo() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/demo/Ursa.Demo/Pages/ClockDemo.axaml b/demo/Ursa.Demo/Pages/ClockDemo.axaml new file mode 100644 index 00000000..f29eff8a --- /dev/null +++ b/demo/Ursa.Demo/Pages/ClockDemo.axaml @@ -0,0 +1,18 @@ + + + + + + diff --git a/demo/Ursa.Demo/Pages/ClockDemo.axaml.cs b/demo/Ursa.Demo/Pages/ClockDemo.axaml.cs new file mode 100644 index 00000000..058136a8 --- /dev/null +++ b/demo/Ursa.Demo/Pages/ClockDemo.axaml.cs @@ -0,0 +1,13 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace Ursa.Demo.Pages; + +public partial class ClockDemo : UserControl +{ + public ClockDemo() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/demo/Ursa.Demo/Pages/DatePickerDemo.axaml b/demo/Ursa.Demo/Pages/DatePickerDemo.axaml new file mode 100644 index 00000000..65094c14 --- /dev/null +++ b/demo/Ursa.Demo/Pages/DatePickerDemo.axaml @@ -0,0 +1,14 @@ + + + + + + + + diff --git a/demo/Ursa.Demo/Pages/DatePickerDemo.axaml.cs b/demo/Ursa.Demo/Pages/DatePickerDemo.axaml.cs new file mode 100644 index 00000000..e38d30dc --- /dev/null +++ b/demo/Ursa.Demo/Pages/DatePickerDemo.axaml.cs @@ -0,0 +1,25 @@ +using System.Diagnostics; +using Avalonia; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; +using Ursa.Controls; + +namespace Ursa.Demo.Pages; + +public partial class DatePickerDemo : UserControl +{ + public DatePickerDemo() + { + InitializeComponent(); + } + + private void CalendarView_OnOnDateSelected(object? sender, CalendarDayButtonEventArgs e) + { + Debug.WriteLine("Pressed: "+ e.Date?.ToLongDateString()); + } + + private void CalendarView_OnOnDatePreviewed(object? sender, CalendarDayButtonEventArgs e) + { + Debug.WriteLine("Hovered: "+e.Date?.ToLongDateString()); + } +} \ No newline at end of file diff --git a/demo/Ursa.Demo/Pages/DialogDemo.axaml b/demo/Ursa.Demo/Pages/DialogDemo.axaml index 1e6e67f7..8ff35344 100644 --- a/demo/Ursa.Demo/Pages/DialogDemo.axaml +++ b/demo/Ursa.Demo/Pages/DialogDemo.axaml @@ -34,27 +34,38 @@ IsVisible="{Binding !#overlay.IsChecked}" OffContent="Regular" OnContent="Modal" /> + + - - + + - - + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Controls/Clock.axaml b/src/Ursa.Themes.Semi/Controls/Clock.axaml new file mode 100644 index 00000000..58809b82 --- /dev/null +++ b/src/Ursa.Themes.Semi/Controls/Clock.axaml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Ursa.Themes.Semi/Controls/DatePicker.axaml b/src/Ursa.Themes.Semi/Controls/DatePicker.axaml new file mode 100644 index 00000000..05c1357c --- /dev/null +++ b/src/Ursa.Themes.Semi/Controls/DatePicker.axaml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Ursa.Themes.Semi/Controls/TimeBox.axaml b/src/Ursa.Themes.Semi/Controls/TimeBox.axaml new file mode 100644 index 00000000..479b100a --- /dev/null +++ b/src/Ursa.Themes.Semi/Controls/TimeBox.axaml @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Controls/TimePicker.axaml b/src/Ursa.Themes.Semi/Controls/TimePicker.axaml new file mode 100644 index 00000000..14c5b6b5 --- /dev/null +++ b/src/Ursa.Themes.Semi/Controls/TimePicker.axaml @@ -0,0 +1,246 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Ursa.Themes.Semi/Controls/VerificationCode.axaml b/src/Ursa.Themes.Semi/Controls/VerificationCode.axaml new file mode 100644 index 00000000..ae38a545 --- /dev/null +++ b/src/Ursa.Themes.Semi/Controls/VerificationCode.axaml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Ursa.Themes.Semi/Controls/_index.axaml b/src/Ursa.Themes.Semi/Controls/_index.axaml index 21d39098..03450443 100644 --- a/src/Ursa.Themes.Semi/Controls/_index.axaml +++ b/src/Ursa.Themes.Semi/Controls/_index.axaml @@ -1,16 +1,23 @@ + + + + + + + @@ -19,17 +26,28 @@ + + + + + + + + + + + diff --git a/src/Ursa.Themes.Semi/Converters/ClockHandLengthConverter.cs b/src/Ursa.Themes.Semi/Converters/ClockHandLengthConverter.cs new file mode 100644 index 00000000..6715eefa --- /dev/null +++ b/src/Ursa.Themes.Semi/Converters/ClockHandLengthConverter.cs @@ -0,0 +1,27 @@ +using System.Globalization; +using Avalonia.Data.Converters; + +namespace Ursa.Themes.Semi.Converters; + +public class ClockHandLengthConverter(double ratio) : IValueConverter +{ + public static ClockHandLengthConverter Hour { get; } = new(1-0.618); + public static ClockHandLengthConverter Minute { get; } = new(0.618); + public static ClockHandLengthConverter Second { get; } = new(1); + + private double _ratio = ratio; + + public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) + { + if (value is double d) + { + return d * ratio / 2; + } + return 0.0; + } + + public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Index.axaml.cs b/src/Ursa.Themes.Semi/Index.axaml.cs index a0eeea49..eec6fa7f 100644 --- a/src/Ursa.Themes.Semi/Index.axaml.cs +++ b/src/Ursa.Themes.Semi/Index.axaml.cs @@ -1,21 +1,23 @@ using System.Globalization; -using System.Runtime.CompilerServices; -using Avalonia; using Avalonia.Controls; using Avalonia.Markup.Xaml; -using Avalonia.Markup.Xaml.Styling; -using Avalonia.Platform; using Avalonia.Styling; namespace Ursa.Themes.Semi; +/// +/// Notice: Don't set Locale if your app is in InvariantGlobalization mode. +/// public class SemiTheme: Styles { - private static readonly Dictionary _localeToResource = new() - { - { new CultureInfo("zh-CN"), "avares://Ursa.Themes.Semi/Locale/zh-CN.axaml" }, - { new CultureInfo("en-US"), "avares://Ursa.Themes.Semi/Locale/en-US.axaml" }, - }; + private static readonly Lazy> _localeToResource = new Lazy>( + () => new Dictionary + { + { new CultureInfo("zh-CN"), "avares://Ursa.Themes.Semi/Locale/zh-CN.axaml" }, + { new CultureInfo("en-US"), "avares://Ursa.Themes.Semi/Locale/en-US.axaml" }, + }); + + private static readonly string _defaultResource = "avares://Ursa.Themes.Semi/Locale/zh-CN.axaml"; private readonly IServiceProvider? sp; public SemiTheme(IServiceProvider? provider = null) @@ -29,29 +31,40 @@ public CultureInfo? Locale { get => _locale; set - { - _locale = value; - var resource = TryGetLocaleResource(value); - var d = AvaloniaXamlLoader.Load(sp, new Uri(resource)) as ResourceDictionary; - if (d is null) return; - foreach (var kv in d) + { + try { - this.Resources.Add(kv); + _locale = value; + var resource = TryGetLocaleResource(value); + var d = AvaloniaXamlLoader.Load(sp, new Uri(resource)) as ResourceDictionary; + if (d is null) return; + foreach (var kv in d) + { + this.Resources.Add(kv); + } } + catch + { + _locale = CultureInfo.InvariantCulture; + } + } } private static string TryGetLocaleResource(CultureInfo? locale) { + if (Equals(locale, CultureInfo.InvariantCulture)) + { + return _defaultResource; + } if (locale is null) { - return _localeToResource[new CultureInfo("zh-CN")]; + return _localeToResource.Value[new CultureInfo("zh-CN")]; } - - if (_localeToResource.TryGetValue(locale, out var resource)) + if (_localeToResource.Value.TryGetValue(locale, out var resource)) { return resource; } - return _localeToResource[new CultureInfo("zh-CN")]; + return _localeToResource.Value[new CultureInfo("zh-CN")]; } } \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Locale/en-us.axaml b/src/Ursa.Themes.Semi/Locale/en-us.axaml index e6d2f69e..5f2389bb 100644 --- a/src/Ursa.Themes.Semi/Locale/en-us.axaml +++ b/src/Ursa.Themes.Semi/Locale/en-us.axaml @@ -10,4 +10,12 @@ Yes No Close + Jump to page + + Dark + Light + System + Confirm + Start Time + End Time diff --git a/src/Ursa.Themes.Semi/Locale/zh-cn.axaml b/src/Ursa.Themes.Semi/Locale/zh-cn.axaml index c738313e..94d2f9ea 100644 --- a/src/Ursa.Themes.Semi/Locale/zh-cn.axaml +++ b/src/Ursa.Themes.Semi/Locale/zh-cn.axaml @@ -10,4 +10,12 @@ 关闭 + 跳至 + + 暗色 + 亮色 + 跟随系统 + 确认 + 开始时间 + 结束时间 diff --git a/src/Ursa.Themes.Semi/Styles/Breadcrumb.axaml b/src/Ursa.Themes.Semi/Styles/Breadcrumb.axaml new file mode 100644 index 00000000..66e67062 --- /dev/null +++ b/src/Ursa.Themes.Semi/Styles/Breadcrumb.axaml @@ -0,0 +1,20 @@ + + + + + + + + + + + + diff --git a/src/Ursa.Themes.Semi/Styles/TimeBox.axaml b/src/Ursa.Themes.Semi/Styles/TimeBox.axaml new file mode 100644 index 00000000..cab7e70c --- /dev/null +++ b/src/Ursa.Themes.Semi/Styles/TimeBox.axaml @@ -0,0 +1,21 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Styles/_index.axaml b/src/Ursa.Themes.Semi/Styles/_index.axaml index e3cc6668..868fad8d 100644 --- a/src/Ursa.Themes.Semi/Styles/_index.axaml +++ b/src/Ursa.Themes.Semi/Styles/_index.axaml @@ -4,8 +4,10 @@ + + diff --git a/src/Ursa.Themes.Semi/Themes/Dark/Avatar.axaml b/src/Ursa.Themes.Semi/Themes/Dark/Avatar.axaml new file mode 100644 index 00000000..53516aa3 --- /dev/null +++ b/src/Ursa.Themes.Semi/Themes/Dark/Avatar.axaml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Themes/Dark/ButtonGroup.axaml b/src/Ursa.Themes.Semi/Themes/Dark/ButtonGroup.axaml index 6ae7f409..9c55ccdc 100644 --- a/src/Ursa.Themes.Semi/Themes/Dark/ButtonGroup.axaml +++ b/src/Ursa.Themes.Semi/Themes/Dark/ButtonGroup.axaml @@ -1,5 +1,7 @@ + + diff --git a/src/Ursa.Themes.Semi/Themes/Dark/DatePicker.axaml b/src/Ursa.Themes.Semi/Themes/Dark/DatePicker.axaml new file mode 100644 index 00000000..663edbdb --- /dev/null +++ b/src/Ursa.Themes.Semi/Themes/Dark/DatePicker.axaml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Themes/Dark/Rating.axaml b/src/Ursa.Themes.Semi/Themes/Dark/Rating.axaml new file mode 100644 index 00000000..f0cc810a --- /dev/null +++ b/src/Ursa.Themes.Semi/Themes/Dark/Rating.axaml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Themes/Dark/TimeBox.axaml b/src/Ursa.Themes.Semi/Themes/Dark/TimeBox.axaml new file mode 100644 index 00000000..7caba956 --- /dev/null +++ b/src/Ursa.Themes.Semi/Themes/Dark/TimeBox.axaml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Themes/Dark/_index.axaml b/src/Ursa.Themes.Semi/Themes/Dark/_index.axaml index 63d0c66e..91ca1597 100644 --- a/src/Ursa.Themes.Semi/Themes/Dark/_index.axaml +++ b/src/Ursa.Themes.Semi/Themes/Dark/_index.axaml @@ -1,9 +1,10 @@ - + + @@ -12,8 +13,10 @@ + + - + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Themes/Light/Avatar.axaml b/src/Ursa.Themes.Semi/Themes/Light/Avatar.axaml new file mode 100644 index 00000000..9080891b --- /dev/null +++ b/src/Ursa.Themes.Semi/Themes/Light/Avatar.axaml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Themes/Light/DatePicker.axaml b/src/Ursa.Themes.Semi/Themes/Light/DatePicker.axaml new file mode 100644 index 00000000..23fad7a5 --- /dev/null +++ b/src/Ursa.Themes.Semi/Themes/Light/DatePicker.axaml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Themes/Light/Rating.axaml b/src/Ursa.Themes.Semi/Themes/Light/Rating.axaml new file mode 100644 index 00000000..ddb703ac --- /dev/null +++ b/src/Ursa.Themes.Semi/Themes/Light/Rating.axaml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Themes/Light/TimeBox.axaml b/src/Ursa.Themes.Semi/Themes/Light/TimeBox.axaml new file mode 100644 index 00000000..ed693758 --- /dev/null +++ b/src/Ursa.Themes.Semi/Themes/Light/TimeBox.axaml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Themes/Light/_index.axaml b/src/Ursa.Themes.Semi/Themes/Light/_index.axaml index 63d0c66e..91ca1597 100644 --- a/src/Ursa.Themes.Semi/Themes/Light/_index.axaml +++ b/src/Ursa.Themes.Semi/Themes/Light/_index.axaml @@ -1,9 +1,10 @@ - + + @@ -12,8 +13,10 @@ + + - + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Themes/Shared/Avatar.axaml b/src/Ursa.Themes.Semi/Themes/Shared/Avatar.axaml new file mode 100644 index 00000000..ebd81a4e --- /dev/null +++ b/src/Ursa.Themes.Semi/Themes/Shared/Avatar.axaml @@ -0,0 +1,29 @@ + + 600 + 100 + + 3 + + 20 + 10 + + 24 + 10 + + 32 + 12 + + 40 + 18 + + 48 + 20 + + 72 + 32 + 6 + + 128 + 64 + 12 + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Themes/Shared/Banner.axaml b/src/Ursa.Themes.Semi/Themes/Shared/Banner.axaml index 641d8063..4b6337ea 100644 --- a/src/Ursa.Themes.Semi/Themes/Shared/Banner.axaml +++ b/src/Ursa.Themes.Semi/Themes/Shared/Banner.axaml @@ -1,10 +1,10 @@ - M12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23ZM14 7C14 8.10457 13.1046 9 12 9C10.8954 9 10 8.10457 10 7C10 5.89543 10.8954 5 12 5C13.1046 5 14 5.89543 14 7ZM9 10.75C9 10.3358 9.33579 10 9.75 10H12.5C13.0523 10 13.5 10.4477 13.5 11V16.5H14.25C14.6642 16.5 15 16.8358 15 17.25C15 17.6642 14.6642 18 14.25 18H9.75C9.33579 18 9 17.6642 9 17.25C9 16.8358 9.33579 16.5 9.75 16.5H10.5V11.5H9.75C9.33579 11.5 9 11.1642 9 10.75Z - M23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12ZM13.5 17.5C13.5 16.6716 12.8284 16 12 16C11.1716 16 10.5 16.6716 10.5 17.5C10.5 18.3284 11.1716 19 12 19C12.8284 19 13.5 18.3284 13.5 17.5ZM12 5C10.9138 5 10.0507 5.91244 10.1109 6.99692L10.4168 12.5023C10.4635 13.3426 11.1584 14 12 14C12.8416 14 13.5365 13.3426 13.5832 12.5023L13.8891 6.99692C13.9493 5.91244 13.0862 5 12 5Z - M12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23ZM17.8831 9.82235L11.6854 17.4112C11.4029 17.7806 10.965 17.9981 10.5 18C10.035 18.0019 9.59533 17.788 9.30982 17.421L5.81604 13.4209C5.30744 12.767 5.42524 11.8246 6.07916 11.316C6.73308 10.8074 7.67549 10.9252 8.1841 11.5791L10.4838 14.0439L15.5 8C16.0032 7.34193 16.9446 7.21641 17.6027 7.71964C18.2608 8.22287 18.3863 9.16428 17.8831 9.82235Z - M10.2268 2.3986L1.52616 19.0749C0.831449 20.4064 1.79747 22 3.29933 22H20.7007C22.2025 22 23.1686 20.4064 22.4739 19.0749L13.7732 2.3986C13.0254 0.965441 10.9746 0.965442 10.2268 2.3986ZM13.1415 14.0101C13.0603 14.5781 12.5739 15 12.0001 15C11.4263 15 10.9398 14.5781 10.8586 14.0101L10.2829 9.97992C10.1336 8.93495 10.9445 8.00002 12.0001 8.00002C13.0556 8.00002 13.8665 8.93495 13.7172 9.97992L13.1415 14.0101ZM13.5001 18.5C13.5001 19.3284 12.8285 20 12.0001 20C11.1716 20 10.5001 19.3284 10.5001 18.5C10.5001 17.6716 11.1716 17 12.0001 17C12.8285 17 13.5001 17.6716 13.5001 18.5Z - M 17.6568 19.7782 C 18.2426 20.3639 19.1924 20.3639 19.7782 19.7782 C 20.3639 19.1924 20.3639 18.2426 19.7782 17.6568 L 14.1213 12 L 19.7782 6.34313 C 20.3639 5.75734 20.3639 4.8076 19.7782 4.22181 C 19.1924 3.63602 18.2426 3.63602 17.6568 4.22181 L 12 9.87866 L 6.34313 4.22181 C 5.75734 3.63602 4.8076 3.63602 4.22181 4.22181 C 3.63602 4.8076 3.63602 5.75734 4.22181 6.34313 L 9.87866 12 L 4.22181 17.6568 C 3.63602 18.2426 3.63602 19.1924 4.22181 19.7782 C 4.8076 20.3639 5.75734 20.3639 6.34313 19.7782 L 12 14.1213 L 17.6568 19.7782 Z + M12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23ZM14 7C14 8.10457 13.1046 9 12 9C10.8954 9 10 8.10457 10 7C10 5.89543 10.8954 5 12 5C13.1046 5 14 5.89543 14 7ZM9 10.75C9 10.3358 9.33579 10 9.75 10H12.5C13.0523 10 13.5 10.4477 13.5 11V16.5H14.25C14.6642 16.5 15 16.8358 15 17.25C15 17.6642 14.6642 18 14.25 18H9.75C9.33579 18 9 17.6642 9 17.25C9 16.8358 9.33579 16.5 9.75 16.5H10.5V11.5H9.75C9.33579 11.5 9 11.1642 9 10.75Z + M23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12ZM13.5 17.5C13.5 16.6716 12.8284 16 12 16C11.1716 16 10.5 16.6716 10.5 17.5C10.5 18.3284 11.1716 19 12 19C12.8284 19 13.5 18.3284 13.5 17.5ZM12 5C10.9138 5 10.0507 5.91244 10.1109 6.99692L10.4168 12.5023C10.4635 13.3426 11.1584 14 12 14C12.8416 14 13.5365 13.3426 13.5832 12.5023L13.8891 6.99692C13.9493 5.91244 13.0862 5 12 5Z + M12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23ZM17.8831 9.82235L11.6854 17.4112C11.4029 17.7806 10.965 17.9981 10.5 18C10.035 18.0019 9.59533 17.788 9.30982 17.421L5.81604 13.4209C5.30744 12.767 5.42524 11.8246 6.07916 11.316C6.73308 10.8074 7.67549 10.9252 8.1841 11.5791L10.4838 14.0439L15.5 8C16.0032 7.34193 16.9446 7.21641 17.6027 7.71964C18.2608 8.22287 18.3863 9.16428 17.8831 9.82235Z + M10.2268 2.3986L1.52616 19.0749C0.831449 20.4064 1.79747 22 3.29933 22H20.7007C22.2025 22 23.1686 20.4064 22.4739 19.0749L13.7732 2.3986C13.0254 0.965441 10.9746 0.965442 10.2268 2.3986ZM13.1415 14.0101C13.0603 14.5781 12.5739 15 12.0001 15C11.4263 15 10.9398 14.5781 10.8586 14.0101L10.2829 9.97992C10.1336 8.93495 10.9445 8.00002 12.0001 8.00002C13.0556 8.00002 13.8665 8.93495 13.7172 9.97992L13.1415 14.0101ZM13.5001 18.5C13.5001 19.3284 12.8285 20 12.0001 20C11.1716 20 10.5001 19.3284 10.5001 18.5C10.5001 17.6716 11.1716 17 12.0001 17C12.8285 17 13.5001 17.6716 13.5001 18.5Z + M 17.6568 19.7782 C 18.2426 20.3639 19.1924 20.3639 19.7782 19.7782 C 20.3639 19.1924 20.3639 18.2426 19.7782 17.6568 L 14.1213 12 L 19.7782 6.34313 C 20.3639 5.75734 20.3639 4.8076 19.7782 4.22181 C 19.1924 3.63602 18.2426 3.63602 17.6568 4.22181 L 12 9.87866 L 6.34313 4.22181 C 5.75734 3.63602 4.8076 3.63602 4.22181 4.22181 C 3.63602 4.8076 3.63602 5.75734 4.22181 6.34313 L 9.87866 12 L 4.22181 17.6568 C 3.63602 18.2426 3.63602 19.1924 4.22181 19.7782 C 4.8076 20.3639 5.75734 20.3639 6.34313 19.7782 L 12 14.1213 L 17.6568 19.7782 Z 3 1 diff --git a/src/Ursa.Themes.Semi/Themes/Shared/DatePicker.axaml b/src/Ursa.Themes.Semi/Themes/Shared/DatePicker.axaml new file mode 100644 index 00000000..0cfcfe68 --- /dev/null +++ b/src/Ursa.Themes.Semi/Themes/Shared/DatePicker.axaml @@ -0,0 +1,30 @@ + + + 32 + 32 + 0 2 + 1 + 3 + + 0 + 0 + + 3 0 0 3 + 0 3 3 0 + + + 32 + 32 + 0 2 + 1 + 3 + 0 + + + 260 + 260 + 12 + 12 + M12.6185 4.39653C13.1272 4.92524 13.1272 5.78245 12.6185 6.31116L7.14483 12L12.6185 17.6888C13.1272 18.2176 13.1272 19.0748 12.6185 19.6035C12.1098 20.1322 11.285 20.1322 10.7763 19.6035L4.38153 12.9573C3.87282 12.4286 3.87282 11.5714 4.38153 11.0427L10.7763 4.39653C11.285 3.86782 12.1098 3.86782 12.6185 4.39653Z M19.6185 4.39653C20.1272 4.92524 20.1272 5.78245 19.6185 6.31116L14.1448 12L19.6185 17.6888C20.1272 18.2176 20.1272 19.0748 19.6185 19.6035C19.1098 20.1322 18.285 20.1322 17.7763 19.6035L11.3815 12.9573C10.8728 12.4286 10.8728 11.5714 11.3815 11.0427L17.7763 4.39653C18.285 3.86782 19.1098 3.86782 19.6185 4.39653Z + M4.38153 4.39653C4.89024 3.86782 5.71502 3.86782 6.22373 4.39653L12.6185 11.0427C13.1272 11.5714 13.1272 12.4286 12.6185 12.9573L6.22373 19.6035C5.71502 20.1322 4.89024 20.1322 4.38153 19.6035C3.87282 19.0748 3.87282 18.2176 4.38153 17.6888L9.85517 12L4.38153 6.31116C3.87282 5.78245 3.87282 4.92524 4.38153 4.39653Z M11.3815 4.39653C11.8902 3.86782 12.715 3.86782 13.2237 4.39653L19.6185 11.0427C20.1272 11.5714 20.1272 12.4286 19.6185 12.9573L13.2237 19.6035C12.715 20.1322 11.8902 20.1322 11.3815 19.6035C10.8728 19.0748 10.8728 18.2176 11.3815 17.6888L16.8552 12L11.3815 6.31116C10.8728 5.78245 10.8728 4.92524 11.3815 4.39653Z + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Themes/Shared/Pagination.axaml b/src/Ursa.Themes.Semi/Themes/Shared/Pagination.axaml index 83c83a65..cbb08962 100644 --- a/src/Ursa.Themes.Semi/Themes/Shared/Pagination.axaml +++ b/src/Ursa.Themes.Semi/Themes/Shared/Pagination.axaml @@ -1,8 +1,8 @@ - M12.6185 4.39653C13.1272 4.92524 13.1272 5.78245 12.6185 6.31116L7.14483 12L12.6185 17.6888C13.1272 18.2176 13.1272 19.0748 12.6185 19.6035C12.1098 20.1322 11.285 20.1322 10.7763 19.6035L4.38153 12.9573C3.87282 12.4286 3.87282 11.5714 4.38153 11.0427L10.7763 4.39653C11.285 3.86782 12.1098 3.86782 12.6185 4.39653Z M19.6185 4.39653C20.1272 4.92524 20.1272 5.78245 19.6185 6.31116L14.1448 12L19.6185 17.6888C20.1272 18.2176 20.1272 19.0748 19.6185 19.6035C19.1098 20.1322 18.285 20.1322 17.7763 19.6035L11.3815 12.9573C10.8728 12.4286 10.8728 11.5714 11.3815 11.0427L17.7763 4.39653C18.285 3.86782 19.1098 3.86782 19.6185 4.39653Z - M4.38153 4.39653C4.89024 3.86782 5.71502 3.86782 6.22373 4.39653L12.6185 11.0427C13.1272 11.5714 13.1272 12.4286 12.6185 12.9573L6.22373 19.6035C5.71502 20.1322 4.89024 20.1322 4.38153 19.6035C3.87282 19.0748 3.87282 18.2176 4.38153 17.6888L9.85517 12L4.38153 6.31116C3.87282 5.78245 3.87282 4.92524 4.38153 4.39653Z M11.3815 4.39653C11.8902 3.86782 12.715 3.86782 13.2237 4.39653L19.6185 11.0427C20.1272 11.5714 20.1272 12.4286 19.6185 12.9573L13.2237 19.6035C12.715 20.1322 11.8902 20.1322 11.3815 19.6035C10.8728 19.0748 10.8728 18.2176 11.3815 17.6888L16.8552 12L11.3815 6.31116C10.8728 5.78245 10.8728 4.92524 11.3815 4.39653Z - M7.43934 19.7957C6.85355 19.2099 6.85355 18.2601 7.43934 17.6744L13.0962 12.0175L7.43934 6.36065C6.85355 5.77486 6.85355 4.82511 7.43934 4.23933C8.02513 3.65354 8.97487 3.65354 9.56066 4.23933L16.2782 10.9568C16.864 11.5426 16.864 12.4924 16.2782 13.0782L9.56066 19.7957C8.97487 20.3815 8.02513 20.3815 7.43934 19.7957Z - M16.2782 4.23933C16.864 4.82511 16.864 5.77486 16.2782 6.36065L10.6213 12.0175L16.2782 17.6744C16.864 18.2601 16.864 19.2099 16.2782 19.7957C15.6924 20.3815 14.7426 20.3815 14.1569 19.7957L7.43934 13.0782C6.85355 12.4924 6.85355 11.5426 7.43934 10.9568L14.1569 4.23933C14.7426 3.65354 15.6924 3.65354 16.2782 4.23933Z - M7 12C7 13.3807 5.88071 14.5 4.5 14.5C3.11929 14.5 2 13.3807 2 12C2 10.6193 3.11929 9.5 4.5 9.5C5.88071 9.5 7 10.6193 7 12Z M14.5 12C14.5 13.3807 13.3807 14.5 12 14.5C10.6193 14.5 9.5 13.3807 9.5 12C9.5 10.6193 10.6193 9.5 12 9.5C13.3807 9.5 14.5 10.6193 14.5 12Z M19.5 14.5C20.8807 14.5 22 13.3807 22 12C22 10.6193 20.8807 9.5 19.5 9.5C18.1193 9.5 17 10.6193 17 12C17 13.3807 18.1193 14.5 19.5 14.5Z + M12.6185 4.39653C13.1272 4.92524 13.1272 5.78245 12.6185 6.31116L7.14483 12L12.6185 17.6888C13.1272 18.2176 13.1272 19.0748 12.6185 19.6035C12.1098 20.1322 11.285 20.1322 10.7763 19.6035L4.38153 12.9573C3.87282 12.4286 3.87282 11.5714 4.38153 11.0427L10.7763 4.39653C11.285 3.86782 12.1098 3.86782 12.6185 4.39653Z M19.6185 4.39653C20.1272 4.92524 20.1272 5.78245 19.6185 6.31116L14.1448 12L19.6185 17.6888C20.1272 18.2176 20.1272 19.0748 19.6185 19.6035C19.1098 20.1322 18.285 20.1322 17.7763 19.6035L11.3815 12.9573C10.8728 12.4286 10.8728 11.5714 11.3815 11.0427L17.7763 4.39653C18.285 3.86782 19.1098 3.86782 19.6185 4.39653Z + M4.38153 4.39653C4.89024 3.86782 5.71502 3.86782 6.22373 4.39653L12.6185 11.0427C13.1272 11.5714 13.1272 12.4286 12.6185 12.9573L6.22373 19.6035C5.71502 20.1322 4.89024 20.1322 4.38153 19.6035C3.87282 19.0748 3.87282 18.2176 4.38153 17.6888L9.85517 12L4.38153 6.31116C3.87282 5.78245 3.87282 4.92524 4.38153 4.39653Z M11.3815 4.39653C11.8902 3.86782 12.715 3.86782 13.2237 4.39653L19.6185 11.0427C20.1272 11.5714 20.1272 12.4286 19.6185 12.9573L13.2237 19.6035C12.715 20.1322 11.8902 20.1322 11.3815 19.6035C10.8728 19.0748 10.8728 18.2176 11.3815 17.6888L16.8552 12L11.3815 6.31116C10.8728 5.78245 10.8728 4.92524 11.3815 4.39653Z + M7.43934 19.7957C6.85355 19.2099 6.85355 18.2601 7.43934 17.6744L13.0962 12.0175L7.43934 6.36065C6.85355 5.77486 6.85355 4.82511 7.43934 4.23933C8.02513 3.65354 8.97487 3.65354 9.56066 4.23933L16.2782 10.9568C16.864 11.5426 16.864 12.4924 16.2782 13.0782L9.56066 19.7957C8.97487 20.3815 8.02513 20.3815 7.43934 19.7957Z + M16.2782 4.23933C16.864 4.82511 16.864 5.77486 16.2782 6.36065L10.6213 12.0175L16.2782 17.6744C16.864 18.2601 16.864 19.2099 16.2782 19.7957C15.6924 20.3815 14.7426 20.3815 14.1569 19.7957L7.43934 13.0782C6.85355 12.4924 6.85355 11.5426 7.43934 10.9568L14.1569 4.23933C14.7426 3.65354 15.6924 3.65354 16.2782 4.23933Z + M7 12C7 13.3807 5.88071 14.5 4.5 14.5C3.11929 14.5 2 13.3807 2 12C2 10.6193 3.11929 9.5 4.5 9.5C5.88071 9.5 7 10.6193 7 12Z M14.5 12C14.5 13.3807 13.3807 14.5 12 14.5C10.6193 14.5 9.5 13.3807 9.5 12C9.5 10.6193 10.6193 9.5 12 9.5C13.3807 9.5 14.5 10.6193 14.5 12Z M19.5 14.5C20.8807 14.5 22 13.3807 22 12C22 10.6193 20.8807 9.5 19.5 9.5C18.1193 9.5 17 10.6193 17 12C17 13.3807 18.1193 14.5 19.5 14.5Z diff --git a/src/Ursa.Themes.Semi/Themes/Shared/Rating.axaml b/src/Ursa.Themes.Semi/Themes/Shared/Rating.axaml new file mode 100644 index 00000000..5065bb69 --- /dev/null +++ b/src/Ursa.Themes.Semi/Themes/Shared/Rating.axaml @@ -0,0 +1,6 @@ + + 24 + 16 + 3 4 + M10.7525 1.90411C11.1451 0.698628 12.8549 0.698631 13.2475 1.90411L15.2395 8.01946H21.6858C22.9565 8.01946 23.4848 9.64143 22.4568 10.3865L17.2417 14.1659L19.2337 20.2813C19.6263 21.4868 18.2431 22.4892 17.2151 21.7442L12 17.9647L6.78489 21.7442C5.75687 22.4892 4.37368 21.4868 4.76635 20.2813L6.75834 14.1659L1.54323 10.3865C0.515206 9.64142 1.04354 8.01946 2.31425 8.01946H8.76048L10.7525 1.90411Z + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Themes/Shared/ScrollToButton.axaml b/src/Ursa.Themes.Semi/Themes/Shared/ScrollToButton.axaml new file mode 100644 index 00000000..4e453213 --- /dev/null +++ b/src/Ursa.Themes.Semi/Themes/Shared/ScrollToButton.axaml @@ -0,0 +1,5 @@ + + + M19.637 16.4369C19.0513 17.0227 18.1015 17.0227 17.5157 16.4369L11.8589 10.7801L6.20202 16.4369C5.61623 17.0227 4.66648 17.0227 4.0807 16.4369C3.49491 15.8511 3.49491 14.9014 4.0807 14.3156L10.7982 7.59809C11.384 7.01231 12.3337 7.01231 12.9195 7.59809L19.637 14.3156C20.2228 14.9014 20.2228 15.8511 19.637 16.4369Z + diff --git a/src/Ursa.Themes.Semi/Themes/Shared/TagInput.axaml b/src/Ursa.Themes.Semi/Themes/Shared/TagInput.axaml index 2f3d2b76..bfc84519 100644 --- a/src/Ursa.Themes.Semi/Themes/Shared/TagInput.axaml +++ b/src/Ursa.Themes.Semi/Themes/Shared/TagInput.axaml @@ -1,5 +1,5 @@ - M17.6568 19.7782C18.2426 20.3639 19.1924 20.3639 19.7782 19.7782C20.3639 19.1924 20.3639 18.2426 19.7782 17.6568L14.1213 12L19.7782 6.34313C20.3639 5.75734 20.3639 4.8076 19.7782 4.22181C19.1924 3.63602 18.2426 3.63602 17.6568 4.22181L12 9.87866L6.34313 4.22181C5.75734 3.63602 4.8076 3.63602 4.22181 4.22181C3.63602 4.8076 3.63602 5.75734 4.22181 6.34313L9.87866 12L4.22181 17.6568C3.63602 18.2426 3.63602 19.1924 4.22181 19.7782C4.8076 20.3639 5.75734 20.3639 6.34313 19.7782L12 14.1213L17.6568 19.7782Z + M17.6568 19.7782C18.2426 20.3639 19.1924 20.3639 19.7782 19.7782C20.3639 19.1924 20.3639 18.2426 19.7782 17.6568L14.1213 12L19.7782 6.34313C20.3639 5.75734 20.3639 4.8076 19.7782 4.22181C19.1924 3.63602 18.2426 3.63602 17.6568 4.22181L12 9.87866L6.34313 4.22181C5.75734 3.63602 4.8076 3.63602 4.22181 4.22181C3.63602 4.8076 3.63602 5.75734 4.22181 6.34313L9.87866 12L4.22181 17.6568C3.63602 18.2426 3.63602 19.1924 4.22181 19.7782C4.8076 20.3639 5.75734 20.3639 6.34313 19.7782L12 14.1213L17.6568 19.7782Z 32 diff --git a/src/Ursa.Themes.Semi/Themes/Shared/ThemeSelector.axaml b/src/Ursa.Themes.Semi/Themes/Shared/ThemeSelector.axaml index 7ba95b84..d40b263e 100644 --- a/src/Ursa.Themes.Semi/Themes/Shared/ThemeSelector.axaml +++ b/src/Ursa.Themes.Semi/Themes/Shared/ThemeSelector.axaml @@ -1,6 +1,7 @@  - M12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23ZM17 15C17.476 15 17.9408 14.9525 18.3901 14.862C17.296 17.3011 14.8464 19 12 19C8.13401 19 5 15.866 5 12C5 8.60996 7.40983 5.78277 10.6099 5.13803C10.218 6.01173 10 6.98041 10 8C10 11.866 13.134 15 17 15Z - M3.55 19.09L4.96 20.5L6.76 18.71L5.34 17.29M12 6C8.69 6 6 8.69 6 12S8.69 18 12 18 18 15.31 18 12C18 8.68 15.31 6 12 6M20 13H23V11H20M17.24 18.71L19.04 20.5L20.45 19.09L18.66 17.29M20.45 5L19.04 3.6L17.24 5.39L18.66 6.81M13 1H11V4H13M6.76 5.39L4.96 3.6L3.55 5L5.34 6.81L6.76 5.39M1 13H4V11H1M13 20H11V23H13 + M9,2C7.95,2 6.95,2.16 6,2.46C10.06,3.73 13,7.5 13,12C13,16.5 10.06,20.27 6,21.54C6.95,21.84 7.95,22 9,22A10,10 0 0,0 19,12A10,10 0 0,0 9,2Z + M12,8A4,4 0 0,0 8,12A4,4 0 0,0 12,16A4,4 0 0,0 16,12A4,4 0 0,0 12,8M12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6A6,6 0 0,1 18,12A6,6 0 0,1 12,18M20,8.69V4H15.31L12,0.69L8.69,4H4V8.69L0.69,12L4,15.31V20H8.69L12,23.31L15.31,20H20V15.31L23.31,12L20,8.69Z + M12,18V6A6,6 0 0,1 18,12A6,6 0 0,1 12,18M20,15.31L23.31,12L20,8.69V4H15.31L12,0.69L8.69,4H4V8.69L0.69,12L4,15.31V20H8.69L12,23.31L15.31,20H20V15.31Z diff --git a/src/Ursa.Themes.Semi/Themes/Shared/TimeBox.axaml b/src/Ursa.Themes.Semi/Themes/Shared/TimeBox.axaml new file mode 100644 index 00000000..fa6e5d9c --- /dev/null +++ b/src/Ursa.Themes.Semi/Themes/Shared/TimeBox.axaml @@ -0,0 +1,8 @@ + + + 32 + 24 + 40 + 1 + 3 + diff --git a/src/Ursa.Themes.Semi/Themes/Shared/_index.axaml b/src/Ursa.Themes.Semi/Themes/Shared/_index.axaml index 5e434778..a09a2aac 100644 --- a/src/Ursa.Themes.Semi/Themes/Shared/_index.axaml +++ b/src/Ursa.Themes.Semi/Themes/Shared/_index.axaml @@ -1,9 +1,10 @@ - + + @@ -13,9 +14,12 @@ + + + - + \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Ursa.Themes.Semi.csproj b/src/Ursa.Themes.Semi/Ursa.Themes.Semi.csproj index 03102613..3b663c62 100644 --- a/src/Ursa.Themes.Semi/Ursa.Themes.Semi.csproj +++ b/src/Ursa.Themes.Semi/Ursa.Themes.Semi.csproj @@ -1,27 +1,34 @@ - + netstandard2.0 enable enable latest - 0.3.0-beta20240226 + 0.3.0-beta20240708 IRIHI Technology Co., Ltd. Irihi.Ursa.Themes.Semi + irihi.png + MIT + https://github.com/irihitech/Ursa.Avalonia - + - + - + + + + + diff --git a/src/Ursa.Themes.Semi/irihi.png b/src/Ursa.Themes.Semi/irihi.png new file mode 100644 index 00000000..01c68d91 Binary files /dev/null and b/src/Ursa.Themes.Semi/irihi.png differ diff --git a/src/Ursa/Controls/Avatar/Avatar.cs b/src/Ursa/Controls/Avatar/Avatar.cs new file mode 100644 index 00000000..a3d134cb --- /dev/null +++ b/src/Ursa/Controls/Avatar/Avatar.cs @@ -0,0 +1,26 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Media; + +namespace Ursa.Controls; + +public class Avatar : Button +{ + public static readonly StyledProperty SourceProperty = AvaloniaProperty.Register( + nameof(Source)); + + public static readonly StyledProperty HoverMaskProperty = AvaloniaProperty.Register( + nameof(HoverMask)); + + public IImage? Source + { + get => GetValue(SourceProperty); + set => SetValue(SourceProperty, value); + } + + public object? HoverMask + { + get => GetValue(HoverMaskProperty); + set => SetValue(HoverMaskProperty, value); + } +} \ No newline at end of file diff --git a/src/Ursa/Controls/Banner.cs b/src/Ursa/Controls/Banner/Banner.cs similarity index 89% rename from src/Ursa/Controls/Banner.cs rename to src/Ursa/Controls/Banner/Banner.cs index 2049e129..abdf373d 100644 --- a/src/Ursa/Controls/Banner.cs +++ b/src/Ursa/Controls/Banner/Banner.cs @@ -6,6 +6,7 @@ using Avalonia.Controls.Templates; using Avalonia.Interactivity; using Avalonia.Metadata; +using Irihi.Avalonia.Shared.Helpers; namespace Ursa.Controls; @@ -57,16 +58,9 @@ public NotificationType Type protected override void OnApplyTemplate(TemplateAppliedEventArgs e) { base.OnApplyTemplate(e); - if (_closeButton != null) - { - _closeButton.Click -= OnCloseClick; - } + Button.ClickEvent.RemoveHandler(OnCloseClick, _closeButton); _closeButton = e.NameScope.Find