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
This commit is contained in:
@@ -24,7 +24,6 @@ namespace Shadowsocks.View
|
||||
#region chart
|
||||
List<float> inboundPoints = 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);
|
||||
TextAnnotation inboundAnnotation = new TextAnnotation();
|
||||
TextAnnotation outboundAnnotation = new TextAnnotation();
|
||||
@@ -59,6 +58,7 @@ namespace Shadowsocks.View
|
||||
|
||||
private void controller_TrafficChanged(object sender, EventArgs e)
|
||||
{
|
||||
long maxSpeed = 0;
|
||||
inboundPoints.Clear();
|
||||
outboundPoints.Clear();
|
||||
foreach (var trafficPerSecond in controller.traffic)
|
||||
@@ -218,7 +218,7 @@ namespace Shadowsocks.View
|
||||
config.SetFont(LogMessageTextBox.Font);
|
||||
config.SetBackgroundColor(LogMessageTextBox.BackColor);
|
||||
config.SetTextColor(LogMessageTextBox.ForeColor);
|
||||
if(!(config.maximized = WindowState == FormWindowState.Maximized)) {
|
||||
if (WindowState != FormWindowState.Minimized && !(config.maximized = WindowState == FormWindowState.Maximized)) {
|
||||
config.top = Top;
|
||||
config.left = Left;
|
||||
config.height = Height;
|
||||
|
||||
@@ -439,6 +439,7 @@ namespace Shadowsocks.View
|
||||
{
|
||||
configForm = new ConfigForm(controller);
|
||||
configForm.Show();
|
||||
configForm.Activate();
|
||||
configForm.FormClosed += configForm_FormClosed;
|
||||
}
|
||||
}
|
||||
@@ -453,6 +454,7 @@ namespace Shadowsocks.View
|
||||
{
|
||||
proxyForm = new ProxyForm(controller);
|
||||
proxyForm.Show();
|
||||
proxyForm.Activate();
|
||||
proxyForm.FormClosed += proxyForm_FormClosed;
|
||||
}
|
||||
}
|
||||
@@ -463,6 +465,7 @@ namespace Shadowsocks.View
|
||||
{
|
||||
LogForm f = new LogForm(controller, Logging.LogFilePath);
|
||||
f.Show();
|
||||
f.Activate();
|
||||
f.FormClosed += logForm_FormClosed;
|
||||
|
||||
logForms.Add(f);
|
||||
|
||||
Reference in New Issue
Block a user