Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
LovelyWei committed Feb 18, 2020
1 parent c39ae5f commit 11afbc9
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions Netch/Forms/MainForm.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Netch.Controllers;
using Netch.Controllers;
using System;
using System.Collections.Generic;
using System.Diagnostics;
Expand Down Expand Up @@ -791,6 +791,26 @@ private void ControlButton_Click(object sender, EventArgs e)
// UsedBandwidthLabel.Visible = UploadSpeedLabel.Visible = DownloadSpeedLabel.Visible = true;
// MainController.pNFController.OnBandwidthUpdated += OnBandwidthUpdated;

// 如果勾选启动后最小化
if (Global.Settings.MinimizeWhenStarted)
{
WindowState = FormWindowState.Minimized;
NotifyIcon.Visible = true;

if (IsFirstOpened)
{
// 显示提示语
NotifyIcon.ShowBalloonTip(5,
UpdateChecker.Name,
Utils.i18N.Translate("Netch is now minimized to the notification bar, double click this icon to restore."),
ToolTipIcon.Info);

IsFirstOpened = false;
}

Hide();
}

ControlButton.Enabled = true;
ControlButton.Text = Utils.i18N.Translate("Stop");

Expand Down Expand Up @@ -836,26 +856,6 @@ private void ControlButton_Click(object sender, EventArgs e)
}

State = Models.State.Started;

// 如果勾选启动后最小化
if (Global.Settings.MinimizeWhenStarted)
{
WindowState = FormWindowState.Minimized;
NotifyIcon.Visible = true;

if (IsFirstOpened)
{
// 显示提示语
NotifyIcon.ShowBalloonTip(5,
UpdateChecker.Name,
Utils.i18N.Translate("Netch is now minimized to the notification bar, double click this icon to restore."),
ToolTipIcon.Info);

IsFirstOpened = false;
}

Hide();
}
}
else
{
Expand Down

0 comments on commit 11afbc9

Please sign in to comment.