Compare commits

..

1 Commits

Author SHA1 Message Date
rabbitism
8827491546 feat: enable vulkan in android demo. 2024-08-23 11:05:08 +08:00
18 changed files with 157 additions and 300 deletions

View File

@@ -1,5 +1,6 @@
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;
@@ -13,4 +14,12 @@ 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,10 +11,7 @@ internal sealed partial class Program
{ {
private static Task Main(string[] args) => BuildAvaloniaApp() private static Task Main(string[] args) => BuildAvaloniaApp()
.WithSourceHanSansCNFont() .WithSourceHanSansCNFont()
.StartBrowserAppAsync("out", new BrowserPlatformOptions .StartBrowserAppAsync("out");
{
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="OpenFileButton" Content="Open File" /> <Button Name="openFileDialog">Open File</Button>
<Button Name="SelectFolderButton" Content="Select Folder" /> <Button Name="selectFolderDialog">Select Folder</Button>
<Button Name="SaveFileButton" Content="Save File" /> <Button Name="saveFileDialog">Save File</Button>
</StackPanel> </StackPanel>
</UserControl> </UserControl>

View File

@@ -1,6 +1,10 @@
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;
@@ -10,14 +14,14 @@ public partial class ManagedFileChooserDemo : UserControl
public ManagedFileChooserDemo() public ManagedFileChooserDemo()
{ {
InitializeComponent(); InitializeComponent();
OpenFileButton.Click += OpenFileDialog; openFileDialog.Click += OpenFileDialog;
SelectFolderButton.Click += SelectFolderDialog; selectFolderDialog.Click += SelectFolderDialog;
SaveFileButton.Click += SaveFileDialog; saveFileDialog.Click += SaveFileDialog;
} }
private async void OpenFileDialog(object? sender, RoutedEventArgs args) private async void OpenFileDialog(object sender, RoutedEventArgs args)
{ {
var sp = GetStorageProvider(); IStorageProvider? 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()
{ {
@@ -26,10 +30,9 @@ 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)
{ {
var sp = GetStorageProvider(); IStorageProvider? 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()
{ {
@@ -37,14 +40,13 @@ 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)
{ {
var sp = GetStorageProvider(); IStorageProvider? 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 = "Save File", Title = "Open File",
}); });
} }
@@ -56,10 +58,10 @@ public partial class ManagedFileChooserDemo : UserControl
List<FilePickerFileType>? GetFileTypes() List<FilePickerFileType>? GetFileTypes()
{ {
return return new List<FilePickerFileType>
[ {
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.3</Version> <Version>11.1.0.2</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.3</PackageReleaseNotes> <PackageReleaseNotes>Update to Avalonia 11.1.0.2</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.3</PackageReleaseNotes> <PackageReleaseNotes>Update to Avalonia 11.1.0.2</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}" CornerRadius="{TemplateBinding CornerRadius}"> <ScrollViewer Theme="{DynamicResource MenuScrollViewer}">
<ItemsPresenter <ItemsPresenter
Name="PART_ItemsPresenter" Name="PART_ItemsPresenter"
Grid.IsSharedSizeScope="True" Grid.IsSharedSizeScope="True"

View File

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

View File

@@ -2,21 +2,7 @@
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">
<Design.PreviewWith> <!-- Add Resources Here -->
<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}" />
@@ -37,13 +23,12 @@
BorderBrush="{TemplateBinding BorderBrush}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" BorderThickness="{TemplateBinding BorderThickness}"
BoxShadow="{DynamicResource MenuFlyoutBorderBoxShadow}" BoxShadow="{DynamicResource MenuFlyoutBorderBoxShadow}"
ClipToBounds="True" ClipToBounds="False"
CornerRadius="{TemplateBinding CornerRadius}" CornerRadius="{TemplateBinding CornerRadius}"
UseLayoutRounding="False"> UseLayoutRounding="False">
<ScrollViewer <ScrollViewer
Theme="{StaticResource MenuScrollViewer}"
CornerRadius="{TemplateBinding CornerRadius}"
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
Theme="{StaticResource MenuScrollViewer}"
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"> VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
<ItemsPresenter <ItemsPresenter
Name="PART_ItemsPresenter" Name="PART_ItemsPresenter"

View File

@@ -24,6 +24,35 @@
</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}" />
@@ -97,7 +126,8 @@
SelectionEnd="{TemplateBinding SelectionEnd}" SelectionEnd="{TemplateBinding SelectionEnd}"
SelectionForegroundBrush="{TemplateBinding SelectionForegroundBrush}" SelectionForegroundBrush="{TemplateBinding SelectionForegroundBrush}"
SelectionStart="{TemplateBinding SelectionStart}" SelectionStart="{TemplateBinding SelectionStart}"
Text="{TemplateBinding Text, Mode=TwoWay}" Text="{TemplateBinding Text,
Mode=TwoWay}"
TextAlignment="{TemplateBinding TextAlignment}" TextAlignment="{TemplateBinding TextAlignment}"
TextWrapping="{TemplateBinding TextWrapping}" /> TextWrapping="{TemplateBinding TextWrapping}" />
</Panel> </Panel>
@@ -113,7 +143,8 @@
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, Mode=TwoWay}" IsChecked="{TemplateBinding RevealPassword,
Mode=TwoWay}"
IsVisible="False" IsVisible="False"
Theme="{StaticResource InputToggleButton}" /> Theme="{StaticResource InputToggleButton}" />
<ContentPresenter <ContentPresenter
@@ -222,10 +253,10 @@
</Style> </Style>
<Style Selector="^.TextArea"> <Style Selector="^.TextArea">
<Setter Property="AcceptsReturn" Value="True"/> <Setter Property="AcceptsReturn" Value="True"></Setter>
<Setter Property="VerticalContentAlignment" Value="Top"/> <Setter Property="VerticalContentAlignment" Value="Top"></Setter>
<Setter Property="Padding" Value="{DynamicResource TextBoxTextAreaContentPadding}" /> <Setter Property="TextBox.Padding" Value="{DynamicResource TextBoxTextAreaContentPadding}"></Setter>
<Setter Property="MinHeight" Value="{DynamicResource TextBoxTextAreaHeight}" /> <Setter Property="MinHeight" Value="{DynamicResource TextBoxTextAreaHeight}"></Setter>
</Style> </Style>
</ControlTheme> </ControlTheme>
@@ -235,8 +266,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.BorderThickness" Value="{DynamicResource TextBoxBorderThickness}" />
<Setter Property="TextBox.BackgroundSizing" Value="OuterBorderEdge" /> <Setter Property="TextBox.BackgroundSizing" Value="OuterBorderEdge" />
<Setter Property="TextBox.BorderThickness" Value="{DynamicResource TextBoxBorderThickness}" />
<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" />
@@ -259,7 +290,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, Auto, Auto"> <Grid Margin="{TemplateBinding Padding}" ColumnDefinitions="Auto, *, Auto">
<ContentPresenter <ContentPresenter
Grid.Column="0" Grid.Column="0"
Padding="{DynamicResource TextBoxInnerLeftContentPadding}" Padding="{DynamicResource TextBoxInnerLeftContentPadding}"
@@ -278,22 +309,17 @@
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}"
CaretBlinkInterval="{TemplateBinding CaretBlinkInterval}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
CaretBlinkInterval="{TemplateBinding CaretBlinkInterval}"
CaretBrush="{TemplateBinding CaretBrush}" CaretBrush="{TemplateBinding CaretBrush}"
CaretIndex="{TemplateBinding CaretIndex}" CaretIndex="{TemplateBinding CaretIndex}"
LineHeight="{TemplateBinding LineHeight}" LineHeight="{TemplateBinding LineHeight}"
@@ -303,27 +329,14 @@
SelectionEnd="{TemplateBinding SelectionEnd}" SelectionEnd="{TemplateBinding SelectionEnd}"
SelectionForegroundBrush="{TemplateBinding SelectionForegroundBrush}" SelectionForegroundBrush="{TemplateBinding SelectionForegroundBrush}"
SelectionStart="{TemplateBinding SelectionStart}" SelectionStart="{TemplateBinding SelectionStart}"
Text="{TemplateBinding Text, Mode=TwoWay}" Text="{TemplateBinding Text,
Mode=TwoWay}"
TextAlignment="{TemplateBinding TextAlignment}" TextAlignment="{TemplateBinding TextAlignment}"
TextWrapping="{TemplateBinding TextWrapping}" /> TextWrapping="{TemplateBinding TextWrapping}" />
</Panel> </Panel>
</ScrollViewer> </ScrollViewer>
<Button
Name="PART_ClearButton"
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 <ContentPresenter
Grid.Column="4" Grid.Column="2"
Padding="{DynamicResource TextBoxInnerRightContentPadding}" Padding="{DynamicResource TextBoxInnerRightContentPadding}"
VerticalAlignment="Center" VerticalAlignment="Center"
Content="{TemplateBinding InnerRightContent}" Content="{TemplateBinding InnerRightContent}"
@@ -370,69 +383,6 @@
<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">
@@ -510,32 +460,4 @@
</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,5 +21,4 @@
<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,5 +21,4 @@
<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,8 +8,7 @@
<!-- 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>
<x:String x:Key="STRING_TIMEPICKER_SECOND_TEXT">секунды</x:String> <!-- TextBox/SelectableTextBox flyout -->
<!-- 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>
@@ -17,10 +16,9 @@
<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">Отмена</x:String> <x:String x:Key="STRING_CHOOSER_DIALOG_CANCEL">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,5 +21,4 @@
<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.3</PackageReleaseNotes> <PackageReleaseNotes>Update to Avalonia 11.1.0.2</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">0</Thickness> <Thickness x:Key="MenuFlyoutPadding">8</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>