From 9eb9898b61da52fc9473eb960126ed0a1decee23 Mon Sep 17 00:00:00 2001
From: 2dust <31833384+2dust@users.noreply.github.com>
Date: Mon, 2 Dec 2024 14:40:09 +0800
Subject: [PATCH] Improve the clash connection
---
.../Views/ClashConnectionsView.axaml | 17 +++++++++++++++++
.../Views/ClashConnectionsView.axaml.cs | 15 +++++++++++++++
v2rayN/v2rayN/Views/ClashConnectionsView.xaml | 11 ++++++++++-
.../v2rayN/Views/ClashConnectionsView.xaml.cs | 14 ++++++++++++++
4 files changed, 56 insertions(+), 1 deletion(-)
diff --git a/v2rayN/v2rayN.Desktop/Views/ClashConnectionsView.axaml b/v2rayN/v2rayN.Desktop/Views/ClashConnectionsView.axaml
index dd1c94ac..7318e7de 100644
--- a/v2rayN/v2rayN.Desktop/Views/ClashConnectionsView.axaml
+++ b/v2rayN/v2rayN.Desktop/Views/ClashConnectionsView.axaml
@@ -42,6 +42,23 @@
+
+
{
@@ -42,6 +44,19 @@ namespace v2rayN.Desktop.Views
return await Task.FromResult(true);
}
+ private void BtnAutofitColumnWidth_Click(object? sender, RoutedEventArgs e)
+ {
+ AutofitColumnWidth();
+ }
+
+ private void AutofitColumnWidth()
+ {
+ foreach (var it in lstConnections.Columns)
+ {
+ it.Width = new DataGridLength(1, DataGridLengthUnitType.Auto);
+ }
+ }
+
private void btnClose_Click(object? sender, RoutedEventArgs e)
{
ViewModel?.ClashConnectionClose(false);
diff --git a/v2rayN/v2rayN/Views/ClashConnectionsView.xaml b/v2rayN/v2rayN/Views/ClashConnectionsView.xaml
index 88f6b3d1..779354e7 100644
--- a/v2rayN/v2rayN/Views/ClashConnectionsView.xaml
+++ b/v2rayN/v2rayN/Views/ClashConnectionsView.xaml
@@ -39,6 +39,16 @@
+
+
{
@@ -45,6 +47,18 @@ namespace v2rayN.Views
return await Task.FromResult(true);
}
+ private void BtnAutofitColumnWidth_Click(object sender, RoutedEventArgs e)
+ {
+ AutofitColumnWidth();
+ }
+ private void AutofitColumnWidth()
+ {
+ foreach (var it in lstConnections.Columns)
+ {
+ it.Width = new DataGridLength(1, DataGridLengthUnitType.Auto);
+ }
+ }
+
private void btnClose_Click(object sender, System.Windows.RoutedEventArgs e)
{
ViewModel?.ClashConnectionClose(false);