Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
更新至0.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
SugarMGP committed May 23, 2021
1 parent bc0f0ab commit c63e114
Show file tree
Hide file tree
Showing 7 changed files with 333 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Configurations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static class Configurations
/// <summary>
/// <see cref="SeewoHelper.UISettings"/> 配置
/// </summary>
public static readonly Configuration<UISettings> UISettings = new(Path.Combine(Constants.ConfigurationPath, "UISettings.json"), new UISettings(UIStyle.LightBlue, LogLevel.Info));
public static readonly Configuration<UISettings> UISettings = new(Path.Combine(Constants.ConfigurationPath, "UISettings.json"), new UISettings(UIStyle.LightBlue, LogLevel.Info, false));

/// <summary>
/// <see cref="SeewoHelper.UpdateCheckingConfig"/> 配置
Expand Down
3 changes: 2 additions & 1 deletion src/Forms/KeywordGettingWindow.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 21 additions & 2 deletions src/Forms/WindowMain.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 19 additions & 3 deletions src/Forms/WindowMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ private void WindowMain_Load(object sender, EventArgs e)
LoadComboBoxExtraFileSortingWay();
LoadComboBoxLogLevel();
LoadAutoCheckUpdate();
LoadHideWhenStart();
checkBoxAutoStart.Checked = AutoStartUtilities.IsAutoStart();
Program.Logger.Info($"{nameof(WindowMain)} 加载完成");
}
Expand All @@ -90,6 +91,16 @@ private void LoadComboBoxExtraFileSortingWay()
comboBoxExtraFileSortingWay.SelectedItem = _extraFileSortingWayDictionary[Configurations.FileSorterConfig.Content.ExtraFileSortingWay];
}

private void LoadHideWhenStart()
{
bool isHideWhenStart = Configurations.UISettings.Content.IsHideWhenStart;
checkBoxHideWhenStart.Checked = isHideWhenStart;
if (isHideWhenStart)
{
HideWindow();
}
}

private async void LoadAutoCheckUpdate()
{
bool isAutoCheckUpdate = Configurations.UpdateCheckingConfig.Content.IsAutoCheckUpdate;
Expand Down Expand Up @@ -183,15 +194,15 @@ private void OpenToolStripMenuItem_Click(object sender, EventArgs e)

private void ShowWindow()
{
Show();
WindowState = FormWindowState.Normal;
this.ShowInTaskbar = true;
Activate();
}

private void HideWindow()
{
Hide();
WindowState = FormWindowState.Minimized;
this.ShowInTaskbar = false;
}

private void ExitToolStripMenuItem_Click(object sender, EventArgs e)
Expand Down Expand Up @@ -243,7 +254,6 @@ protected override void WndProc(ref Message m)
{
ShowWindow();
}

base.WndProc(ref m);
}

Expand All @@ -252,5 +262,11 @@ private void CheckBoxAutoCheckUpdate_ValueChanged(object sender, bool value)
Configurations.UpdateCheckingConfig.Content = Configurations.UpdateCheckingConfig.Content with { IsAutoCheckUpdate = checkBoxAutoCheckUpdate.Checked };
Configurations.UpdateCheckingConfig.Save();
}

private void checkBoxHideWhenStart_ValueChanged(object sender, bool value)
{
Configurations.UISettings.Content = Configurations.UISettings.Content with { IsHideWhenStart = checkBoxHideWhenStart.Checked };
Configurations.UISettings.Save();
}
}
}
Loading

0 comments on commit c63e114

Please sign in to comment.