Browse Source

fix bandwidthScale of the LogForm (#701)

- Revert bandwidthScale when throughput gets smaller
- Don't save coordinates when LogForm is minimized. Otherwise, we get negative values
- activate ConfigForm & ProxyForm & LogForm
tags/3.3
破娃酱 Syrone Wong 8 years ago
parent
commit
d958c5c393
2 changed files with 5 additions and 2 deletions
  1. +2
    -2
      shadowsocks-csharp/View/LogForm.cs
  2. +3
    -0
      shadowsocks-csharp/View/MenuViewController.cs

+ 2
- 2
shadowsocks-csharp/View/LogForm.cs View File

@@ -24,7 +24,6 @@ namespace Shadowsocks.View
#region chart #region chart
List<float> inboundPoints = new List<float>(); List<float> inboundPoints = new List<float>();
List<float> outboundPoints = new List<float>(); List<float> outboundPoints = new List<float>();
long maxSpeed = 0;
Tuple<float, string, long> bandwidthScale = new Tuple<float, string, long>(0, "B", 1); Tuple<float, string, long> bandwidthScale = new Tuple<float, string, long>(0, "B", 1);
TextAnnotation inboundAnnotation = new TextAnnotation(); TextAnnotation inboundAnnotation = new TextAnnotation();
TextAnnotation outboundAnnotation = new TextAnnotation(); TextAnnotation outboundAnnotation = new TextAnnotation();
@@ -59,6 +58,7 @@ namespace Shadowsocks.View
private void controller_TrafficChanged(object sender, EventArgs e) private void controller_TrafficChanged(object sender, EventArgs e)
{ {
long maxSpeed = 0;
inboundPoints.Clear(); inboundPoints.Clear();
outboundPoints.Clear(); outboundPoints.Clear();
foreach (var trafficPerSecond in controller.traffic) foreach (var trafficPerSecond in controller.traffic)
@@ -218,7 +218,7 @@ namespace Shadowsocks.View
config.SetFont(LogMessageTextBox.Font); config.SetFont(LogMessageTextBox.Font);
config.SetBackgroundColor(LogMessageTextBox.BackColor); config.SetBackgroundColor(LogMessageTextBox.BackColor);
config.SetTextColor(LogMessageTextBox.ForeColor); config.SetTextColor(LogMessageTextBox.ForeColor);
if(!(config.maximized = WindowState == FormWindowState.Maximized)) {
if (WindowState != FormWindowState.Minimized && !(config.maximized = WindowState == FormWindowState.Maximized)) {
config.top = Top; config.top = Top;
config.left = Left; config.left = Left;
config.height = Height; config.height = Height;


+ 3
- 0
shadowsocks-csharp/View/MenuViewController.cs View File

@@ -439,6 +439,7 @@ namespace Shadowsocks.View
{ {
configForm = new ConfigForm(controller); configForm = new ConfigForm(controller);
configForm.Show(); configForm.Show();
configForm.Activate();
configForm.FormClosed += configForm_FormClosed; configForm.FormClosed += configForm_FormClosed;
} }
} }
@@ -453,6 +454,7 @@ namespace Shadowsocks.View
{ {
proxyForm = new ProxyForm(controller); proxyForm = new ProxyForm(controller);
proxyForm.Show(); proxyForm.Show();
proxyForm.Activate();
proxyForm.FormClosed += proxyForm_FormClosed; proxyForm.FormClosed += proxyForm_FormClosed;
} }
} }
@@ -463,6 +465,7 @@ namespace Shadowsocks.View
{ {
LogForm f = new LogForm(controller, Logging.LogFilePath); LogForm f = new LogForm(controller, Logging.LogFilePath);
f.Show(); f.Show();
f.Activate();
f.FormClosed += logForm_FormClosed; f.FormClosed += logForm_FormClosed;
logForms.Add(f); logForms.Add(f);


Loading…
Cancel
Save