From b1a82d95c2aeeffb1a9f4733eb526ed9349fbfe2 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Mon, 20 Mar 2023 15:23:29 +0800 Subject: [PATCH] Hide title when title width is equal to 0 --- v2rayN/v2rayN/Views/MainWindow.xaml.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/v2rayN/v2rayN/Views/MainWindow.xaml.cs b/v2rayN/v2rayN/Views/MainWindow.xaml.cs index 4483b65a..3f0fb6e1 100644 --- a/v2rayN/v2rayN/Views/MainWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/MainWindow.xaml.cs @@ -197,7 +197,7 @@ namespace v2rayN.Views { WindowState = WindowState.Minimized; } - + if (!_config.guiItem.enableHWA) { RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly; @@ -445,8 +445,15 @@ namespace v2rayN.Views var item2 = (MyDGTextColumn)lstProfiles.Columns[k]; if (item2.ExName == item.Name) { - item2.Width = item.Width; - item2.DisplayIndex = i + 1; + if (item.Width <= 0) + { + item2.Visibility = Visibility.Hidden; + } + else + { + item2.Width = item.Width; + item2.DisplayIndex = i + 1; + } } } } @@ -471,7 +478,7 @@ namespace v2rayN.Views lvColumnItem.Add(new() { Name = item2.ExName, - Width = Convert.ToInt32(item2.ActualWidth), + Width = item2.Visibility == Visibility.Visible ? Convert.ToInt32(item2.ActualWidth) : 0, Index = item2.DisplayIndex }); }