Compare commits

..

10 Commits

Author SHA1 Message Date
rabbitism
cc7d55b49d feat: change render mode in browser demo. 2024-09-01 17:00:26 +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
18 changed files with 300 additions and 157 deletions

View File

@@ -1,6 +1,5 @@
using Android.App; using Android.App;
using Android.Content.PM; using Android.Content.PM;
using Avalonia;
using Avalonia.Android; using Avalonia.Android;
namespace Semi.Avalonia.Demo.Android; namespace Semi.Avalonia.Demo.Android;
@@ -14,12 +13,4 @@ namespace Semi.Avalonia.Demo.Android;
ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)] ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)]
public class MainActivity : AvaloniaMainActivity<App> public class MainActivity : AvaloniaMainActivity<App>
{ {
protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
{
return base.CustomizeAppBuilder(builder)
.With(new AndroidPlatformOptions()
{
RenderingMode = [AndroidRenderingMode.Vulkan, AndroidRenderingMode.Egl, AndroidRenderingMode.Software]
});
}
} }

View File

@@ -11,7 +11,10 @@ internal sealed partial class Program
{ {
private static Task Main(string[] args) => BuildAvaloniaApp() private static Task Main(string[] args) => BuildAvaloniaApp()
.WithSourceHanSansCNFont() .WithSourceHanSansCNFont()
.StartBrowserAppAsync("out"); .StartBrowserAppAsync("out", new BrowserPlatformOptions
{
RenderingMode = [ BrowserRenderingMode.WebGL2, BrowserRenderingMode.WebGL1, BrowserRenderingMode.Software2D],
});
public static AppBuilder BuildAvaloniaApp() public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>(); => AppBuilder.Configure<App>();

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

@@ -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.3</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.3</PackageReleaseNotes>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))"> <PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">

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.3</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

@@ -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.3</PackageReleaseNotes>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))"> <PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">

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>