From 3dfd557265cce6b1c2aa6f7884958235b5d3a957 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Mon, 23 Sep 2024 15:00:25 +0800 Subject: [PATCH] Fix the problem of showing and hiding statistics columns --- v2rayN/v2rayN/Views/ProfilesView.xaml.cs | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/v2rayN/v2rayN/Views/ProfilesView.xaml.cs b/v2rayN/v2rayN/Views/ProfilesView.xaml.cs index 625dadf6..49ad8ade 100644 --- a/v2rayN/v2rayN/Views/ProfilesView.xaml.cs +++ b/v2rayN/v2rayN/Views/ProfilesView.xaml.cs @@ -338,24 +338,16 @@ namespace v2rayN.Views item2.Width = item.Width; item2.DisplayIndex = displayIndex++; } + if (item.Name.StartsWith("to")) + { + if (!_config.guiItem.enableStatistics) + { + item2.Visibility = Visibility.Hidden; + } + } } } } - - if (!_config.guiItem.enableStatistics) - { - colTodayUp.Visibility = - colTodayDown.Visibility = - colTotalUp.Visibility = - colTotalDown.Visibility = Visibility.Hidden; - } - else - { - colTodayUp.Visibility = - colTodayDown.Visibility = - colTotalUp.Visibility = - colTotalDown.Visibility = Visibility.Visible; - } } private void StorageUI()