Skip to content

Commit 3e2e30b

Browse files
committed
1.1.5正式版更新
1 parent b8293d2 commit 3e2e30b

File tree

4 files changed

+79
-80
lines changed

4 files changed

+79
-80
lines changed

MainForm.Designer.cs

Lines changed: 32 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

MainForm.cs

Lines changed: 46 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.ComponentModel;
4-
using System.Data;
52
using System.Drawing;
6-
using System.Linq;
7-
using System.Text;
8-
using System.Threading.Tasks;
93
using System.Windows.Forms;
104
using System.Configuration;
115
using System.IO;
@@ -88,7 +82,6 @@ private void Welcome()
8882
config.AppSettings.Settings.Remove("IsFirstRun");
8983
config.AppSettings.Settings.Add("IsFirstRun", "false");
9084
config.Save();
91-
9285
}
9386
private void CheckOpacity()
9487
{
@@ -124,28 +117,20 @@ private void CheckLiteMode()
124117
{
125118
//上次退出前未开启轻模式
126119
LiteMode.Checked = false;
127-
128-
Create.Text = "创建窗口 (Ctrl+N)";
129-
//Close.Text不变
130-
Save.Text = "保存文件 (Ctrl+S)";
131-
Import.Text = "导入文件 (Ctrl+O)";
120+
LiteShortcut(false);
132121
}
133122
else if (ConfigurationManager.AppSettings["IsLiteMode"].ToLower() == "true")
134123
{
135124
//上次退出前开启了轻模式
136125
LiteMode.Checked = true;
137-
138-
Create.Text = "创建窗口 (N)";
139-
//Close.Text不变
140-
Save.Text = "保存文件 (S)";
141-
Import.Text = "导入文件 (O)";
126+
LiteShortcut(true);
142127
}
143128
}
144129

145130
private void Create_Click(object sender, EventArgs e)
146131
{
147-
if (File.Exists(Define.EXENAME))
148-
Process.Start(Define.EXENAME);
132+
if (File.Exists(Application.ExecutablePath))
133+
Process.Start(Application.ExecutablePath);
149134
else
150135
MessageBox.Show("创建失败,可能是文件路径损坏导致的,重新安装可能可以解决哦");
151136
}
@@ -337,13 +322,7 @@ private void LiteMode_Click(object sender, EventArgs e)
337322
config.Save();
338323

339324
LiteMode.Checked = !LiteMode.Checked;
340-
Create.Text = "创建窗口 (N)";
341-
//Close.Text不变
342-
Save.Text = "保存文件 (S)";
343-
Export.Text = "导出文件 (S)";
344-
Import.Text = "导入文件 (O)";
345-
ImproveOpacity.Text = "透明度+ (I)";
346-
ReduceOpacity.Text = "透明度- (D)";
325+
LiteShortcut(true);
347326
}
348327
else
349328
{
@@ -354,13 +333,7 @@ private void LiteMode_Click(object sender, EventArgs e)
354333
config.Save();
355334

356335
LiteMode.Checked = !LiteMode.Checked;
357-
Create.Text = "创建窗口 (Ctrl+N)";
358-
//Close.Text不变
359-
Save.Text = "保存文件 (Ctrl+S)";
360-
Export.Text = "导出文件 (Alt+S)";
361-
Import.Text = "导入文件 (Ctrl+O)";
362-
ImproveOpacity.Text = "透明度+ (Ctrl+Alt+I)";
363-
ReduceOpacity.Text = "透明度- (Ctrl+Alt+D)";
336+
LiteShortcut(false);
364337
}
365338
}
366339
private void Update_Click(object sender, EventArgs e)
@@ -381,7 +354,7 @@ private void About_Click(object sender, EventArgs e)
381354
}
382355
private void WhatIsLiteMode_Click(object sender, EventArgs e)
383356
{
384-
MessageBox.Show($@"在轻模式下{Define.NAME}会智能优化提示信息,增加办公效率");
357+
MessageBox.Show($@"在轻模式下{Define.NAME}会智能优化提示信息,提升办公效率,建议开启");
385358
}
386359
private void PrivacyPolicy_Click(object sender, EventArgs e)
387360
{
@@ -445,18 +418,24 @@ private void MainForm_KeyDown(object sender, KeyEventArgs e)
445418
TextBox.ContextMenuStrip = TextBox.ContextMenuStrip == null ? TextMenu : null; //切换右键(普通)/(功能)菜单
446419
else if (e.Control && e.KeyCode == Keys.N)
447420
Create_Click(Create, new EventArgs()); //创建窗口
448-
else if (e.KeyCode == Keys.Escape)
421+
else if (e.Control && e.KeyCode == Keys.W)
449422
Close_Click(Close, new EventArgs()); //关闭窗口
450423
else if (e.Control && e.KeyCode == Keys.S)
451424
Save_Click(Save, new EventArgs()); //保存文件
452425
else if (e.Alt && e.KeyCode == Keys.S)
453426
Export_Click(Export, new EventArgs()); //导出文件(另存为)
454427
else if (e.Control && e.KeyCode == Keys.O)
455428
Import_Click(Import, new EventArgs()); //导入文件
456-
else if (e.Control && e.Alt && e.KeyCode == Keys.I)
429+
else if (e.Control && e.Alt && e.KeyCode == Keys.U)
457430
ImproveOpacity_Click(ImproveOpacity, new EventArgs()); //透明度+
458431
else if (e.Control && e.Alt && e.KeyCode == Keys.D)
459432
ReduceOpacity_Click(ReduceOpacity, new EventArgs()); //透明度-
433+
else if (e.Control && e.Alt && e.KeyCode == Keys.T)
434+
AlwaysTop_Click(AlwaysTop, new EventArgs()); //置顶窗口
435+
else if (e.Control && e.Alt && e.KeyCode == Keys.L)
436+
LockTextBox_Click(LockTextBox, new EventArgs()); //锁定输入
437+
else if (e.Control && e.Alt && e.KeyCode == Keys.B)
438+
DarkMode_Click(DarkMode, new EventArgs()); //夜间模式
460439
}
461440
private void TextMenu_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
462441
{
@@ -465,14 +444,13 @@ private void TextMenu_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
465444

466445
if (e.Control && e.KeyCode == Keys.N)
467446
Create_Click(Create, new EventArgs()); //创建窗口
468-
else if (e.KeyCode == Keys.Escape)
447+
else if (e.Control && e.KeyCode == Keys.W)
469448
Close_Click(Close, new EventArgs()); //关闭窗口
470449
else if (e.Control && e.KeyCode == Keys.S)
471450
Save_Click(Save, new EventArgs()); //保存文件
472451
else if (e.Control && e.KeyCode == Keys.O)
473452
Import_Click(Import, new EventArgs()); //导入文件
474453
}
475-
476454
//文件未保存标记
477455
private void TextBox_TextChanged(object sender, EventArgs e)
478456
{
@@ -482,7 +460,6 @@ private void TextBox_TextChanged(object sender, EventArgs e)
482460
Define.CHANGEMARK = true;
483461
}
484462
}
485-
486463
//导入
487464
private void ImportFile()
488465
{
@@ -515,6 +492,36 @@ private void ImportFile()
515492
this.Text = Path.GetFileName(Define.FILEPATH);
516493
Define.CHANGEMARK = false;
517494
}
495+
//轻模式热键显示
496+
private void LiteShortcut(bool turnOn)
497+
{
498+
if (turnOn)
499+
{
500+
Create.Text = "创建窗口 (N)";
501+
Close.Text = "关闭窗口 (W)";
502+
Save.Text = "保存文件 (S)";
503+
Export.Text = "导出文件 (S)";
504+
Import.Text = "导入文件 (O)";
505+
ImproveOpacity.Text = "透明度+ (U)";
506+
ReduceOpacity.Text = "透明度- (D)";
507+
AlwaysTop.Text = "置顶窗口 (T)";
508+
LockTextBox.Text = "锁定输入 (L)";
509+
DarkMode.Text = "夜间模式 (B)";
510+
}
511+
else
512+
{
513+
Create.Text = "创建窗口 (Ctrl+N)";
514+
Close.Text = "关闭窗口 (Ctrl+W)";
515+
Save.Text = "保存文件 (Ctrl+S)";
516+
Export.Text = "导出文件 (Alt+S)";
517+
Import.Text = "导入文件 (Ctrl+O)";
518+
ImproveOpacity.Text = "透明度+ (Ctrl+Alt+U)";
519+
ReduceOpacity.Text = "透明度- (Ctrl+Alt+D)";
520+
AlwaysTop.Text = "置顶窗口 (Ctrl+Alt+T)";
521+
LockTextBox.Text = "锁定输入 (Ctrl+Alt+L)";
522+
DarkMode.Text = "夜间模式 (Ctrl+Alt+B)";
523+
}
524+
}
518525
//项目信息
519526
private void AboutMe()
520527
{

PrivacyForm.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.ComponentModel;
4-
using System.Data;
5-
using System.Drawing;
6-
using System.Linq;
7-
using System.Text;
8-
using System.Threading.Tasks;
9-
using System.Windows.Forms;
1+
using System.Windows.Forms;
102

113
namespace Vight_Note
124
{
-18 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)