Browse Source

日志窗口支持记录最大化显示状态

tags/3.2
金黎明 8 years ago
parent
commit
6116388262
No known key found for this signature in database GPG Key ID: 278A6C7095AD90F2
2 changed files with 11 additions and 4 deletions
  1. +2
    -0
      shadowsocks-csharp/Model/LogViewerConfig.cs
  2. +9
    -4
      shadowsocks-csharp/View/LogForm.cs

+ 2
- 0
shadowsocks-csharp/Model/LogViewerConfig.cs View File

@@ -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.


+ 9
- 4
shadowsocks-csharp/View/LogForm.cs View File

@@ -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);
}


Loading…
Cancel
Save