From d6189e2ea6ee7d4a286feae686799b49762342fa Mon Sep 17 00:00:00 2001 From: ChsBuffer <33744752+chsbuffer@users.noreply.github.com> Date: Fri, 19 Feb 2021 22:53:27 +0800 Subject: [PATCH] ProfileTableColumnCount value check --- Netch/Forms/MainForm.cs | 2 ++ Netch/Models/Setting.cs | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Netch/Forms/MainForm.cs b/Netch/Forms/MainForm.cs index 63bd5fb4..d8ced4a1 100644 --- a/Netch/Forms/MainForm.cs +++ b/Netch/Forms/MainForm.cs @@ -904,6 +904,8 @@ namespace Netch.Forms { // Load Profiles + if (Global.Settings.ProfileTableColumnCount == 0) + Global.Settings.ProfileTableColumnCount = 5; var columnCount = Global.Settings.ProfileTableColumnCount; ProfileTable.ColumnCount = profileCount >= columnCount ? columnCount : profileCount; diff --git a/Netch/Models/Setting.cs b/Netch/Models/Setting.cs index 4ecc8ee1..ca8bd167 100644 --- a/Netch/Models/Setting.cs +++ b/Netch/Models/Setting.cs @@ -198,6 +198,11 @@ namespace Netch.Models /// public List Profiles = new(); + /// + /// 配置最大列数 + /// + public byte ProfileTableColumnCount = 5; + /// /// 是否使用RDR内置SS /// @@ -289,11 +294,6 @@ namespace Netch.Models public bool UseProxyToUpdateSubscription = false; public V2rayConfig V2RayConfig = new(); - - /// - /// 配置最大列数 - /// - public int ProfileTableColumnCount = 5; public Setting Clone() {