Skip to content

Commit 7c5f7f0

Browse files
committedJul 17, 2021
1.1.6更新
1 parent 25479e8 commit 7c5f7f0

6 files changed

+56
-44
lines changed
 

‎AboutForm.Designer.cs

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎AboutForm.cs

+19-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Diagnostics;
2+
using System.Drawing;
23
using System.Windows.Forms;
34

45
namespace Vight_Note
@@ -12,13 +13,30 @@ public static class Define
1213
public const string EMAIL = "Zeus6_6@163.com";
1314
}
1415

15-
public AboutForm()
16+
public AboutForm(bool isDarkMode)
1617
{
1718
InitializeComponent();
1819

20+
//设定暗色模式
21+
CheckDarkMode(isDarkMode);
22+
1923
//显示版本号
2024
VersionLabel.Text = "版本号: " + Application.ProductVersion;
2125
}
26+
private void CheckDarkMode(bool isDarkMode)
27+
{
28+
if (isDarkMode)
29+
{
30+
BackColor = Color.Black;
31+
ForeColor = Color.Gray;
32+
MainPageLinkLabel.LinkColor = Color.Red;
33+
MainPageLinkLabel.ActiveLinkColor = Color.Blue;
34+
OpenSourceLinkLabel.LinkColor = Color.Red;
35+
OpenSourceLinkLabel.ActiveLinkColor = Color.Blue;
36+
EmailLinkLabel.LinkColor = Color.Red;
37+
EmailLinkLabel.ActiveLinkColor = Color.Blue;
38+
}
39+
}
2240

2341
private void MainPageLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
2442
{

‎MainForm.Designer.cs

+13-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎MainForm.cs

+5-29
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,8 @@ private void CheckOpacity()
8383
}
8484
private void CheckDarkMode()
8585
{
86-
//判断IsDarkMode的值(位于App.config中)
87-
if (!Properties.Settings.Default.IsDarkMode)
86+
if (Properties.Settings.Default.IsDarkMode)
8887
{
89-
//上次退出前未开启暗色模式
90-
DarkMode.Checked = false;
91-
92-
TextBox.BackColor = Color.White;
93-
TextBox.ForeColor = Color.Black;
94-
TextMenu.BackColor = Color.White;
95-
}
96-
else
97-
{
98-
//上次退出前开启了暗色模式
9988
DarkMode.Checked = true;
10089

10190
TextBox.BackColor = Color.Black;
@@ -105,16 +94,8 @@ private void CheckDarkMode()
10594
}
10695
private void CheckLiteMode()
10796
{
108-
//判断IsLiteMode的值(位于App.config中)
109-
if (!Properties.Settings.Default.IsLiteMode)
110-
{
111-
//上次退出前未开启轻模式
112-
LiteMode.Checked = false;
113-
LiteShortcut(false);
114-
}
115-
else
97+
if (Properties.Settings.Default.IsLiteMode)
11698
{
117-
//上次退出前开启了轻模式
11899
LiteMode.Checked = true;
119100
LiteShortcut(true);
120101
}
@@ -337,8 +318,7 @@ private void About_Click(object sender, EventArgs e)
337318
}
338319
private void AboutDeveloper_Click(object sender, EventArgs e)
339320
{
340-
AboutForm aboutDeveloperForm = new AboutForm();
341-
aboutDeveloperForm.Show();
321+
AboutMe();
342322
}
343323
private void WhatIsLiteMode_Click(object sender, EventArgs e)
344324
{
@@ -370,7 +350,7 @@ private void PrivacyPolicy_Click(object sender, EventArgs e)
370350
Process.Start(Define.POLICY_URL);
371351
else
372352
{
373-
PrivacyForm privacyForm = new PrivacyForm();
353+
PrivacyForm privacyForm = new PrivacyForm(DarkMode.Checked);
374354
privacyForm.ShowDialog();
375355
}
376356
}
@@ -379,13 +359,9 @@ private void PrivacyPolicy_Click(object sender, EventArgs e)
379359
private void TextBox_DragEnter(object sender, DragEventArgs e)
380360
{
381361
if (e.Data.GetDataPresent(DataFormats.FileDrop))
382-
{
383362
e.Effect = DragDropEffects.Move;
384-
}
385363
else
386-
{
387364
e.Effect = DragDropEffects.None;
388-
}
389365
}
390366
private void TextBox_DragDrop(object sender, DragEventArgs e)
391367
{
@@ -519,7 +495,7 @@ private void LiteShortcut(bool turnOn)
519495
//项目信息
520496
private void AboutMe()
521497
{
522-
AboutForm aboutForm = new AboutForm();
498+
AboutForm aboutForm = new AboutForm(DarkMode.Checked);
523499
aboutForm.ShowDialog();
524500
}
525501
}

‎PrivacyForm.Designer.cs

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎PrivacyForm.cs

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,29 @@
1-
using System.Windows.Forms;
1+
using System.Drawing;
2+
using System.Windows.Forms;
23

34
namespace Vight_Note
45
{
56
public partial class PrivacyForm : Form
67
{
7-
public PrivacyForm()
8+
public PrivacyForm(bool isDarkMode)
89
{
910
InitializeComponent();
1011

12+
//设定暗色模式
13+
CheckDarkMode(isDarkMode);
14+
15+
//显示隐私政策内容
1116
PrivacyBox.Text = Properties.Resources.Vight_Note_Privacy_Policy;
1217
PrivacyBox.Select(0, 0);
1318
}
19+
private void CheckDarkMode(bool isDarkMode)
20+
{
21+
if (isDarkMode)
22+
{
23+
PrivacyBox.BackColor = Color.Black;
24+
PrivacyBox.ForeColor = Color.Gray;
25+
}
26+
}
1427

1528
//热键
1629
private void PrivacyBox_KeyDown(object sender, KeyEventArgs e)

0 commit comments

Comments
 (0)
Please sign in to comment.