Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Aug 30, 2024
1 parent d189f4b commit 79085af
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ private void UpdateTaskHandler(bool success, string msg)
}
if (_config.uiItem.enableAutoAdjustMainLvColWidth)
{
Locator.Current.GetService<ProfilesViewModel>()?.AutofitColumnWidthAsync();
_updateView?.Invoke(EViewAction.AdjustMainLvColWidth, null);
}
}
}
Expand Down Expand Up @@ -723,7 +723,7 @@ private void RebootAsAdmin()
private void CheckUpdateN()
{
//Check for standalone windows .Net version
if (Utils.IsWindows()
if (Utils.IsWindows()
&& File.Exists(Path.Combine(Utils.StartupPath(), "wpfgfx_cor3.dll"))
&& File.Exists(Path.Combine(Utils.StartupPath(), "D3DCompiler_47_cor3.dll"))
)
Expand Down
1 change: 1 addition & 0 deletions v2rayN/v2rayN.Desktop/Views/ClashConnectionsView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
x:Name="lstConnections"
AutoGenerateColumns="False"
BorderThickness="1"
CanUserResizeColumns="True"
GridLinesVisibility="All"
HeadersVisibility="Column"
IsReadOnly="True"
Expand Down
5 changes: 5 additions & 0 deletions v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@ private async Task<bool> UpdateViewHandler(EViewAction action, object? obj)
var clipboardData = await AvaUtils.GetClipboardData(this);
ViewModel?.AddServerViaClipboardAsync(clipboardData);
break;
case EViewAction.AdjustMainLvColWidth:
Dispatcher.UIThread.Post(() =>
Locator.Current.GetService<ProfilesViewModel>()?.AutofitColumnWidthAsync(),
DispatcherPriority.Default);
break;
}

return await Task.FromResult(true);
Expand Down
1 change: 1 addition & 0 deletions v2rayN/v2rayN.Desktop/Views/RoutingRuleSettingWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
x:Name="lstRules"
AutoGenerateColumns="False"
BorderThickness="1"
CanUserResizeColumns="True"
GridLinesVisibility="All"
HeadersVisibility="Column"
IsReadOnly="True"
Expand Down
1 change: 1 addition & 0 deletions v2rayN/v2rayN.Desktop/Views/RoutingSettingWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
x:Name="lstRoutings"
AutoGenerateColumns="False"
BorderThickness="1"
CanUserResizeColumns="True"
GridLinesVisibility="All"
HeadersVisibility="Column"
IsReadOnly="True"
Expand Down
1 change: 1 addition & 0 deletions v2rayN/v2rayN.Desktop/Views/SubSettingWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
x:Name="lstSubscription"
AutoGenerateColumns="False"
BorderThickness="1"
CanUserResizeColumns="True"
GridLinesVisibility="All"
HeadersVisibility="Column"
IsReadOnly="True"
Expand Down
6 changes: 6 additions & 0 deletions v2rayN/v2rayN/Views/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,12 @@ private async Task<bool> UpdateViewHandler(EViewAction action, object? obj)
var clipboardData = WindowsUtils.GetClipboardData();
ViewModel?.AddServerViaClipboardAsync(clipboardData);
break;
case EViewAction.AdjustMainLvColWidth:
Application.Current?.Dispatcher.Invoke((() =>
{
Locator.Current.GetService<ProfilesViewModel>()?.AutofitColumnWidthAsync();
}), DispatcherPriority.Normal);
break;
}

return await Task.FromResult(true);
Expand Down

0 comments on commit 79085af

Please sign in to comment.