Compare commits

...

21 Commits

Author SHA1 Message Date
Zhang Dian
d42c8cce78 misc: version notes. 2024-09-13 21:45:45 +08:00
Zhang Dian
ffe1188e15 misc: bump version. 2024-09-13 21:38:47 +08:00
Dong Bin
0974bbd580 Merge pull request #431 from irihitech/notification
fix Notification issues
2024-09-11 21:58:22 +08:00
Zhang Dian
42f69e2585 misc: replace the missing resources. 2024-09-11 19:27:46 +08:00
Zhang Dian
b0b06b4edc fix: fix Notification BoxShadows & MinWidth. 2024-09-11 12:22:20 +08:00
Zhang Dian
16e8c475a1 Merge pull request #429 from irihitech/docs
docs: Update installation guide.
2024-09-10 12:03:21 +08:00
Dong Bin
0ba0e10129 Merge pull request #428 from LUJIAN2020/main
Fixed DataGridRow with selected color not obvious in the Light theme
2024-09-10 09:32:07 +08:00
rabbitism
62e1e31e18 docs: Update installation guide. 2024-09-10 00:10:20 +08:00
LUJIAN2020
5e51de6db9 Fixed DataGridRow with selected color not obvious in the Light theme 2024-09-09 16:22:16 +08:00
Zhang Dian
21b61fad22 fix: fix win64-aot CLI path. 2024-09-03 11:44:30 +08:00
Zhang Dian
f8778f76e5 fix: fix aot comment for action CLI. 2024-09-02 20:37:40 +08:00
Zhang Dian
0f88c9d28d feat: separate pack & publish action. 2024-09-02 18:04:36 +08:00
Zhang Dian
f2bb8d848a misc: bump version. 2024-08-30 17:27:34 +08:00
Darth-Lexx
c3257d97fa Rul Locale update 2024-08-30 16:59:54 +08:00
Dong Bin
b9a1b2c81e Merge pull request #425 from irihitech/issue/194
remove DropDown List padding
2024-08-30 16:46:06 +08:00
rabbitism
52a25d8441 feat: set corners for scrollviewer. 2024-08-30 16:06:26 +08:00
Zhang Dian
4bd73119ac fix: remove MenuFlyoutPadding. 2024-08-30 16:00:58 +08:00
Dong Bin
210b74aef6 Merge pull request #424 from irihitech/NonErrorTextBox
Unify NonErrorTextBox styles with default TextBox styles
2024-08-29 18:20:49 +08:00
Zhang Dian
d27acf269e feat: update NonErrorTextBox. 2024-08-29 16:14:49 +08:00
Dong Bin
40d7fbcf7f Merge pull request #423 from irihitech/issue/422
Add ManagedFileChooserOverwritePrompt Styles
2024-08-27 12:20:17 +08:00
Zhang Dian
e4c21aefc6 fix: add ManagedFileChooserOverwritePrompt styles. 2024-08-26 20:16:46 +08:00
28 changed files with 453 additions and 219 deletions

View File

@@ -1,4 +1,4 @@
name: Pack name: Pack Nuget
on: on:
push: push:
@@ -7,8 +7,8 @@ on:
branches: [ "action/pack" ] branches: [ "action/pack" ]
jobs: jobs:
nuget_desktop: nuget:
runs-on: windows-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.1.1 uses: actions/checkout@v4.1.1
@@ -25,34 +25,8 @@ jobs:
- name: Nuget Semi.Avalonia.TreeDataGrid - name: Nuget Semi.Avalonia.TreeDataGrid
run: dotnet pack ./src/Semi.Avalonia.TreeDataGrid -o ./nugets run: dotnet pack ./src/Semi.Avalonia.TreeDataGrid -o ./nugets
- name: Desktop
run: dotnet publish ./demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true --self-contained true
- name: Upload a Build Artifact - name: Upload a Build Artifact
uses: actions/upload-artifact@v4.3.1 uses: actions/upload-artifact@v4.3.1
with: with:
name: nuget_desktop name: nugets
path: | path: ./nugets
./nugets
./**/publish/*.exe
android:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: CD Android
run: cd ./demo/Semi.Avalonia.Demo.Android
- name: Restore Dependencies
run: dotnet restore
- name: Build
run: dotnet publish ./demo/Semi.Avalonia.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

92
.github/workflows/publish.yml vendored Normal file
View File

@@ -0,0 +1,92 @@
name: Publish Demo
on:
push:
branches: [ "action/publish" ]
pull_request:
branches: [ "action/publish" ]
jobs:
windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Make upload directory
run: mkdir upload
- name: Publish win-x64
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/win64
- name: Zip win-x64
run: |
$files = Get-ChildItem -Path ./publish/win64/* -Recurse -Exclude *.pdb
Compress-Archive -Path $files.FullName -DestinationPath ./upload/Semi.Avalonia.Demo.Desktop.win-x64.zip
- name: Enable Native AOT in .csproj
run: |
sed -i 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
sed -i 's#<!--<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>-->#<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
- name: Publish win-x64 AOT
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release -o ./publish/win64-aot
- name: Zip win-x64 AOT
run: |
$files = Get-ChildItem -Path ./publish/win64-aot/* -Recurse -Exclude *.pdb
Compress-Archive -Path $files.FullName -DestinationPath ./upload/Semi.Avalonia.Demo.Desktop.win-x64.NativeAOT.zip
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4.3.1
with:
name: windows
path: ./upload
linux:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Make upload directory
run: mkdir upload
- name: Publish linux-x64
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r linux-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/linux64
- name: Zip linux-x64
run: zip -j -r ./upload/Semi.Avalonia.Demo.Desktop.linux-x64.zip ./publish/linux64 -x "*.pdb"
- name: Publish linux-x64 DRM
run: dotnet publish demo/Semi.Avalonia.Demo.Drm -r linux-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/drm
- name: Zip linux-x64 DRM
run: zip -j -r ./upload/Semi.Avalonia.Demo.Drm.linux-x64.zip ./publish/drm -x "*.pdb"
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4.3.1
with:
name: linux
path: ./upload
android:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: CD Android
run: cd ./demo/Semi.Avalonia.Demo.Android
- name: Restore Dependencies
run: dotnet restore
- name: Publish Android
run: dotnet publish demo/Semi.Avalonia.Demo.Android -c Release -f net8.0-android --no-restore -o ./publish
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4.3.1
with:
name: android
path: ./publish/*Signed.apk

View File

@@ -26,11 +26,13 @@ dotnet add package Semi.Avalonia
Include Semi Design Styles in application: Include Semi Design Styles in application:
```xaml ```xaml
<Application.Styles> <Application
<!-- You can still reference in old way. --> ...
<!-- <StyleInclude Source="avares://Semi.Avalonia/Themes/Index.axaml" /> --> xmlns:semi="https://irihi.tech/semi">
<semi:SemiTheme Locale="zh-cn" /> <Application.Styles>
</Application.Styles> <semi:SemiTheme Locale="zh-CN" />
</Application.Styles>
</Application>
``` ```
That's all. That's all.

View File

@@ -26,11 +26,13 @@ dotnet add package Semi.Avalonia
在样式中引用 Semi 主题: 在样式中引用 Semi 主题:
```xaml ```xaml
<Application.Styles> <Application
<!-- 您仍然可以使用旧版方式引用 --> ...
<!-- <StyleInclude Source="avares://Semi.Avalonia/Themes/Index.axaml" /> --> xmlns:semi="https://irihi.tech/semi">
<semi:SemiTheme Locale="zh-cn" /> <Application.Styles>
</Application.Styles> <semi:SemiTheme Locale="zh-CN" />
</Application.Styles>
</Application>
``` ```
这样就可以了。 这样就可以了。

View File

@@ -5,10 +5,8 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport> <BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<!-- Uncomment below to enable Native AOT compilation--> <!-- Uncomment below to enable Native AOT compilation-->
<!-- <!--<PublishAot>true</PublishAot>-->
<PublishAot>true</PublishAot> <!--<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>-->
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
-->
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))"> <PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">

View File

@@ -5,10 +5,8 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport> <BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<!-- Uncomment below to enable Native AOT compilation--> <!-- Uncomment below to enable Native AOT compilation-->
<!-- <!--<PublishAot>true</PublishAot>-->
<PublishAot>true</PublishAot> <!--<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>-->
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
-->
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))"> <PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">

View File

@@ -13,8 +13,8 @@
<Setter Property="HorizontalAlignment" Value="Stretch" /> <Setter Property="HorizontalAlignment" Value="Stretch" />
</Style> </Style>
</StackPanel.Styles> </StackPanel.Styles>
<Button Name="openFileDialog">Open File</Button> <Button Name="OpenFileButton" Content="Open File" />
<Button Name="selectFolderDialog">Select Folder</Button> <Button Name="SelectFolderButton" Content="Select Folder" />
<Button Name="saveFileDialog">Save File</Button> <Button Name="SaveFileButton" Content="Save File" />
</StackPanel> </StackPanel>
</UserControl> </UserControl>

View File

@@ -1,10 +1,6 @@
using System;
using System.Collections.Generic; using System.Collections.Generic;
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Dialogs;
using Avalonia.Interactivity; using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using Avalonia.Platform.Storage; using Avalonia.Platform.Storage;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;
@@ -14,14 +10,14 @@ public partial class ManagedFileChooserDemo : UserControl
public ManagedFileChooserDemo() public ManagedFileChooserDemo()
{ {
InitializeComponent(); InitializeComponent();
openFileDialog.Click += OpenFileDialog; OpenFileButton.Click += OpenFileDialog;
selectFolderDialog.Click += SelectFolderDialog; SelectFolderButton.Click += SelectFolderDialog;
saveFileDialog.Click += SaveFileDialog; SaveFileButton.Click += SaveFileDialog;
} }
private async void OpenFileDialog(object sender, RoutedEventArgs args) private async void OpenFileDialog(object? sender, RoutedEventArgs args)
{ {
IStorageProvider? sp = GetStorageProvider(); var sp = GetStorageProvider();
if (sp is null) return; if (sp is null) return;
var result = await sp.OpenFilePickerAsync(new FilePickerOpenOptions() var result = await sp.OpenFilePickerAsync(new FilePickerOpenOptions()
{ {
@@ -30,9 +26,10 @@ public partial class ManagedFileChooserDemo : UserControl
AllowMultiple = true, AllowMultiple = true,
}); });
} }
private async void SelectFolderDialog(object sender, RoutedEventArgs args)
private async void SelectFolderDialog(object? sender, RoutedEventArgs args)
{ {
IStorageProvider? sp = GetStorageProvider(); var sp = GetStorageProvider();
if (sp is null) return; if (sp is null) return;
var result = await sp.OpenFolderPickerAsync(new FolderPickerOpenOptions() var result = await sp.OpenFolderPickerAsync(new FolderPickerOpenOptions()
{ {
@@ -40,16 +37,17 @@ public partial class ManagedFileChooserDemo : UserControl
AllowMultiple = true, AllowMultiple = true,
}); });
} }
private async void SaveFileDialog(object sender, RoutedEventArgs args)
private async void SaveFileDialog(object? sender, RoutedEventArgs args)
{ {
IStorageProvider? sp = GetStorageProvider(); var sp = GetStorageProvider();
if (sp is null) return; if (sp is null) return;
var result = await sp.SaveFilePickerAsync(new FilePickerSaveOptions() var result = await sp.SaveFilePickerAsync(new FilePickerSaveOptions()
{ {
Title = "Open File", Title = "Save File",
}); });
} }
private IStorageProvider? GetStorageProvider() private IStorageProvider? GetStorageProvider()
{ {
var topLevel = TopLevel.GetTopLevel(this); var topLevel = TopLevel.GetTopLevel(this);
@@ -58,10 +56,10 @@ public partial class ManagedFileChooserDemo : UserControl
List<FilePickerFileType>? GetFileTypes() List<FilePickerFileType>? GetFileTypes()
{ {
return new List<FilePickerFileType> return
{ [
FilePickerFileTypes.All, FilePickerFileTypes.All,
FilePickerFileTypes.TextPlain FilePickerFileTypes.TextPlain
}; ];
} }
} }

View File

@@ -8,7 +8,7 @@
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d">
<StackPanel Spacing="20"> <StackPanel Spacing="20">
<UniformGrid Rows="3" Columns="3" Width="500" HorizontalAlignment="Left"> <UniformGrid Rows="2" Columns="3" Width="500" HorizontalAlignment="Left">
<UniformGrid.Styles> <UniformGrid.Styles>
<Style Selector="RadioButton"> <Style Selector="RadioButton">
<Setter Property="Theme" Value="{DynamicResource PureCardRadioButton}" /> <Setter Property="Theme" Value="{DynamicResource PureCardRadioButton}" />

View File

@@ -3,7 +3,7 @@
<TargetFrameworks>net6.0;net8.0;netstandard2.0</TargetFrameworks> <TargetFrameworks>net6.0;net8.0;netstandard2.0</TargetFrameworks>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<Version>11.1.0.2</Version> <Version>11.1.0.4</Version>
<Authors>IRIHI Technology Co., Ltd.</Authors> <Authors>IRIHI Technology Co., Ltd.</Authors>
<Description>Avalonia Theme inspired by Semi Design.</Description> <Description>Avalonia Theme inspired by Semi Design.</Description>
<RepositoryUrl>https://github.com/irihitech/Semi.Avalonia</RepositoryUrl> <RepositoryUrl>https://github.com/irihitech/Semi.Avalonia</RepositoryUrl>

View File

@@ -4,7 +4,7 @@
<PropertyGroup> <PropertyGroup>
<Title>Semi.Avalonia.ColorPicker</Title> <Title>Semi.Avalonia.ColorPicker</Title>
<PackageReleaseNotes>Update to Avalonia 11.1.0.2</PackageReleaseNotes> <PackageReleaseNotes>Update to Avalonia 11.1.0.4</PackageReleaseNotes>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))"> <PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">

View File

@@ -18,8 +18,8 @@
<SolidColorBrush x:Key="DataGridDetailsPresenterBackground" Color="Transparent" /> <SolidColorBrush x:Key="DataGridDetailsPresenterBackground" Color="Transparent" />
<SolidColorBrush x:Key="DataGridRowPointeroverBackground" Opacity="0.09" Color="#2E3238" /> <SolidColorBrush x:Key="DataGridRowPointeroverBackground" Opacity="0.09" Color="#2E3238" />
<SolidColorBrush x:Key="DataGridRowSelectedBackground" Opacity="0.2" Color="#EAF5FF" /> <SolidColorBrush x:Key="DataGridRowSelectedBackground" Color="#EAF5FF" />
<SolidColorBrush x:Key="DataGridRowSelectedPointeroverBackground" Opacity="0.3" Color="#CBE7FE" /> <SolidColorBrush x:Key="DataGridRowSelectedPointeroverBackground" Color="#CBE7FE" />
<SolidColorBrush x:Key="DataGridRowGroupHeaderExpandIconForeground" Opacity="0.62" Color="#1C1F23" /> <SolidColorBrush x:Key="DataGridRowGroupHeaderExpandIconForeground" Opacity="0.62" Color="#1C1F23" />
<SolidColorBrush x:Key="DataGridRowGroupHeaderBackground" Opacity="0.05" Color="#2E3238" /> <SolidColorBrush x:Key="DataGridRowGroupHeaderBackground" Opacity="0.05" Color="#2E3238" />

View File

@@ -4,7 +4,7 @@
<PropertyGroup> <PropertyGroup>
<Title>Semi.Avalonia.DataGrid</Title> <Title>Semi.Avalonia.DataGrid</Title>
<PackageReleaseNotes>Update to Avalonia 11.1.0.2</PackageReleaseNotes> <PackageReleaseNotes>Update to Avalonia 11.1.0.4</PackageReleaseNotes>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))"> <PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">

View File

@@ -26,7 +26,7 @@
BorderThickness="{TemplateBinding BorderThickness}" BorderThickness="{TemplateBinding BorderThickness}"
BoxShadow="{DynamicResource MenuFlyoutBorderBoxShadow}" BoxShadow="{DynamicResource MenuFlyoutBorderBoxShadow}"
CornerRadius="{TemplateBinding CornerRadius}"> CornerRadius="{TemplateBinding CornerRadius}">
<ScrollViewer Theme="{DynamicResource MenuScrollViewer}"> <ScrollViewer Theme="{DynamicResource MenuScrollViewer}" CornerRadius="{TemplateBinding CornerRadius}">
<ItemsPresenter <ItemsPresenter
Name="PART_ItemsPresenter" Name="PART_ItemsPresenter"
Grid.IsSharedSizeScope="True" Grid.IsSharedSizeScope="True"

View File

@@ -4,6 +4,7 @@
xmlns:converters="using:Semi.Avalonia.Converters" xmlns:converters="using:Semi.Avalonia.Converters"
xmlns:dialogs="clr-namespace:Avalonia.Dialogs;assembly=Avalonia.Dialogs" xmlns:dialogs="clr-namespace:Avalonia.Dialogs;assembly=Avalonia.Dialogs"
xmlns:internal="clr-namespace:Avalonia.Dialogs.Internal;assembly=Avalonia.Dialogs" xmlns:internal="clr-namespace:Avalonia.Dialogs.Internal;assembly=Avalonia.Dialogs"
xmlns:cvt="using:Avalonia.Controls.Converters"
x:CompileBindings="True"> x:CompileBindings="True">
<!-- Add Resources Here --> <!-- Add Resources Here -->
<Design.PreviewWith> <Design.PreviewWith>
@@ -194,4 +195,46 @@
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
</ControlTheme> </ControlTheme>
<ControlTheme x:Key="{x:Type dialogs:ManagedFileChooserOverwritePrompt}"
TargetType="dialogs:ManagedFileChooserOverwritePrompt">
<Setter Property="MaxWidth" Value="400" />
<Setter Property="Padding" Value="10"/>
<Setter Property="Template">
<ControlTemplate>
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
Padding="{TemplateBinding Padding}">
<StackPanel Spacing="10">
<TextBlock TextWrapping="Wrap">
<TextBlock.Text>
<MultiBinding>
<MultiBinding.Converter>
<cvt:StringFormatConverter />
</MultiBinding.Converter>
<DynamicResource ResourceKey="STRING_CHOOSER_PROMPT_FILE_ALREADY_EXISTS" />
<TemplateBinding Property="FileName" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
<StackPanel HorizontalAlignment="Right"
Spacing="10"
Orientation="Horizontal">
<Button Theme="{StaticResource SolidButton}"
Content="{DynamicResource STRING_CHOOSER_DIALOG_OK}"
HorizontalContentAlignment="Center"
IsDefault="True"
Command="{Binding Confirm, RelativeSource={RelativeSource TemplatedParent}}" />
<Button Content="{DynamicResource STRING_CHOOSER_DIALOG_CANCEL}"
IsCancel="True"
HorizontalContentAlignment="Center"
Command="{Binding Cancel, RelativeSource={RelativeSource TemplatedParent}}" />
</StackPanel>
</StackPanel>
</Border>
</ControlTemplate>
</Setter>
</ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -10,73 +10,83 @@
<Setter Property="Background" Value="Transparent" /> <Setter Property="Background" Value="Transparent" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="ScrollViewer"> <ControlTemplate TargetType="ScrollViewer">
<DockPanel> <Border
<DockPanel.Styles> ClipToBounds="True"
<Style Selector="RepeatButton:pressed"> CornerRadius="{TemplateBinding CornerRadius}">
<Setter Property="RenderTransform" Value="{x:Null}" /> <DockPanel>
</Style> <DockPanel.Styles>
</DockPanel.Styles> <Style Selector="RepeatButton:pressed">
<RepeatButton <Setter Property="RenderTransform" Value="{x:Null}" />
HorizontalAlignment="Stretch" </Style>
HorizontalContentAlignment="Center" </DockPanel.Styles>
Background="Transparent" <RepeatButton
BorderThickness="0" HorizontalAlignment="Stretch"
Command="{Binding LineUp, RelativeSource={RelativeSource TemplatedParent}}" HorizontalContentAlignment="Center"
CornerRadius="0" Background="Transparent"
DockPanel.Dock="Top" BorderThickness="0"
RenderTransform="{x:Null}"> Command="{Binding LineUp, RelativeSource={RelativeSource TemplatedParent}}"
<RepeatButton.IsVisible> CornerRadius="0"
<MultiBinding Converter="{x:Static converters:MenuScrollingVisibilityConverter.Instance}" ConverterParameter="0"> DockPanel.Dock="Top"
<Binding Path="VerticalScrollBarVisibility" RelativeSource="{RelativeSource TemplatedParent}" /> RenderTransform="{x:Null}">
<Binding Path="Offset.Y" RelativeSource="{RelativeSource TemplatedParent}" /> <RepeatButton.IsVisible>
<Binding Path="Extent.Height" RelativeSource="{RelativeSource TemplatedParent}" /> <MultiBinding
<Binding Path="Viewport.Height" RelativeSource="{RelativeSource TemplatedParent}" /> Converter="{x:Static converters:MenuScrollingVisibilityConverter.Instance}"
</MultiBinding> ConverterParameter="0">
</RepeatButton.IsVisible> <Binding Path="VerticalScrollBarVisibility"
<PathIcon RelativeSource="{RelativeSource TemplatedParent}" />
Width="8" <Binding Path="Offset.Y" RelativeSource="{RelativeSource TemplatedParent}" />
Height="8" <Binding Path="Extent.Height" RelativeSource="{RelativeSource TemplatedParent}" />
Data="{DynamicResource MenuScrollViewerUpButtonGlyph}" <Binding Path="Viewport.Height" RelativeSource="{RelativeSource TemplatedParent}" />
Foreground="{DynamicResource MenuFlyoutScrollViewerIconForeground}" /> </MultiBinding>
</RepeatButton> </RepeatButton.IsVisible>
<RepeatButton <PathIcon
HorizontalAlignment="Stretch" Width="8"
HorizontalContentAlignment="Center" Height="8"
Background="Transparent" Data="{DynamicResource MenuScrollViewerUpButtonGlyph}"
BorderThickness="0" Foreground="{DynamicResource MenuFlyoutScrollViewerIconForeground}" />
Command="{Binding LineDown, RelativeSource={RelativeSource TemplatedParent}}" </RepeatButton>
CornerRadius="0" <RepeatButton
DockPanel.Dock="Bottom" HorizontalAlignment="Stretch"
RenderTransform="{x:Null}"> HorizontalContentAlignment="Center"
<RepeatButton.IsVisible> Background="Transparent"
<MultiBinding Converter="{x:Static converters:MenuScrollingVisibilityConverter.Instance}" ConverterParameter="100"> BorderThickness="0"
<Binding Path="VerticalScrollBarVisibility" RelativeSource="{RelativeSource TemplatedParent}" /> Command="{Binding LineDown, RelativeSource={RelativeSource TemplatedParent}}"
<Binding Path="Offset.Y" RelativeSource="{RelativeSource TemplatedParent}" /> CornerRadius="0"
<Binding Path="Extent.Height" RelativeSource="{RelativeSource TemplatedParent}" /> DockPanel.Dock="Bottom"
<Binding Path="Viewport.Height" RelativeSource="{RelativeSource TemplatedParent}" /> RenderTransform="{x:Null}">
</MultiBinding> <RepeatButton.IsVisible>
</RepeatButton.IsVisible> <MultiBinding
<PathIcon Converter="{x:Static converters:MenuScrollingVisibilityConverter.Instance}"
Width="8" ConverterParameter="100">
Height="8" <Binding Path="VerticalScrollBarVisibility"
Data="{DynamicResource MenuScrollViewerDownButtonGlyph}" RelativeSource="{RelativeSource TemplatedParent}" />
Foreground="{DynamicResource MenuFlyoutScrollViewerIconForeground}" /> <Binding Path="Offset.Y" RelativeSource="{RelativeSource TemplatedParent}" />
</RepeatButton> <Binding Path="Extent.Height" RelativeSource="{RelativeSource TemplatedParent}" />
<ScrollContentPresenter <Binding Path="Viewport.Height" RelativeSource="{RelativeSource TemplatedParent}" />
Name="PART_ContentPresenter" </MultiBinding>
Margin="{TemplateBinding Padding}" </RepeatButton.IsVisible>
HorizontalSnapPointsAlignment="{TemplateBinding HorizontalSnapPointsAlignment}" <PathIcon
HorizontalSnapPointsType="{TemplateBinding HorizontalSnapPointsType}" Width="8"
VerticalSnapPointsAlignment="{TemplateBinding VerticalSnapPointsAlignment}" Height="8"
VerticalSnapPointsType="{TemplateBinding VerticalSnapPointsType}"> Data="{DynamicResource MenuScrollViewerDownButtonGlyph}"
<ScrollContentPresenter.GestureRecognizers> Foreground="{DynamicResource MenuFlyoutScrollViewerIconForeground}" />
<ScrollGestureRecognizer </RepeatButton>
CanHorizontallyScroll="{Binding CanHorizontallyScroll, ElementName=PART_ContentPresenter}" <ScrollContentPresenter
CanVerticallyScroll="{Binding CanVerticallyScroll, ElementName=PART_ContentPresenter}" Name="PART_ContentPresenter"
IsScrollInertiaEnabled="{Binding IsScrollInertiaEnabled, RelativeSource={RelativeSource TemplatedParent}}" /> Margin="{TemplateBinding Padding}"
</ScrollContentPresenter.GestureRecognizers> HorizontalSnapPointsAlignment="{TemplateBinding HorizontalSnapPointsAlignment}"
</ScrollContentPresenter> HorizontalSnapPointsType="{TemplateBinding HorizontalSnapPointsType}"
</DockPanel> VerticalSnapPointsAlignment="{TemplateBinding VerticalSnapPointsAlignment}"
VerticalSnapPointsType="{TemplateBinding VerticalSnapPointsType}">
<ScrollContentPresenter.GestureRecognizers>
<ScrollGestureRecognizer
CanHorizontallyScroll="{Binding CanHorizontallyScroll, ElementName=PART_ContentPresenter}"
CanVerticallyScroll="{Binding CanVerticallyScroll, ElementName=PART_ContentPresenter}"
IsScrollInertiaEnabled="{Binding IsScrollInertiaEnabled, RelativeSource={RelativeSource TemplatedParent}}" />
</ScrollContentPresenter.GestureRecognizers>
</ScrollContentPresenter>
</DockPanel>
</Border>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
</ControlTheme> </ControlTheme>
@@ -203,7 +213,7 @@
BorderThickness="{DynamicResource MenuFlyoutBorderThickness}" BorderThickness="{DynamicResource MenuFlyoutBorderThickness}"
BoxShadow="{DynamicResource MenuFlyoutBorderBoxShadow}" BoxShadow="{DynamicResource MenuFlyoutBorderBoxShadow}"
CornerRadius="{DynamicResource MenuFlyoutCornerRadius}"> CornerRadius="{DynamicResource MenuFlyoutCornerRadius}">
<ScrollViewer Theme="{StaticResource MenuScrollViewer}"> <ScrollViewer Theme="{StaticResource MenuScrollViewer}" CornerRadius="{DynamicResource MenuFlyoutCornerRadius}">
<ItemsPresenter <ItemsPresenter
Name="PART_ItemsPresenter" Name="PART_ItemsPresenter"
Grid.IsSharedSizeScope="True" Grid.IsSharedSizeScope="True"
@@ -327,7 +337,7 @@
BorderThickness="{DynamicResource MenuFlyoutBorderThickness}" BorderThickness="{DynamicResource MenuFlyoutBorderThickness}"
BoxShadow="{DynamicResource MenuFlyoutBorderBoxShadow}" BoxShadow="{DynamicResource MenuFlyoutBorderBoxShadow}"
CornerRadius="{DynamicResource MenuFlyoutCornerRadius}"> CornerRadius="{DynamicResource MenuFlyoutCornerRadius}">
<ScrollViewer Theme="{StaticResource MenuScrollViewer}"> <ScrollViewer Theme="{StaticResource MenuScrollViewer}" CornerRadius="{DynamicResource MenuFlyoutCornerRadius}">
<ItemsPresenter <ItemsPresenter
Name="PART_ItemsPresenter" Name="PART_ItemsPresenter"
Grid.IsSharedSizeScope="True" Grid.IsSharedSizeScope="True"

View File

@@ -2,7 +2,21 @@
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:CompileBindings="True"> x:CompileBindings="True">
<!-- Add Resources Here --> <Design.PreviewWith>
<ThemeVariantScope RequestedThemeVariant="Dark">
<MenuFlyoutPresenter>
<MenuFlyoutPresenter.Items>
<MenuItem Header="Menu Item 1" />
<MenuItem Header="Menu Item 2" />
<MenuItem Header="Menu Item 3" />
<MenuItem Header="Menu Item 4" />
<MenuItem Header="Menu Item 5" />
<MenuItem Header="Menu Item 6" />
</MenuFlyoutPresenter.Items>
</MenuFlyoutPresenter>
</ThemeVariantScope>
</Design.PreviewWith>
<ControlTheme x:Key="{x:Type MenuFlyoutPresenter}" TargetType="MenuFlyoutPresenter"> <ControlTheme x:Key="{x:Type MenuFlyoutPresenter}" TargetType="MenuFlyoutPresenter">
<Setter Property="MenuFlyoutPresenter.Background" Value="{DynamicResource MenuFlyoutBackground}" /> <Setter Property="MenuFlyoutPresenter.Background" Value="{DynamicResource MenuFlyoutBackground}" />
<Setter Property="MenuFlyoutPresenter.BorderBrush" Value="{DynamicResource MenuFlyoutBorderBrush}" /> <Setter Property="MenuFlyoutPresenter.BorderBrush" Value="{DynamicResource MenuFlyoutBorderBrush}" />
@@ -23,12 +37,13 @@
BorderBrush="{TemplateBinding BorderBrush}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" BorderThickness="{TemplateBinding BorderThickness}"
BoxShadow="{DynamicResource MenuFlyoutBorderBoxShadow}" BoxShadow="{DynamicResource MenuFlyoutBorderBoxShadow}"
ClipToBounds="False" ClipToBounds="True"
CornerRadius="{TemplateBinding CornerRadius}" CornerRadius="{TemplateBinding CornerRadius}"
UseLayoutRounding="False"> UseLayoutRounding="False">
<ScrollViewer <ScrollViewer
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
Theme="{StaticResource MenuScrollViewer}" Theme="{StaticResource MenuScrollViewer}"
CornerRadius="{TemplateBinding CornerRadius}"
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"> VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
<ItemsPresenter <ItemsPresenter
Name="PART_ItemsPresenter" Name="PART_ItemsPresenter"

View File

@@ -5,16 +5,17 @@
<Design.PreviewWith> <Design.PreviewWith>
<ThemeVariantScope RequestedThemeVariant="Dark"> <ThemeVariantScope RequestedThemeVariant="Dark">
<StackPanel> <StackPanel>
<NotificationCard />
<NotificationCard> <NotificationCard>
Hello, Semi.Avalonia! Hello, Semi.Avalonia!
</NotificationCard> </NotificationCard>
<NotificationCard NotificationType="Success"> <NotificationCard NotificationType="Success">
<Notification Title="Welcome" Message="Hello, Semi.Avalonia!" /> <Notification Title="Welcome" Message="Hello, Semi.Avalonia!" />
</NotificationCard> </NotificationCard>
<NotificationCard NotificationType="Warning"> <NotificationCard NotificationType="Warning" Classes="Light">
<Notification Title="" Message="Hello, Semi.Avalonia!" /> <Notification Title="Welcome" />
</NotificationCard> </NotificationCard>
<NotificationCard NotificationType="Error"> <NotificationCard NotificationType="Error" Classes="Light">
<Notification Message="Hello, Semi.Avalonia!" /> <Notification Message="Hello, Semi.Avalonia!" />
</NotificationCard> </NotificationCard>
</StackPanel> </StackPanel>
@@ -22,10 +23,7 @@
</Design.PreviewWith> </Design.PreviewWith>
<ControlTheme x:Key="{x:Type NotificationCard}" TargetType="NotificationCard"> <ControlTheme x:Key="{x:Type NotificationCard}" TargetType="NotificationCard">
<Setter Property="UseLayoutRounding" Value="True" /> <Setter Property="UseLayoutRounding" Value="True" />
<Setter Property="MinWidth" Value="{DynamicResource NotificationCardMinWidth}" />
<Setter Property="RenderTransformOrigin" Value="50%,75%" />
<Setter Property="BorderThickness" Value="{DynamicResource NotificationCardBorderThickness}" /> <Setter Property="BorderThickness" Value="{DynamicResource NotificationCardBorderThickness}" />
<Setter Property="BorderBrush" Value="{DynamicResource NotificationCardBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource NotificationCardBackground}" /> <Setter Property="Background" Value="{DynamicResource NotificationCardBackground}" />
<Setter Property="CornerRadius" Value="{DynamicResource NotificationCardCornerRadius}" /> <Setter Property="CornerRadius" Value="{DynamicResource NotificationCardCornerRadius}" />
<Setter Property="Template"> <Setter Property="Template">
@@ -38,11 +36,11 @@
<Border <Border
x:Name="PART_RootBorder" x:Name="PART_RootBorder"
Padding="{DynamicResource NotificationCardPadding}" Padding="{DynamicResource NotificationCardPadding}"
BoxShadow="{DynamicResource NotificationCardBoxShadow}" BoxShadow="{DynamicResource NotificationCardBoxShadows}"
BorderBrush="{TemplateBinding BorderBrush}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"> CornerRadius="{TemplateBinding CornerRadius}">
<DockPanel> <DockPanel MinWidth="{DynamicResource NotificationCardMinWidth}">
<PathIcon <PathIcon
Name="NotificationIcon" Name="NotificationIcon"
Width="{DynamicResource NotificationCardIconWidth}" Width="{DynamicResource NotificationCardIconWidth}"
@@ -67,6 +65,7 @@
Foreground="{DynamicResource NotificationCardMessageForeground}" Foreground="{DynamicResource NotificationCardMessageForeground}"
FontSize="{DynamicResource NotificationCardMessageFontSize}" FontSize="{DynamicResource NotificationCardMessageFontSize}"
FontWeight="{DynamicResource NotificationCardMessageFontWeight}" FontWeight="{DynamicResource NotificationCardMessageFontWeight}"
IsVisible="{Binding Message, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
Text="{Binding Message}" Text="{Binding Message}"
TextWrapping="Wrap" /> TextWrapping="Wrap" />
</StackPanel> </StackPanel>
@@ -169,22 +168,22 @@
</Style> </Style>
<Style Selector="^.Light"> <Style Selector="^.Light">
<Setter Property="Background" Value="{DynamicResource SemiColorBackground0}" /> <Setter Property="Background" Value="{DynamicResource NotificationCardLightBackground}" />
<Style Selector="^:information /template/ Border#PART_RootBorder"> <Style Selector="^:information /template/ Border#PART_RootBorder">
<Setter Property="BorderBrush" Value="{DynamicResource SemiColorInformation}" /> <Setter Property="BorderBrush" Value="{DynamicResource NotificationCardLightInformationBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource SemiColorInformationLight}" /> <Setter Property="Background" Value="{DynamicResource NotificationCardLightInformationBackground}"/>
</Style> </Style>
<Style Selector="^:success /template/ Border#PART_RootBorder"> <Style Selector="^:success /template/ Border#PART_RootBorder">
<Setter Property="BorderBrush" Value="{DynamicResource SemiColorSuccess}" /> <Setter Property="BorderBrush" Value="{DynamicResource NotificationCardLightSuccessBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource SemiColorSuccessLight}" /> <Setter Property="Background" Value="{DynamicResource NotificationCardLightSuccessBackground}" />
</Style> </Style>
<Style Selector="^:warning /template/ Border#PART_RootBorder"> <Style Selector="^:warning /template/ Border#PART_RootBorder">
<Setter Property="BorderBrush" Value="{DynamicResource SemiColorWarning}" /> <Setter Property="BorderBrush" Value="{DynamicResource NotificationCardLightWarningBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource SemiColorWarningLight}" /> <Setter Property="Background" Value="{DynamicResource NotificationCardLightWarningBackground}" />
</Style> </Style>
<Style Selector="^:error /template/ Border#PART_RootBorder"> <Style Selector="^:error /template/ Border#PART_RootBorder">
<Setter Property="BorderBrush" Value="{DynamicResource SemiColorDanger}" /> <Setter Property="BorderBrush" Value="{DynamicResource NotificationCardLightErrorBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource SemiColorDangerLight}" /> <Setter Property="Background" Value="{DynamicResource NotificationCardLightErrorBackground}" />
</Style> </Style>
</Style> </Style>
</ControlTheme> </ControlTheme>

View File

@@ -24,35 +24,6 @@
</MenuFlyout> </MenuFlyout>
<ControlTheme x:Key="{x:Type TextBox}" TargetType="TextBox"> <ControlTheme x:Key="{x:Type TextBox}" TargetType="TextBox">
<ControlTheme.Resources>
<ControlTheme x:Key="InputToggleButton" TargetType="ToggleButton">
<Setter Property="ToggleButton.Foreground" Value="{DynamicResource ButtonInputInnerForeground}" />
<Setter Property="ToggleButton.Cursor" Value="Hand" />
<Setter Property="ToggleButton.Template">
<ControlTemplate TargetType="ToggleButton">
<!-- Background must be transparent or hit test will fail -->
<Panel Background="Transparent">
<PathIcon
Width="16"
Height="16"
Data="{DynamicResource PasswordBoxRevealButtonData}"
IsVisible="{Binding $parent[ToggleButton].IsChecked, Converter={x:Static BoolConverters.Not}}" />
<PathIcon
Width="16"
Height="16"
Data="{DynamicResource PasswordBoxHideButtonData}"
IsVisible="{Binding $parent[ToggleButton].IsChecked}" />
</Panel>
</ControlTemplate>
</Setter>
<Style Selector="^:pointerover">
<Setter Property="Foreground" Value="{DynamicResource ButtonInputInnerPointeroverForeground}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Foreground" Value="{DynamicResource ButtonInputInnerPressedForeground}" />
</Style>
</ControlTheme>
</ControlTheme.Resources>
<Setter Property="TextBox.Foreground" Value="{DynamicResource TextBoxForeground}" /> <Setter Property="TextBox.Foreground" Value="{DynamicResource TextBoxForeground}" />
<Setter Property="TextBox.Background" Value="{DynamicResource TextBoxDefaultBackground}" /> <Setter Property="TextBox.Background" Value="{DynamicResource TextBoxDefaultBackground}" />
<Setter Property="TextBox.BorderBrush" Value="{DynamicResource TextBoxDefaultBorderBrush}" /> <Setter Property="TextBox.BorderBrush" Value="{DynamicResource TextBoxDefaultBorderBrush}" />
@@ -126,8 +97,7 @@
SelectionEnd="{TemplateBinding SelectionEnd}" SelectionEnd="{TemplateBinding SelectionEnd}"
SelectionForegroundBrush="{TemplateBinding SelectionForegroundBrush}" SelectionForegroundBrush="{TemplateBinding SelectionForegroundBrush}"
SelectionStart="{TemplateBinding SelectionStart}" SelectionStart="{TemplateBinding SelectionStart}"
Text="{TemplateBinding Text, Text="{TemplateBinding Text, Mode=TwoWay}"
Mode=TwoWay}"
TextAlignment="{TemplateBinding TextAlignment}" TextAlignment="{TemplateBinding TextAlignment}"
TextWrapping="{TemplateBinding TextWrapping}" /> TextWrapping="{TemplateBinding TextWrapping}" />
</Panel> </Panel>
@@ -143,8 +113,7 @@
Name="PART_RevealButton" Name="PART_RevealButton"
Grid.Column="3" Grid.Column="3"
Margin="4,0,0,0" Margin="4,0,0,0"
IsChecked="{TemplateBinding RevealPassword, IsChecked="{TemplateBinding RevealPassword, Mode=TwoWay}"
Mode=TwoWay}"
IsVisible="False" IsVisible="False"
Theme="{StaticResource InputToggleButton}" /> Theme="{StaticResource InputToggleButton}" />
<ContentPresenter <ContentPresenter
@@ -253,10 +222,10 @@
</Style> </Style>
<Style Selector="^.TextArea"> <Style Selector="^.TextArea">
<Setter Property="AcceptsReturn" Value="True"></Setter> <Setter Property="AcceptsReturn" Value="True"/>
<Setter Property="VerticalContentAlignment" Value="Top"></Setter> <Setter Property="VerticalContentAlignment" Value="Top"/>
<Setter Property="TextBox.Padding" Value="{DynamicResource TextBoxTextAreaContentPadding}"></Setter> <Setter Property="Padding" Value="{DynamicResource TextBoxTextAreaContentPadding}" />
<Setter Property="MinHeight" Value="{DynamicResource TextBoxTextAreaHeight}"></Setter> <Setter Property="MinHeight" Value="{DynamicResource TextBoxTextAreaHeight}" />
</Style> </Style>
</ControlTheme> </ControlTheme>
@@ -266,8 +235,8 @@
<Setter Property="TextBox.BorderBrush" Value="{DynamicResource TextBoxDefaultBorderBrush}" /> <Setter Property="TextBox.BorderBrush" Value="{DynamicResource TextBoxDefaultBorderBrush}" />
<Setter Property="TextBox.SelectionBrush" Value="{DynamicResource TextBoxSelectionBackground}" /> <Setter Property="TextBox.SelectionBrush" Value="{DynamicResource TextBoxSelectionBackground}" />
<Setter Property="TextBox.SelectionForegroundBrush" Value="{DynamicResource TextBoxSelectionForeground}" /> <Setter Property="TextBox.SelectionForegroundBrush" Value="{DynamicResource TextBoxSelectionForeground}" />
<Setter Property="TextBox.BackgroundSizing" Value="OuterBorderEdge" />
<Setter Property="TextBox.BorderThickness" Value="{DynamicResource TextBoxBorderThickness}" /> <Setter Property="TextBox.BorderThickness" Value="{DynamicResource TextBoxBorderThickness}" />
<Setter Property="TextBox.BackgroundSizing" Value="OuterBorderEdge" />
<Setter Property="TextBox.CornerRadius" Value="{DynamicResource TextBoxDefaultCornerRadius}" /> <Setter Property="TextBox.CornerRadius" Value="{DynamicResource TextBoxDefaultCornerRadius}" />
<Setter Property="TextBox.FontSize" Value="14" /> <Setter Property="TextBox.FontSize" Value="14" />
<Setter Property="TextBox.Cursor" Value="Ibeam" /> <Setter Property="TextBox.Cursor" Value="Ibeam" />
@@ -290,7 +259,7 @@
BorderBrush="{TemplateBinding BorderBrush}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"> CornerRadius="{TemplateBinding CornerRadius}">
<Grid Margin="{TemplateBinding Padding}" ColumnDefinitions="Auto, *, Auto"> <Grid Margin="{TemplateBinding Padding}" ColumnDefinitions="Auto,*,Auto, Auto, Auto">
<ContentPresenter <ContentPresenter
Grid.Column="0" Grid.Column="0"
Padding="{DynamicResource TextBoxInnerLeftContentPadding}" Padding="{DynamicResource TextBoxInnerLeftContentPadding}"
@@ -309,17 +278,22 @@
Name="PART_Watermark" Name="PART_Watermark"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
IsVisible="{TemplateBinding Text,
Converter={x:Static StringConverters.IsNullOrEmpty}}"
Opacity="0.5" Opacity="0.5"
Text="{TemplateBinding Watermark}" Text="{TemplateBinding Watermark}"
TextAlignment="{TemplateBinding TextAlignment}" TextAlignment="{TemplateBinding TextAlignment}"
TextWrapping="{TemplateBinding TextWrapping}" /> TextWrapping="{TemplateBinding TextWrapping}">
<TextBlock.IsVisible>
<MultiBinding Converter="{x:Static BoolConverters.And}">
<Binding ElementName="PART_TextPresenter" Path="PreeditText" Converter="{x:Static StringConverters.IsNullOrEmpty}"/>
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Text" Converter="{x:Static StringConverters.IsNullOrEmpty}"/>
</MultiBinding>
</TextBlock.IsVisible>
</TextBlock>
<TextPresenter <TextPresenter
Name="PART_TextPresenter" Name="PART_TextPresenter"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
CaretBlinkInterval="{TemplateBinding CaretBlinkInterval}" CaretBlinkInterval="{TemplateBinding CaretBlinkInterval}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
CaretBrush="{TemplateBinding CaretBrush}" CaretBrush="{TemplateBinding CaretBrush}"
CaretIndex="{TemplateBinding CaretIndex}" CaretIndex="{TemplateBinding CaretIndex}"
LineHeight="{TemplateBinding LineHeight}" LineHeight="{TemplateBinding LineHeight}"
@@ -329,14 +303,27 @@
SelectionEnd="{TemplateBinding SelectionEnd}" SelectionEnd="{TemplateBinding SelectionEnd}"
SelectionForegroundBrush="{TemplateBinding SelectionForegroundBrush}" SelectionForegroundBrush="{TemplateBinding SelectionForegroundBrush}"
SelectionStart="{TemplateBinding SelectionStart}" SelectionStart="{TemplateBinding SelectionStart}"
Text="{TemplateBinding Text, Text="{TemplateBinding Text, Mode=TwoWay}"
Mode=TwoWay}"
TextAlignment="{TemplateBinding TextAlignment}" TextAlignment="{TemplateBinding TextAlignment}"
TextWrapping="{TemplateBinding TextWrapping}" /> TextWrapping="{TemplateBinding TextWrapping}" />
</Panel> </Panel>
</ScrollViewer> </ScrollViewer>
<ContentPresenter <Button
Name="PART_ClearButton"
Grid.Column="2" Grid.Column="2"
Command="{Binding $parent[TextBox].Clear}"
Content="{DynamicResource IconButtonClearData}"
IsVisible="False"
Theme="{StaticResource InnerIconButton}" />
<ToggleButton
Name="PART_RevealButton"
Grid.Column="3"
Margin="4,0,0,0"
IsChecked="{TemplateBinding RevealPassword, Mode=TwoWay}"
IsVisible="False"
Theme="{StaticResource InputToggleButton}" />
<ContentPresenter
Grid.Column="4"
Padding="{DynamicResource TextBoxInnerRightContentPadding}" Padding="{DynamicResource TextBoxInnerRightContentPadding}"
VerticalAlignment="Center" VerticalAlignment="Center"
Content="{TemplateBinding InnerRightContent}" Content="{TemplateBinding InnerRightContent}"
@@ -383,6 +370,69 @@
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsSelectedBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsSelectedBorderBrush}" />
</Style> </Style>
</Style> </Style>
<Style Selector="^.clearButton, ^.ClearButton">
<Style Selector="^[AcceptsReturn=False][IsReadOnly=False]:focus:not(:empty) /template/ Button#PART_ClearButton">
<Setter Property="IsVisible" Value="True" />
</Style>
<Style Selector="^[AcceptsReturn=False][IsReadOnly=False]:pointerover:not(:empty) /template/ Button#PART_ClearButton">
<Setter Property="IsVisible" Value="True" />
</Style>
</Style>
<Style Selector="^.revealPasswordButton, ^.RevealPasswordButton">
<Style Selector="^ /template/ ToggleButton#PART_RevealButton">
<Setter Property="IsVisible" Value="True" />
</Style>
</Style>
<Style Selector="^.Large">
<Setter Property="MinHeight" Value="{DynamicResource TextBoxLargeHeight}" />
</Style>
<Style Selector="^.Small">
<Setter Property="MinHeight" Value="{DynamicResource TextBoxSmallHeight}" />
</Style>
<Style Selector="^.Bordered">
<Setter Property="Background" Value="{DynamicResource TextBoxBorderedDefaultBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource TextBoxBorderedDefaultBorderBrush}" />
<Style Selector="^:pointerover /template/ Border#PART_ContentPresenterBorder">
<Setter Property="Background" Value="{DynamicResource TextBoxBorderedPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource TextBoxBorderedPointeroverBorderBrush}" />
</Style>
<Style Selector="^:focus">
<Setter Property="Background" Value="{DynamicResource TextBoxBorderedPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource TextBoxBorderedPointeroverBorderBrush}" />
</Style>
<Style Selector="^:disabled /template/ Border#PART_ContentPresenterBorder">
<Setter Property="TextBox.Background" Value="{DynamicResource TextBoxDisabledBackground}" />
<Setter Property="TextBox.BorderBrush" Value="{DynamicResource TextBoxDisabledBorderBrush}" />
</Style>
<Style Selector="^:error">
<Style Selector="^ /template/ Border#PART_ContentPresenterBorder">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsBorderBrush}" />
</Style>
<Style Selector="^:pointerover /template/ Border#PART_ContentPresenterBorder">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsPointerOverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsPointerOverBorderBrush}" />
</Style>
<Style Selector="^:pressed /template/ Border#PART_ContentPresenterBorder">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsPressedBorderBrush}" />
</Style>
<Style Selector="^:focus /template/ Border#PART_ContentPresenterBorder">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsSelectedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsSelectedBorderBrush}" />
</Style>
</Style>
</Style>
<Style Selector="^.TextArea">
<Setter Property="AcceptsReturn" Value="True"/>
<Setter Property="VerticalContentAlignment" Value="Top"/>
<Setter Property="Padding" Value="{DynamicResource TextBoxTextAreaContentPadding}" />
<Setter Property="MinHeight" Value="{DynamicResource TextBoxTextAreaHeight}" />
</Style>
</ControlTheme> </ControlTheme>
<ControlTheme x:Key="LooklessTextBox" TargetType="TextBox"> <ControlTheme x:Key="LooklessTextBox" TargetType="TextBox">
@@ -460,4 +510,32 @@
</Style> </Style>
</ControlTheme> </ControlTheme>
<ControlTheme x:Key="InputToggleButton" TargetType="ToggleButton">
<Setter Property="ToggleButton.Foreground" Value="{DynamicResource ButtonInputInnerForeground}" />
<Setter Property="ToggleButton.Cursor" Value="Hand" />
<Setter Property="ToggleButton.Template">
<ControlTemplate TargetType="ToggleButton">
<!-- Background must be transparent or hit test will fail -->
<Panel Background="Transparent">
<PathIcon
Width="16"
Height="16"
Data="{DynamicResource PasswordBoxRevealButtonData}"
IsVisible="{Binding $parent[ToggleButton].IsChecked, Converter={x:Static BoolConverters.Not}}" />
<PathIcon
Width="16"
Height="16"
Data="{DynamicResource PasswordBoxHideButtonData}"
IsVisible="{Binding $parent[ToggleButton].IsChecked}" />
</Panel>
</ControlTemplate>
</Setter>
<Style Selector="^:pointerover">
<Setter Property="Foreground" Value="{DynamicResource ButtonInputInnerPointeroverForeground}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Foreground" Value="{DynamicResource ButtonInputInnerPressedForeground}" />
</Style>
</ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -21,4 +21,5 @@
<x:String x:Key="STRING_CHOOSER_DATEMODIFIED_COLUMN">Date Modified</x:String> <x:String x:Key="STRING_CHOOSER_DATEMODIFIED_COLUMN">Date Modified</x:String>
<x:String x:Key="STRING_CHOOSER_TYPE_COLUMN">Type</x:String> <x:String x:Key="STRING_CHOOSER_TYPE_COLUMN">Type</x:String>
<x:String x:Key="STRING_CHOOSER_SIZE_COLUMN">Size</x:String> <x:String x:Key="STRING_CHOOSER_SIZE_COLUMN">Size</x:String>
<x:String x:Key="STRING_CHOOSER_PROMPT_FILE_ALREADY_EXISTS">{0} already exists. Do you want to replace it?</x:String>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -21,4 +21,5 @@
<x:String x:Key="STRING_CHOOSER_DATEMODIFIED_COLUMN">更新日時</x:String> <x:String x:Key="STRING_CHOOSER_DATEMODIFIED_COLUMN">更新日時</x:String>
<x:String x:Key="STRING_CHOOSER_TYPE_COLUMN">種類</x:String> <x:String x:Key="STRING_CHOOSER_TYPE_COLUMN">種類</x:String>
<x:String x:Key="STRING_CHOOSER_SIZE_COLUMN">サイズ</x:String> <x:String x:Key="STRING_CHOOSER_SIZE_COLUMN">サイズ</x:String>
<x:String x:Key="STRING_CHOOSER_PROMPT_FILE_ALREADY_EXISTS">{0} はすでに存在します。置き換えますか?</x:String>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -8,7 +8,8 @@
<!-- TimePicker --> <!-- TimePicker -->
<x:String x:Key="STRING_TIMEPICKER_HOUR_TEXT">часы</x:String> <x:String x:Key="STRING_TIMEPICKER_HOUR_TEXT">часы</x:String>
<x:String x:Key="STRING_TIMEPICKER_MINUTE_TEXT">минуты</x:String> <x:String x:Key="STRING_TIMEPICKER_MINUTE_TEXT">минуты</x:String>
<!-- TextBox/SelectableTextBox flyout --> <x:String x:Key="STRING_TIMEPICKER_SECOND_TEXT">секунды</x:String>
<!-- TextBox/SelectableTextBox flyout -->
<x:String x:Key="STRING_MENU_CUT">Вырезать</x:String> <x:String x:Key="STRING_MENU_CUT">Вырезать</x:String>
<x:String x:Key="STRING_MENU_COPY">Копировать</x:String> <x:String x:Key="STRING_MENU_COPY">Копировать</x:String>
<x:String x:Key="STRING_MENU_PASTE">Вставить</x:String> <x:String x:Key="STRING_MENU_PASTE">Вставить</x:String>
@@ -16,9 +17,10 @@
<x:String x:Key="STRING_CHOOSER_FILE_NAME">Имя файла</x:String> <x:String x:Key="STRING_CHOOSER_FILE_NAME">Имя файла</x:String>
<x:String x:Key="STRING_CHOOSER_SHOW_HIDDEN_FILES">Показать скрытые файлы</x:String> <x:String x:Key="STRING_CHOOSER_SHOW_HIDDEN_FILES">Показать скрытые файлы</x:String>
<x:String x:Key="STRING_CHOOSER_DIALOG_OK">OK</x:String> <x:String x:Key="STRING_CHOOSER_DIALOG_OK">OK</x:String>
<x:String x:Key="STRING_CHOOSER_DIALOG_CANCEL">Cancel</x:String> <x:String x:Key="STRING_CHOOSER_DIALOG_CANCEL">Отмена</x:String>
<x:String x:Key="STRING_CHOOSER_NAME_COLUMN">Имя</x:String> <x:String x:Key="STRING_CHOOSER_NAME_COLUMN">Имя</x:String>
<x:String x:Key="STRING_CHOOSER_DATEMODIFIED_COLUMN">Дата изменения</x:String> <x:String x:Key="STRING_CHOOSER_DATEMODIFIED_COLUMN">Дата изменения</x:String>
<x:String x:Key="STRING_CHOOSER_TYPE_COLUMN">Тип</x:String> <x:String x:Key="STRING_CHOOSER_TYPE_COLUMN">Тип</x:String>
<x:String x:Key="STRING_CHOOSER_SIZE_COLUMN">Размер</x:String> <x:String x:Key="STRING_CHOOSER_SIZE_COLUMN">Размер</x:String>
<x:String x:Key="STRING_CHOOSER_PROMPT_FILE_ALREADY_EXISTS">{0} уже существует. Вы хотите заменить его?</x:String>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -21,4 +21,5 @@
<x:String x:Key="STRING_CHOOSER_DATEMODIFIED_COLUMN">修改日期</x:String> <x:String x:Key="STRING_CHOOSER_DATEMODIFIED_COLUMN">修改日期</x:String>
<x:String x:Key="STRING_CHOOSER_TYPE_COLUMN">类型</x:String> <x:String x:Key="STRING_CHOOSER_TYPE_COLUMN">类型</x:String>
<x:String x:Key="STRING_CHOOSER_SIZE_COLUMN">大小</x:String> <x:String x:Key="STRING_CHOOSER_SIZE_COLUMN">大小</x:String>
<x:String x:Key="STRING_CHOOSER_PROMPT_FILE_ALREADY_EXISTS">{0} 已经存在。您要替换它吗?</x:String>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -4,7 +4,7 @@
<PropertyGroup> <PropertyGroup>
<Title>Semi.Avalonia</Title> <Title>Semi.Avalonia</Title>
<PackageReleaseNotes>Update to Avalonia 11.1.0.2</PackageReleaseNotes> <PackageReleaseNotes>Update to Avalonia 11.1.0.4</PackageReleaseNotes>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))"> <PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">

View File

@@ -5,7 +5,17 @@
<SolidColorBrush x:Key="NotificationCardSuccessIconForeground" Color="#5DC264" /> <SolidColorBrush x:Key="NotificationCardSuccessIconForeground" Color="#5DC264" />
<SolidColorBrush x:Key="NotificationCardWarningIconForeground" Color="#FFAE43" /> <SolidColorBrush x:Key="NotificationCardWarningIconForeground" Color="#FFAE43" />
<SolidColorBrush x:Key="NotificationCardErrorIconForeground" Color="#FC725A" /> <SolidColorBrush x:Key="NotificationCardErrorIconForeground" Color="#FC725A" />
<BoxShadows x:Key="NotificationCardBoxShadows">0 0 8 0 #1AFFFFFF</BoxShadows> <BoxShadows x:Key="NotificationCardBoxShadows">inset 0 0 0 1 #1AFFFFFF, 0 4 14 0 #40000000</BoxShadows>
<SolidColorBrush x:Key="NotificationCardTitleForeground" Color="#F9F9F9" /> <SolidColorBrush x:Key="NotificationCardTitleForeground" Color="#F9F9F9" />
<SolidColorBrush x:Key="NotificationCardMessageForeground" Opacity="0.8" Color="#F9F9F9" /> <SolidColorBrush x:Key="NotificationCardMessageForeground" Opacity="0.8" Color="#F9F9F9" />
<SolidColorBrush x:Key="NotificationCardLightBackground" Color="#16161A" />
<SolidColorBrush x:Key="NotificationCardLightInformationBorderBrush" Color="#54A9FF" />
<SolidColorBrush x:Key="NotificationCardLightInformationBackground" Opacity="0.2" Color="#54A9FF" />
<SolidColorBrush x:Key="NotificationCardLightSuccessBorderBrush" Color="#5DC264" />
<SolidColorBrush x:Key="NotificationCardLightSuccessBackground" Opacity="0.2" Color="#5DC264" />
<SolidColorBrush x:Key="NotificationCardLightWarningBorderBrush" Color="#FFAE43" />
<SolidColorBrush x:Key="NotificationCardLightWarningBackground" Opacity="0.2" Color="#FFAE43" />
<SolidColorBrush x:Key="NotificationCardLightErrorBorderBrush" Color="#FC725A" />
<SolidColorBrush x:Key="NotificationCardLightErrorBackground" Opacity="0.2" Color="#FC725A" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -5,7 +5,17 @@
<SolidColorBrush x:Key="NotificationCardSuccessIconForeground" Color="#3BB346" /> <SolidColorBrush x:Key="NotificationCardSuccessIconForeground" Color="#3BB346" />
<SolidColorBrush x:Key="NotificationCardWarningIconForeground" Color="#FC8800" /> <SolidColorBrush x:Key="NotificationCardWarningIconForeground" Color="#FC8800" />
<SolidColorBrush x:Key="NotificationCardErrorIconForeground" Color="#F93920" /> <SolidColorBrush x:Key="NotificationCardErrorIconForeground" Color="#F93920" />
<BoxShadows x:Key="NotificationCardBoxShadows">0 0 8 0 #1A000000</BoxShadows> <BoxShadows x:Key="NotificationCardBoxShadows">0 0 1 0 #4A000000, 0 4 14 0 #1A000000</BoxShadows>
<SolidColorBrush x:Key="NotificationCardTitleForeground" Color="#1C1F23" /> <SolidColorBrush x:Key="NotificationCardTitleForeground" Color="#1C1F23" />
<SolidColorBrush x:Key="NotificationCardMessageForeground" Opacity="0.8" Color="#1C1F23" /> <SolidColorBrush x:Key="NotificationCardMessageForeground" Opacity="0.8" Color="#1C1F23" />
<SolidColorBrush x:Key="NotificationCardLightBackground" Color="White" />
<SolidColorBrush x:Key="NotificationCardLightInformationBorderBrush" Color="#0077FA" />
<SolidColorBrush x:Key="NotificationCardLightInformationBackground" Color="#EAF5FF" />
<SolidColorBrush x:Key="NotificationCardLightSuccessBorderBrush" Color="#3BB346" />
<SolidColorBrush x:Key="NotificationCardLightSuccessBackground" Color="#ECF7EC" />
<SolidColorBrush x:Key="NotificationCardLightWarningBorderBrush" Color="#FC8800" />
<SolidColorBrush x:Key="NotificationCardLightWarningBackground" Color="#FFF8EA" />
<SolidColorBrush x:Key="NotificationCardLightErrorBorderBrush" Color="#F93920" />
<SolidColorBrush x:Key="NotificationCardLightErrorBackground" Color="#FEF2ED" />
</ResourceDictionary> </ResourceDictionary>

View File

@@ -6,7 +6,7 @@
<!-- MenuFlyout --> <!-- MenuFlyout -->
<Thickness x:Key="MenuFlyoutBorderThickness">1</Thickness> <Thickness x:Key="MenuFlyoutBorderThickness">1</Thickness>
<Thickness x:Key="MenuFlyoutPadding">8</Thickness> <Thickness x:Key="MenuFlyoutPadding">0</Thickness>
<CornerRadius x:Key="MenuFlyoutCornerRadius">6</CornerRadius> <CornerRadius x:Key="MenuFlyoutCornerRadius">6</CornerRadius>
<x:Double x:Key="MenuFlyoutMinHeight">16</x:Double> <x:Double x:Key="MenuFlyoutMinHeight">16</x:Double>
<x:Double x:Key="MenuFlyoutMinWidth">100</x:Double> <x:Double x:Key="MenuFlyoutMinWidth">100</x:Double>

View File

@@ -3,7 +3,7 @@
<Thickness x:Key="NotificationCardBorderThickness">1</Thickness> <Thickness x:Key="NotificationCardBorderThickness">1</Thickness>
<CornerRadius x:Key="NotificationCardCornerRadius">6</CornerRadius> <CornerRadius x:Key="NotificationCardCornerRadius">6</CornerRadius>
<Thickness x:Key="NotificationCardMargin">8</Thickness> <Thickness x:Key="NotificationCardMargin">8</Thickness>
<Thickness x:Key="NotificationCardPadding">16 12</Thickness> <Thickness x:Key="NotificationCardPadding">20 16 12 16</Thickness>
<x:Double x:Key="NotificationCardIconWidth">18</x:Double> <x:Double x:Key="NotificationCardIconWidth">18</x:Double>
<x:Double x:Key="NotificationCardIconHeight">18</x:Double> <x:Double x:Key="NotificationCardIconHeight">18</x:Double>