Adjust style and bug fixes
This commit is contained in:
@@ -65,9 +65,8 @@
|
||||
<Style TargetType="{x:Type TextElement}">
|
||||
<Setter Property="FontWeight" Value="Regular" />
|
||||
</Style>
|
||||
<Style x:Key="lvItemSelected"
|
||||
TargetType="{x:Type ListViewItem}">
|
||||
<Setter Property="Margin" Value="5" />
|
||||
<Style x:Key="lvItemSelected" TargetType="{x:Type ListViewItem}">
|
||||
<Setter Property="Margin" Value="2" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListViewItem">
|
||||
@@ -76,7 +75,7 @@
|
||||
</materialDesign:Card>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsSelected" Value="true">
|
||||
<Setter TargetName="_Card" Property="Foreground" Value="{DynamicResource PrimaryHueDarkBrush}"/>
|
||||
<Setter TargetName="_Card" Property="Background" Value="{DynamicResource PrimaryHueLightBrush}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
@@ -97,7 +96,7 @@
|
||||
BasedOn="{StaticResource MaterialDesignRaisedButton}"
|
||||
TargetType="{x:Type ButtonBase}">
|
||||
<Setter Property="FontSize" Value="{DynamicResource StdFontSize3}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryHueDarkForegroundBrush}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryHueDarkForegroundBrush}" />
|
||||
</Style>
|
||||
<Style
|
||||
x:Key="DefMenu"
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace ClashN
|
||||
Global.processJob = new Job();
|
||||
|
||||
Logging.Setup();
|
||||
Utils.SaveLog($"clashN start up | {Utils.GetVersion()} | {Utils.GetExePath()}");
|
||||
Utils.SaveLog($"ClashN start up | {Utils.GetVersion()} | {Utils.GetExePath()}");
|
||||
Logging.ClearLogs();
|
||||
|
||||
Init();
|
||||
|
||||
@@ -45,8 +45,8 @@
|
||||
|
||||
public const string mixinConfigFileName = "Mixin.yaml";
|
||||
|
||||
public const string SampleMixin = "clashN.Sample.SampleMixin.yaml";
|
||||
public const string SampleTun = "clashN.Sample.SampleTun.yaml";
|
||||
public const string SampleMixin = "ClashN.Sample.SampleMixin.yaml";
|
||||
public const string SampleTun = "ClashN.Sample.SampleTun.yaml";
|
||||
|
||||
public const string InboundSocks = "socks";
|
||||
public const string InboundHttp = "http";
|
||||
@@ -86,7 +86,7 @@
|
||||
/// <summary>
|
||||
/// Icon
|
||||
/// </summary>
|
||||
public const string CustomIconName = "clashN.ico";
|
||||
public const string CustomIconName = "ClashN.ico";
|
||||
public const int MinFontSize = 10;
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
""
|
||||
};
|
||||
|
||||
public static readonly List<string> coreTypes = new List<string> { "clash", "clash_premium", "clash_meta", };
|
||||
public static readonly List<string> coreTypes = new List<string> { "Clash", "ClashPremium", "ClashMeta", };
|
||||
|
||||
public static readonly List<string> allowSelectType = new List<string> { "selector", "urltest", "loadbalance", "fallback" };
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace ClashN.Handler
|
||||
{
|
||||
if (args.Success)
|
||||
{
|
||||
_updateFunc(false, string.Format(ResUI.MsgParsingSuccessfully, "clashN"));
|
||||
_updateFunc(false, string.Format(ResUI.MsgParsingSuccessfully, "ClashN"));
|
||||
|
||||
url = args.Msg;
|
||||
AskToDownload(downloadHandle, url, true);
|
||||
@@ -96,7 +96,7 @@ namespace ClashN.Handler
|
||||
_updateFunc(false, args.Msg);
|
||||
}
|
||||
};
|
||||
_updateFunc(false, string.Format(ResUI.MsgStartUpdating, "clashN"));
|
||||
_updateFunc(false, string.Format(ResUI.MsgStartUpdating, "ClashN"));
|
||||
CheckUpdateAsync(CoreKind.ClashN);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ namespace ClashN.Mode
|
||||
public class ProfileItemModel : ProfileItem
|
||||
{
|
||||
public bool IsActive { get; set; }
|
||||
public bool HasUrl => string.IsNullOrEmpty(url);
|
||||
public bool HasAddress => string.IsNullOrEmpty(address);
|
||||
public bool HasUrl => !string.IsNullOrEmpty(url);
|
||||
public bool HasAddress => !string.IsNullOrEmpty(address);
|
||||
public string StrUpdateTime
|
||||
{
|
||||
get
|
||||
|
||||
2
clashN/clashN/Properties/Resources.Designer.cs
generated
2
clashN/clashN/Properties/Resources.Designer.cs
generated
@@ -39,7 +39,7 @@ namespace ClashN.Properties {
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("clashN.Properties.Resources", typeof(Resources).Assembly);
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ClashN.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
|
||||
396
clashN/clashN/Resx/ResUI.Designer.cs
generated
396
clashN/clashN/Resx/ResUI.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
@@ -464,7 +464,7 @@
|
||||
<value>چک کردن</value>
|
||||
</data>
|
||||
<data name="TbHelpProject" xml:space="preserve">
|
||||
<value>پروژه clashN</value>
|
||||
<value>پروژه ClashN</value>
|
||||
</data>
|
||||
<data name="TbHelpProjectGo" xml:space="preserve">
|
||||
<value>Go to</value>
|
||||
|
||||
@@ -464,7 +464,7 @@
|
||||
<value>Check</value>
|
||||
</data>
|
||||
<data name="TbHelpProject" xml:space="preserve">
|
||||
<value>clashN Project</value>
|
||||
<value>ClashN Project</value>
|
||||
</data>
|
||||
<data name="TbHelpProjectGo" xml:space="preserve">
|
||||
<value>Go to</value>
|
||||
|
||||
@@ -464,7 +464,7 @@
|
||||
<value>检查更新</value>
|
||||
</data>
|
||||
<data name="TbHelpProject" xml:space="preserve">
|
||||
<value>clashN 项目</value>
|
||||
<value>ClashN 项目</value>
|
||||
</data>
|
||||
<data name="TbHelpProjectGo" xml:space="preserve">
|
||||
<value>打开</value>
|
||||
|
||||
@@ -6,20 +6,20 @@ namespace ClashN
|
||||
{
|
||||
public static void Show(string msg)
|
||||
{
|
||||
MessageBox.Show(msg, "clashN", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
MessageBox.Show(msg, "ClashN", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
public static void ShowWarning(string msg)
|
||||
{
|
||||
MessageBox.Show(msg, "clashN", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
MessageBox.Show(msg, "ClashN", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
}
|
||||
public static void ShowError(string msg)
|
||||
{
|
||||
MessageBox.Show(msg, "clashN", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
MessageBox.Show(msg, "ClashN", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
|
||||
public static DialogResult ShowYesNo(string msg)
|
||||
{
|
||||
return MessageBox.Show(msg, "clashN", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
||||
return MessageBox.Show(msg, "ClashN", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
||||
}
|
||||
|
||||
//public static string GetResourseString(string key)
|
||||
|
||||
@@ -9,6 +9,7 @@ using MaterialDesignThemes.Wpf;
|
||||
using ReactiveUI;
|
||||
using ReactiveUI.Fody.Helpers;
|
||||
using Splat;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Reactive;
|
||||
using System.Windows.Forms;
|
||||
@@ -313,6 +314,10 @@ namespace ClashN.ViewModels
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (SelectedSource?.indexId == _config.IndexId)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var item = _config.GetProfileItem(SelectedSource.indexId);
|
||||
if (item is null)
|
||||
{
|
||||
@@ -375,7 +380,8 @@ namespace ClashN.ViewModels
|
||||
var img = QRCodeHelper.GetQRCode(item.url);
|
||||
var dialog = new ProfileQrcodeView()
|
||||
{
|
||||
imgQrcode = { Source = img }
|
||||
imgQrcode = { Source = img } ,
|
||||
txtContent = { Text = item.url },
|
||||
};
|
||||
|
||||
await DialogHost.Show(dialog, "RootDialog");
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace ClashN.ViewModels
|
||||
public ReactiveCommand<Unit, Unit> EditMixinContentCmd { get; }
|
||||
#endregion
|
||||
|
||||
#region clashN
|
||||
#region ClashN
|
||||
|
||||
[Reactive]
|
||||
public bool AutoRun { get; set; }
|
||||
@@ -109,7 +109,7 @@ namespace ClashN.ViewModels
|
||||
EditMixinContent();
|
||||
}, this.IsValid());
|
||||
|
||||
//clashN
|
||||
//ClashN
|
||||
AutoRun = _config.AutoRun;
|
||||
EnableStatistics = _config.EnableStatistics;
|
||||
EnableSecurityProtocolTls13 = _config.EnableSecurityProtocolTls13;
|
||||
@@ -244,7 +244,7 @@ namespace ClashN.ViewModels
|
||||
_config.LogLevel = LogLevel;
|
||||
_config.EnableMixinContent = EnableMixinContent;
|
||||
|
||||
//clashN
|
||||
//ClashN
|
||||
Utils.SetAutoRun(AutoRun);
|
||||
_config.AutoRun = AutoRun;
|
||||
_config.EnableStatistics = EnableStatistics;
|
||||
|
||||
@@ -29,7 +29,10 @@
|
||||
<ToolBarTray Margin="0,8,0,8" DockPanel.Dock="Top">
|
||||
<ToolBar ClipToBounds="True" Style="{StaticResource MaterialDesignToolBar}">
|
||||
<Button Width="1" Visibility="Hidden">
|
||||
<materialDesign:PackIcon Kind="ContentSave" />
|
||||
<materialDesign:PackIcon
|
||||
Margin="0,0,8,0"
|
||||
VerticalAlignment="Center"
|
||||
Kind="ContentSave" />
|
||||
</Button>
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
@@ -50,7 +53,10 @@
|
||||
<Separator />
|
||||
<Button x:Name="btnConnectionCloseAll" ToolTip="{x:Static resx:ResUI.menuConnectionCloseAll}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Kind="Close" />
|
||||
<materialDesign:PackIcon
|
||||
Margin="0,0,8,0"
|
||||
VerticalAlignment="Center"
|
||||
Kind="Close" />
|
||||
<TextBlock Style="{StaticResource ToolbarItem}" Text="{x:Static resx:ResUI.menuConnectionCloseAll}" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
xmlns:reactiveui="http://reactiveui.net"
|
||||
xmlns:resx="clr-namespace:ClashN.Resx"
|
||||
xmlns:vms="clr-namespace:ClashN.ViewModels"
|
||||
Title="clashN"
|
||||
Title="ClashN"
|
||||
Width="600"
|
||||
Height="500"
|
||||
x:TypeArguments="vms:ProfileEditViewModel"
|
||||
|
||||
@@ -24,7 +24,10 @@
|
||||
<ToolBarTray Margin="0,8,0,8" DockPanel.Dock="Top">
|
||||
<ToolBar ClipToBounds="True" Style="{StaticResource MaterialDesignToolBar}">
|
||||
<Button Width="1" Visibility="Hidden">
|
||||
<materialDesign:PackIcon Kind="ContentSave" />
|
||||
<materialDesign:PackIcon
|
||||
Margin="0,0,8,0"
|
||||
VerticalAlignment="Center"
|
||||
Kind="ContentSave" />
|
||||
</Button>
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
@@ -37,7 +40,10 @@
|
||||
<Separator />
|
||||
<Button x:Name="btnDelete" Click="btnDelete_Click">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Kind="Delete" />
|
||||
<materialDesign:PackIcon
|
||||
Margin="0,0,8,0"
|
||||
VerticalAlignment="Center"
|
||||
Kind="Delete" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Separator />
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
Style="{StaticResource MaterialDesignEmbeddedDialogHost}">
|
||||
<Grid>
|
||||
<Grid Grid.Column="0">
|
||||
<TabControl Style="{StaticResource MaterialDesignNavigatilRailTabControl}" Padding="10, 0">
|
||||
<TabControl Padding="2,0" Style="{StaticResource MaterialDesignNavigatilRailTabControl}">
|
||||
<materialDesign:NavigationRailAssist.FloatingContent>
|
||||
<StackPanel
|
||||
Width="auto"
|
||||
@@ -73,7 +73,7 @@
|
||||
<Button
|
||||
x:Name="btnReload"
|
||||
Content="{materialDesign:PackIcon Kind=Reload}"
|
||||
Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
|
||||
Style="{StaticResource MaterialDesignFloatingActionMiniButton}"
|
||||
ToolTip="{x:Static resx:ResUI.TbReloadCore}" />
|
||||
</StackPanel>
|
||||
</materialDesign:NavigationRailAssist.FloatingContent>
|
||||
@@ -208,7 +208,7 @@
|
||||
|
||||
<tb:TaskbarIcon
|
||||
x:Name="tbNotify"
|
||||
IconSource="/clashN.ico"
|
||||
IconSource="/ClashN.ico"
|
||||
NoLeftClickDelay="True">
|
||||
<tb:TaskbarIcon.ContextMenu>
|
||||
<ContextMenu Style="{StaticResource DefMenu}">
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
xmlns:reactiveui="http://reactiveui.net"
|
||||
xmlns:resx="clr-namespace:ClashN.Resx"
|
||||
xmlns:vms="clr-namespace:ClashN.ViewModels"
|
||||
Title="clashN"
|
||||
Title="ClashN"
|
||||
Width="700"
|
||||
Height="600"
|
||||
x:TypeArguments="vms:ProfileEditViewModel"
|
||||
|
||||
@@ -6,28 +6,44 @@
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:resx="clr-namespace:ClashN.Resx"
|
||||
MaxWidth="400"
|
||||
d:DesignHeight="300"
|
||||
d:DesignWidth="300"
|
||||
mc:Ignorable="d">
|
||||
<Grid Margin="16">
|
||||
<Grid Margin="30">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="60" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Image
|
||||
Name="imgQrcode"
|
||||
x:Name="imgQrcode"
|
||||
Grid.Row="0"
|
||||
Width="300"
|
||||
Height="300"
|
||||
Stretch="UniformToFill" />
|
||||
<Button
|
||||
|
||||
<TextBox
|
||||
x:Name="txtContent"
|
||||
Grid.Row="1"
|
||||
Margin="16"
|
||||
Width="300"
|
||||
Margin="0,8"
|
||||
VerticalAlignment="Center"
|
||||
IsReadOnly="True"
|
||||
MaxLines="3"
|
||||
TextWrapping="Wrap"
|
||||
VerticalScrollBarVisibility="Auto" />
|
||||
|
||||
<Button
|
||||
Grid.Row="2"
|
||||
Width="100"
|
||||
Margin="8"
|
||||
HorizontalAlignment="Right"
|
||||
Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}"
|
||||
Content="{x:Static resx:ResUI.TbConfirm}"
|
||||
IsCancel="True"
|
||||
IsDefault="True"
|
||||
Style="{StaticResource MaterialDesignFlatButton}" />
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -27,35 +27,60 @@
|
||||
<ToolBar ClipToBounds="True" Style="{StaticResource MaterialDesignToolBar}">
|
||||
<Button x:Name="btnAddProfile" ToolTip="{x:Static resx:ResUI.menuAddProfile}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Kind="Plus" />
|
||||
<materialDesign:PackIcon
|
||||
Margin="0,0,8,0"
|
||||
VerticalAlignment="Center"
|
||||
Kind="Plus" />
|
||||
<TextBlock Style="{StaticResource ToolbarItem}" Text="{x:Static resx:ResUI.menuAddProfile}" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Separator />
|
||||
<Button x:Name="btnAddProfileViaClipboard" ToolTip="{x:Static resx:ResUI.menuAddProfileViaClipboard}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Kind="ContentPaste" />
|
||||
<materialDesign:PackIcon
|
||||
Margin="0,0,8,0"
|
||||
VerticalAlignment="Center"
|
||||
Kind="ContentPaste" />
|
||||
<TextBlock Style="{StaticResource ToolbarItem}" Text="{x:Static resx:ResUI.TbAddProfileViaClipboard}" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Separator />
|
||||
<Button x:Name="btnSubUpdateViaProxy" ToolTip="{x:Static resx:ResUI.menuSubUpdateViaProxy}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Kind="Update" />
|
||||
<materialDesign:PackIcon
|
||||
Margin="0,0,8,0"
|
||||
VerticalAlignment="Center"
|
||||
Kind="Update" />
|
||||
<TextBlock Style="{StaticResource ToolbarItem}" Text="{x:Static resx:ResUI.TbSubUpdateViaProxy}" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Separator />
|
||||
<Button x:Name="btnEditProfile" ToolTip="{x:Static resx:ResUI.menuEditProfile}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon
|
||||
Margin="0,0,8,0"
|
||||
VerticalAlignment="Center"
|
||||
Kind="Edit" />
|
||||
<TextBlock Style="{StaticResource ToolbarItem}" Text="{x:Static resx:ResUI.menuEditProfile}" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Separator />
|
||||
<Button x:Name="btnSetDefaultProfile" ToolTip="{x:Static resx:ResUI.menuSetDefaultProfile}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Kind="Check" />
|
||||
<materialDesign:PackIcon
|
||||
Margin="0,0,8,0"
|
||||
VerticalAlignment="Center"
|
||||
Kind="Check" />
|
||||
<TextBlock Style="{StaticResource ToolbarItem}" Text="{x:Static resx:ResUI.TbSetDefaultProfile}" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Separator />
|
||||
<Button x:Name="btnProfileQrcode" ToolTip="{x:Static resx:ResUI.menuProfileQrcode}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Kind="QrcodePlus" />
|
||||
<materialDesign:PackIcon
|
||||
Margin="0,0,8,0"
|
||||
VerticalAlignment="Center"
|
||||
Kind="QrcodePlus" />
|
||||
<TextBlock Style="{StaticResource ToolbarItem}" Text="{x:Static resx:ResUI.menuProfileQrcode}" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
@@ -107,7 +132,7 @@
|
||||
Background="{DynamicResource PrimaryHueLightBrush}"
|
||||
CornerRadius="4"
|
||||
DockPanel.Dock="Left"
|
||||
Visibility="{Binding Path=isActive, Converter={StaticResource BoolToVisConverter}}" />
|
||||
Visibility="{Binding Path=IsActive, Converter={StaticResource BoolToVisConverter}}" />
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
@@ -160,7 +185,10 @@
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Kind="ChartDonut" />
|
||||
<materialDesign:PackIcon
|
||||
Margin="0,0,8,0"
|
||||
VerticalAlignment="Center"
|
||||
Kind="ChartDonut" />
|
||||
<TextBlock
|
||||
Padding="4,0,4,0"
|
||||
Style="{StaticResource ListItemSubTitle}"
|
||||
|
||||
@@ -58,6 +58,7 @@ namespace ClashN.Views
|
||||
this.BindCommand(ViewModel, vm => vm.AddProfileCmd, v => v.btnAddProfile).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.AddProfileViaClipboardCmd, v => v.btnAddProfileViaClipboard).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.SubUpdateViaProxyCmd, v => v.btnSubUpdateViaProxy).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.EditProfileCmd, v => v.btnEditProfile).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.SetDefaultProfileCmd, v => v.btnSetDefaultProfile).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.ProfileQrcodeCmd, v => v.btnProfileQrcode).DisposeWith(disposables);
|
||||
|
||||
@@ -96,7 +97,7 @@ namespace ClashN.Views
|
||||
|
||||
private void lstProfiles_PreviewMouseDoubleClick(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
ViewModel?.EditProfile(false);
|
||||
ViewModel?.SetDefaultProfile();
|
||||
}
|
||||
|
||||
#region Drag and Drop
|
||||
|
||||
@@ -30,7 +30,10 @@
|
||||
<ToolBarTray Margin="0,8,0,8" DockPanel.Dock="Top">
|
||||
<ToolBar ClipToBounds="True" Style="{StaticResource MaterialDesignToolBar}">
|
||||
<Button Width="1" Visibility="Hidden">
|
||||
<materialDesign:PackIcon Kind="ContentSave" />
|
||||
<materialDesign:PackIcon
|
||||
Margin="0,0,8,0"
|
||||
VerticalAlignment="Center"
|
||||
Kind="ContentSave" />
|
||||
</Button>
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
@@ -98,13 +101,13 @@
|
||||
<DockPanel>
|
||||
<ListView
|
||||
x:Name="lstProxyGroups"
|
||||
Margin="0, 0, 5, 0"
|
||||
Margin="0,0,5,0"
|
||||
BorderThickness="0"
|
||||
DockPanel.Dock="Left"
|
||||
Style="{StaticResource MaterialDesignListView}"
|
||||
ItemContainerStyle="{StaticResource lvItemSelected}"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Visible">
|
||||
ScrollViewer.VerticalScrollBarVisibility="Visible"
|
||||
Style="{StaticResource MaterialDesignListView}">
|
||||
<ListView.ContextMenu>
|
||||
<ContextMenu Style="{StaticResource DefMenu}">
|
||||
<MenuItem x:Name="menuProxiesReload" Header="{x:Static resx:ResUI.menuProxiesReload}" />
|
||||
@@ -118,7 +121,7 @@
|
||||
</ListView.ItemsPanel>
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border Width="160" Padding="0">
|
||||
<Border Width="200" Padding="0">
|
||||
<DockPanel>
|
||||
<Grid Grid.Column="0" Margin="4">
|
||||
<Grid.RowDefinitions>
|
||||
@@ -146,10 +149,10 @@
|
||||
<ListView
|
||||
x:Name="lstProxyDetails"
|
||||
BorderThickness="0"
|
||||
Style="{StaticResource MaterialDesignListView}"
|
||||
ItemContainerStyle="{StaticResource lvItemSelected}"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Visible">
|
||||
ScrollViewer.VerticalScrollBarVisibility="Visible"
|
||||
Style="{StaticResource MaterialDesignListView}">
|
||||
<ListView.ContextMenu>
|
||||
<ContextMenu Style="{StaticResource DefMenu}">
|
||||
<MenuItem x:Name="menuProxiesDelaytestPart" Header="{x:Static resx:ResUI.menuProxiesDelaytestPart}" />
|
||||
@@ -163,7 +166,7 @@
|
||||
</ListView.ItemsPanel>
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border Width="160" Padding="0" KeyDown="ProxyItem_KeyDown">
|
||||
<Border Width="200" Padding="0">
|
||||
<DockPanel>
|
||||
<Border
|
||||
Width="5"
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace ClashN.Views
|
||||
InitializeComponent();
|
||||
ViewModel = new ProxiesViewModel();
|
||||
Locator.CurrentMutable.RegisterLazySingleton(() => ViewModel, typeof(ProxiesViewModel));
|
||||
lstProxyDetails.PreviewMouseDoubleClick += lstProxyDetails_PreviewMouseDoubleClick;
|
||||
|
||||
this.WhenActivated(disposables =>
|
||||
{
|
||||
@@ -54,18 +55,10 @@ namespace ClashN.Views
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private object? lastProxyItemKeyDownSender;
|
||||
private int lastProxyItemKeyDownTimestamp;
|
||||
private void ProxyItem_KeyDown(object sender, KeyEventArgs e)
|
||||
private void lstProxyDetails_PreviewMouseDoubleClick(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (sender == lastProxyItemKeyDownSender && e.Timestamp - lastProxyItemKeyDownTimestamp < 500)
|
||||
{
|
||||
ViewModel?.SetActiveProxy();
|
||||
}
|
||||
|
||||
lastProxyItemKeyDownSender = sender;
|
||||
lastProxyItemKeyDownTimestamp = e.Timestamp;
|
||||
ViewModel?.SetActiveProxy();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,10 @@
|
||||
<ToolBar ClipToBounds="True" Style="{StaticResource MaterialDesignToolBar}">
|
||||
<Button x:Name="btnSave">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Kind="ContentSave" />
|
||||
<materialDesign:PackIcon
|
||||
Margin="0,0,8,0"
|
||||
VerticalAlignment="Center"
|
||||
Kind="ContentSave" />
|
||||
<TextBlock Style="{StaticResource ToolbarItem}" Text="{x:Static resx:ResUI.TbSave}" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
@@ -7,39 +7,39 @@
|
||||
<UseWPF>true</UseWPF>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<ApplicationIcon>clashN.ico</ApplicationIcon>
|
||||
<ApplicationIcon>ClashN.ico</ApplicationIcon>
|
||||
<Copyright>Copyright © 2019-2023 (GPLv3)</Copyright>
|
||||
<FileVersion>2.14</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MaterialDesignThemes" Version="4.6.1" />
|
||||
<PackageReference Include="MaterialDesignThemes" Version="4.8.0" />
|
||||
<PackageReference Include="Hardcodet.NotifyIcon.Wpf" Version="1.1.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="NHotkey" Version="2.1.0" />
|
||||
<PackageReference Include="NHotkey.Wpf" Version="2.1.0" />
|
||||
<PackageReference Include="QRCoder.Xaml" Version="1.4.3" />
|
||||
<PackageReference Include="TaskScheduler" Version="2.10.1" />
|
||||
<PackageReference Include="YamlDotNet" Version="12.0.2" />
|
||||
<PackageReference Include="ZXing.Net.Bindings.Windows.Compatibility" Version="0.16.10" />
|
||||
<PackageReference Include="YamlDotNet" Version="13.0.1" />
|
||||
<PackageReference Include="ZXing.Net.Bindings.Windows.Compatibility" Version="0.16.12" />
|
||||
<PackageReference Include="ReactiveUI.Fody" Version="18.3.1" />
|
||||
<PackageReference Include="ReactiveUI.Validation" Version="3.0.1" />
|
||||
<PackageReference Include="ReactiveUI.WPF" Version="18.3.1" />
|
||||
<PackageReference Include="Splat.NLog" Version="14.4.1" />
|
||||
<PackageReference Include="Splat.NLog" Version="14.6.8" />
|
||||
<PackageReference Include="System.Reactive" Version="5.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="clashN.ico" />
|
||||
<None Remove="ClashN.ico" />
|
||||
<AdditionalFiles Include="app.manifest" />
|
||||
<EmbeddedResource Include="clashN.ico">
|
||||
<EmbeddedResource Include="ClashN.ico">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Sample\SampleMixin.yaml" />
|
||||
<EmbeddedResource Include="Sample\SampleTun.yaml" />
|
||||
<ProjectReference Include="..\..\..\v2rayN\v2rayN\PacLib\PacLib.csproj" />
|
||||
<Resource Include="clashN.ico">
|
||||
<Resource Include="ClashN.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
<Compile Update="Resx\ResUI.Designer.cs">
|
||||
|
||||
Reference in New Issue
Block a user