From 006c98e5650b530e5220f279c1e803fefe69d40d Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期二, 25 十一月 2025 15:47:33 +0800
Subject: [PATCH] 优化一些东西;

---
 Plugin.TsExecution/TsExecution.xaml.cs |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/Plugin.TsExecution/TsExecution.xaml.cs b/Plugin.TsExecution/TsExecution.xaml.cs
index da56cd3..447b893 100644
--- a/Plugin.TsExecution/TsExecution.xaml.cs
+++ b/Plugin.TsExecution/TsExecution.xaml.cs
@@ -122,6 +122,10 @@
             }
         }
 
+        public List<double> FontSizeSource { get; set; } = new List<double> {
+            10,11,12,13,14,15,16,17,18,19,20
+        };
+
         private Pie pie;
         private string CountIniPath;
         private bool IsOptRequirePassword;
@@ -533,6 +537,10 @@
             {
                 panel.Columns = 1;
             }
+            else if (tsSockets.Count > 0 && (tsSockets.Count % 3) == 0)
+            {
+                panel.Columns = 3;
+            }
             else
             {
                 panel.Columns = 2;
@@ -568,6 +576,9 @@
         {
             pass = Convert.ToInt32(IniFileHelper.ReadIniData("Count", "Pass", "0", CountIniPath));
             fail = Convert.ToInt32(IniFileHelper.ReadIniData("Count", "Fail", "0", CountIniPath));
+            var fontSize = Convert.ToDouble(IniFileHelper.ReadIniData("Config", "TableFontSize", "12", CountIniPath));
+            this.Resources["tableFontSize"] = fontSize;
+            CbFontSize.SelectedItem = fontSize;
         }
 
         private string csvDir;
@@ -1434,5 +1445,21 @@
         {
 
         }
+
+        private void CbFontSize_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            try
+            {
+                if (e.AddedItems != null && e.AddedItems.Count > 0)
+                {
+                    var fontSize = (double)e.AddedItems[0];
+                    this.Resources["tableFontSize"] = fontSize;
+                    IniFileHelper.WriteIniData("Config", "TableFontSize", fontSize.ToString(), CountIniPath);
+                }
+            }
+            catch
+            {
+            }
+        }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1