feat: try to fix trimming issue.
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
Name="ClearButton"
|
||||
Grid.Column="3"
|
||||
Padding="8,0"
|
||||
Command="{Binding $parent[contracts:IClearControl].Clear}"
|
||||
Command="{Binding $parent[u:DateRangePicker].Clear}"
|
||||
Content="{DynamicResource IconButtonClearData}"
|
||||
Focusable="False"
|
||||
IsVisible="False"
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="{x:Type u:NumericUpDown}" TargetType="{x:Type u:NumericUpDown}">
|
||||
<Setter Property="NumericUpDown.VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="NumericUpDown.CornerRadius" Value="{DynamicResource NumericUpDownCornerRadius}" />
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource NumericUpDownCornerRadius}" />
|
||||
<Setter Property="MinHeight" Value="{DynamicResource NumericUpDownDefaultHeight}"></Setter>
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="u:NumericUpDown">
|
||||
<DataValidationErrors>
|
||||
@@ -44,7 +44,7 @@
|
||||
<TextBox
|
||||
Name="PART_TextBox"
|
||||
Height="{TemplateBinding Height}"
|
||||
MinHeight="{DynamicResource NumericUpDownWrapperDefaultHeight}"
|
||||
MinHeight="{TemplateBinding MinHeight}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
AcceptsReturn="False"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
|
||||
@@ -140,7 +140,7 @@
|
||||
Name="ClearButton"
|
||||
Grid.Column="1"
|
||||
Padding="0,0,8,0"
|
||||
Command="{Binding $parent[iri:IClearControl].Clear}"
|
||||
Command="{Binding $parent[u:TimePicker].Clear}"
|
||||
Content="{DynamicResource IconButtonClearData}"
|
||||
Focusable="False"
|
||||
IsVisible="False"
|
||||
|
||||
@@ -59,7 +59,8 @@
|
||||
Name="ClearButton"
|
||||
Grid.Column="3"
|
||||
Padding="8,0"
|
||||
Command="{Binding $parent[iri:IClearControl].Clear}"
|
||||
Command="{Binding $parent[u:TimeRangePicker
|
||||
].Clear}"
|
||||
Content="{DynamicResource IconButtonClearData}"
|
||||
Focusable="False"
|
||||
IsVisible="False"
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
<Button
|
||||
Name="PART_ClearButton"
|
||||
Grid.Column="2"
|
||||
Command="{Binding $parent[iri:IClearControl].Clear}"
|
||||
Command="{Binding $parent[u:TreeComboBox].Clear}"
|
||||
IsVisible="False"
|
||||
Theme="{DynamicResource InnerIconButton}"
|
||||
Content="{DynamicResource IconButtonClearData}" />
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<Styles.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<MergeResourceInclude x:Key="Dark" Source="./Themes/Dark/_index.axaml" />
|
||||
<MergeResourceInclude x:Key="Light" Source="./Themes/Light/_index.axaml" />
|
||||
<ResourceInclude x:Key="Dark" Source="./Themes/Dark/_index.axaml" />
|
||||
<ResourceInclude x:Key="Light" Source="./Themes/Light/_index.axaml" />
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceInclude Source="../Controls/_index.axaml" />
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.Styling;
|
||||
using Ursa.Themes.Semi.Locale;
|
||||
|
||||
namespace Ursa.Themes.Semi;
|
||||
|
||||
@@ -10,14 +11,14 @@ namespace Ursa.Themes.Semi;
|
||||
/// </summary>
|
||||
public class SemiTheme: Styles
|
||||
{
|
||||
private static readonly Lazy<Dictionary<CultureInfo, string>> _localeToResource = new Lazy<Dictionary<CultureInfo, string>>(
|
||||
() => new Dictionary<CultureInfo, string>
|
||||
private static readonly Lazy<Dictionary<CultureInfo, ResourceDictionary>> _localeToResource = new Lazy<Dictionary<CultureInfo, ResourceDictionary>>(
|
||||
() => new Dictionary<CultureInfo, ResourceDictionary>
|
||||
{
|
||||
{ new CultureInfo("zh-CN"), "avares://Ursa.Themes.Semi/Locale/zh-CN.axaml" },
|
||||
{ new CultureInfo("en-US"), "avares://Ursa.Themes.Semi/Locale/en-US.axaml" },
|
||||
{ new CultureInfo("zh-CN"), new zh_cn() },
|
||||
{ new CultureInfo("en-US"), new en_us() },
|
||||
});
|
||||
|
||||
private static readonly string _defaultResource = "avares://Ursa.Themes.Semi/Locale/zh-CN.axaml";
|
||||
private static readonly ResourceDictionary _defaultResource = new zh_cn();
|
||||
|
||||
private readonly IServiceProvider? sp;
|
||||
public SemiTheme(IServiceProvider? provider = null)
|
||||
@@ -36,9 +37,8 @@ public class SemiTheme: Styles
|
||||
{
|
||||
_locale = value;
|
||||
var resource = TryGetLocaleResource(value);
|
||||
var d = AvaloniaXamlLoader.Load(sp, new Uri(resource)) as ResourceDictionary;
|
||||
if (d is null) return;
|
||||
foreach (var kv in d)
|
||||
if (resource is null) return;
|
||||
foreach (var kv in resource)
|
||||
{
|
||||
this.Resources.Add(kv);
|
||||
}
|
||||
@@ -51,7 +51,7 @@ public class SemiTheme: Styles
|
||||
}
|
||||
}
|
||||
|
||||
private static string TryGetLocaleResource(CultureInfo? locale)
|
||||
private static ResourceDictionary? TryGetLocaleResource(CultureInfo? locale)
|
||||
{
|
||||
if (Equals(locale, CultureInfo.InvariantCulture))
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
x:Class="Ursa.Themes.Semi.Locale.en_us"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
<x:String x:Key="STRING_MENU_BRING_TO_FRONT">Bring to Front</x:String>
|
||||
|
||||
8
src/Ursa.Themes.Semi/Locale/en-us.axaml.cs
Normal file
8
src/Ursa.Themes.Semi/Locale/en-us.axaml.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Ursa.Themes.Semi.Locale;
|
||||
|
||||
public class en_us: ResourceDictionary
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
x:Class="Ursa.Themes.Semi.Locale.zh_cn"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
<x:String x:Key="STRING_MENU_BRING_TO_FRONT">置于顶层</x:String>
|
||||
|
||||
8
src/Ursa.Themes.Semi/Locale/zh-cn.axaml.cs
Normal file
8
src/Ursa.Themes.Semi/Locale/zh-cn.axaml.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Ursa.Themes.Semi.Locale;
|
||||
|
||||
public class zh_cn: ResourceDictionary
|
||||
{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user