From 6116388262130038e370344765cc0fd38f83f845 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=87=91=E9=BB=8E=E6=98=8E?= Date: Sat, 13 Aug 2016 09:52:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=BF=97=E7=AA=97=E5=8F=A3=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E8=AE=B0=E5=BD=95=E6=9C=80=E5=A4=A7=E5=8C=96=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shadowsocks-csharp/Model/LogViewerConfig.cs | 2 ++ shadowsocks-csharp/View/LogForm.cs | 13 +++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/shadowsocks-csharp/Model/LogViewerConfig.cs b/shadowsocks-csharp/Model/LogViewerConfig.cs index 4fe8f828..56dc78a2 100644 --- a/shadowsocks-csharp/Model/LogViewerConfig.cs +++ b/shadowsocks-csharp/Model/LogViewerConfig.cs @@ -19,6 +19,7 @@ namespace Shadowsocks.Model public int height; public int top; public int left; + public bool maximized; public LogViewerConfig() { @@ -33,6 +34,7 @@ namespace Shadowsocks.Model height = 400; left = GetBestLeft(); top = GetBestTop(); + maximized = true; } // Use GetBestTop() and GetBestLeft() to ensure the log viwer form can be always display IN screen. diff --git a/shadowsocks-csharp/View/LogForm.cs b/shadowsocks-csharp/View/LogForm.cs index d0818454..cbfa4764 100644 --- a/shadowsocks-csharp/View/LogForm.cs +++ b/shadowsocks-csharp/View/LogForm.cs @@ -190,6 +190,9 @@ namespace Shadowsocks.View Width = config.width; Top = config.GetBestTop(); Left = config.GetBestLeft(); + if(config.maximized) { + WindowState = FormWindowState.Maximized; + } topMostTriggerLock = true; TopMost = TopMostMenuItem.Checked = TopMostCheckBox.Checked = topMostTrigger; @@ -215,10 +218,12 @@ namespace Shadowsocks.View config.SetFont(LogMessageTextBox.Font); config.SetBackgroundColor(LogMessageTextBox.BackColor); config.SetTextColor(LogMessageTextBox.ForeColor); - config.top = Top; - config.left = Left; - config.height = Height; - config.width = Width; + if(!(config.maximized = WindowState == FormWindowState.Maximized)) { + config.top = Top; + config.left = Left; + config.height = Height; + config.width = Width; + } controller.SaveLogViewerConfig(config); }