mirror of
https://github.com/2dust/v2rayN.git
synced 2025-10-13 11:59:13 +00:00
parent
513662d89a
commit
bbe64aa970
6 changed files with 6 additions and 95 deletions
|
@ -20,7 +20,6 @@
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<ResourceInclude Source="Assets/GlobalResources.axaml" />
|
<ResourceInclude Source="Assets/GlobalResources.axaml" />
|
||||||
<ResourceInclude Source="Controls/AutoCompleteBox.axaml" />
|
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</Application.Resources>
|
</Application.Resources>
|
||||||
|
|
|
@ -1,48 +0,0 @@
|
||||||
<ResourceDictionary
|
|
||||||
xmlns="https://github.com/avaloniaui"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:controls="clr-namespace:v2rayN.Desktop.Controls">
|
|
||||||
<!-- Add Resources Here -->
|
|
||||||
<ControlTheme x:Key="{x:Type controls:AutoCompleteBox}" TargetType="controls:AutoCompleteBox">
|
|
||||||
<Setter Property="VerticalAlignment" Value="Center" />
|
|
||||||
<Setter Property="MinHeight" Value="{DynamicResource AutoCompleteBoxDefaultHeight}" />
|
|
||||||
<Setter Property="MaxDropDownHeight" Value="{DynamicResource AutoCompleteMaxDropdownHeight}" />
|
|
||||||
<Setter Property="Template">
|
|
||||||
<ControlTemplate TargetType="AutoCompleteBox">
|
|
||||||
<Panel>
|
|
||||||
<TextBox
|
|
||||||
Name="PART_TextBox"
|
|
||||||
MinHeight="{TemplateBinding MinHeight}"
|
|
||||||
VerticalAlignment="Stretch"
|
|
||||||
DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}"
|
|
||||||
InnerLeftContent="{TemplateBinding InnerLeftContent}"
|
|
||||||
InnerRightContent="{TemplateBinding InnerRightContent}"
|
|
||||||
Watermark="{TemplateBinding Watermark}" />
|
|
||||||
<Popup
|
|
||||||
Name="PART_Popup"
|
|
||||||
MaxHeight="{TemplateBinding MaxDropDownHeight}"
|
|
||||||
IsLightDismissEnabled="True"
|
|
||||||
PlacementTarget="{TemplateBinding}">
|
|
||||||
<Border
|
|
||||||
MinWidth="{Binding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}"
|
|
||||||
Margin="{DynamicResource AutoCompleteBoxPopupMargin}"
|
|
||||||
Padding="{DynamicResource AutoCompleteBoxPopupPadding}"
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
Background="{DynamicResource AutoCompleteBoxPopupBackground}"
|
|
||||||
BorderBrush="{DynamicResource AutoCompleteBoxPopupBorderBrush}"
|
|
||||||
BorderThickness="{DynamicResource AutoCompleteBoxPopupBorderThickness}"
|
|
||||||
BoxShadow="{DynamicResource AutoCompleteBoxPopupBoxShadow}"
|
|
||||||
CornerRadius="{DynamicResource AutoCompleteBoxPopupCornerRadius}">
|
|
||||||
<ListBox
|
|
||||||
Name="PART_SelectingItemsControl"
|
|
||||||
Foreground="{TemplateBinding Foreground}"
|
|
||||||
ItemTemplate="{TemplateBinding ItemTemplate}"
|
|
||||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
|
||||||
ScrollViewer.VerticalScrollBarVisibility="Auto" />
|
|
||||||
</Border>
|
|
||||||
</Popup>
|
|
||||||
</Panel>
|
|
||||||
</ControlTemplate>
|
|
||||||
</Setter>
|
|
||||||
</ControlTheme>
|
|
||||||
</ResourceDictionary>
|
|
|
@ -1,40 +0,0 @@
|
||||||
using Avalonia.Input;
|
|
||||||
using Avalonia.Interactivity;
|
|
||||||
|
|
||||||
namespace v2rayN.Desktop.Controls;
|
|
||||||
|
|
||||||
public class AutoCompleteBox : Avalonia.Controls.AutoCompleteBox
|
|
||||||
{
|
|
||||||
static AutoCompleteBox()
|
|
||||||
{
|
|
||||||
MinimumPrefixLengthProperty.OverrideDefaultValue<AutoCompleteBox>(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public AutoCompleteBox()
|
|
||||||
{
|
|
||||||
AddHandler(PointerPressedEvent, OnBoxPointerPressed, RoutingStrategies.Tunnel);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnBoxPointerPressed(object? sender, PointerPressedEventArgs e)
|
|
||||||
{
|
|
||||||
if (Equals(sender, this) && e.GetCurrentPoint(this).Properties.IsLeftButtonPressed)
|
|
||||||
{
|
|
||||||
SetCurrentValue(IsDropDownOpenProperty, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnGotFocus(GotFocusEventArgs e)
|
|
||||||
{
|
|
||||||
base.OnGotFocus(e);
|
|
||||||
if (IsDropDownOpen)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
SetCurrentValue(IsDropDownOpenProperty, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Clear()
|
|
||||||
{
|
|
||||||
SetCurrentValue(SelectedItemProperty, null);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -2,7 +2,6 @@
|
||||||
x:Class="v2rayN.Desktop.Views.DNSSettingWindow"
|
x:Class="v2rayN.Desktop.Views.DNSSettingWindow"
|
||||||
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"
|
||||||
xmlns:ctrls="clr-namespace:v2rayN.Desktop.Controls"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
|
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
x:Class="v2rayN.Desktop.Views.OptionSettingWindow"
|
x:Class="v2rayN.Desktop.Views.OptionSettingWindow"
|
||||||
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"
|
||||||
xmlns:ctrls="clr-namespace:v2rayN.Desktop.Controls"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
|
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
|
||||||
|
@ -622,7 +621,8 @@
|
||||||
Grid.Row="23"
|
Grid.Row="23"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="300"
|
Width="300"
|
||||||
Margin="{StaticResource Margin4}" />
|
Margin="{StaticResource Margin4}"
|
||||||
|
IsEditable="True" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="23"
|
Grid.Row="23"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
|
@ -642,7 +642,8 @@
|
||||||
Grid.Row="24"
|
Grid.Row="24"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="300"
|
Width="300"
|
||||||
Margin="{StaticResource Margin4}" />
|
Margin="{StaticResource Margin4}"
|
||||||
|
IsEditable="True" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="24"
|
Grid.Row="24"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
|
@ -662,7 +663,8 @@
|
||||||
Grid.Row="25"
|
Grid.Row="25"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="300"
|
Width="300"
|
||||||
Margin="{StaticResource Margin4}" />
|
Margin="{StaticResource Margin4}"
|
||||||
|
IsEditable="True" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="25"
|
Grid.Row="25"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
x:Class="v2rayN.Desktop.Views.RoutingRuleDetailsWindow"
|
x:Class="v2rayN.Desktop.Views.RoutingRuleDetailsWindow"
|
||||||
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"
|
||||||
xmlns:ctrls="clr-namespace:v2rayN.Desktop.Controls"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
|
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
|
||||||
|
|
Loading…
Reference in a new issue