### 2021-12-14更新
------ #### TimeClock V1.0.2112.1401 - *.[改进]针对多显示器进行便笺靠边隐藏功能的改进。
This commit is contained in:
parent
c60446a281
commit
6c1b3349ca
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,2 +1,2 @@
|
||||||
[TimeClock]
|
[TimeClock]
|
||||||
hwnd=4594100
|
hwnd=2563002
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
<root>
|
<root>
|
||||||
<list id="LastUpdateTime" Value="2021/10/18 14:39:31" />
|
<list id="LastUpdateTime" Value="2021/12/14 16:17:11" />
|
||||||
</root>
|
</root>
|
|
@ -1,4 +1,9 @@
|
||||||
### 2021-10-18更新
|
### 2021-12-14更新
|
||||||
|
------
|
||||||
|
#### TimeClock V1.0.2112.1401
|
||||||
|
- *.[改进]针对多显示器进行便笺靠边隐藏功能的改进。
|
||||||
|
|
||||||
|
### 2021-10-18更新
|
||||||
------
|
------
|
||||||
#### TimeClock V1.0.2110.1801
|
#### TimeClock V1.0.2110.1801
|
||||||
- *.[新增]便笺窗体圆角显示。
|
- *.[新增]便笺窗体圆角显示。
|
||||||
|
|
16
Source/MyTimeClock/.vs/TimeClock/project-colors.json
Normal file
16
Source/MyTimeClock/.vs/TimeClock/project-colors.json
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
"Version": 1,
|
||||||
|
"ProjectMap": {
|
||||||
|
"e546af59-27bb-4699-aa99-a6d7e738cc9d": {
|
||||||
|
"ProjectGuid": "e546af59-27bb-4699-aa99-a6d7e738cc9d",
|
||||||
|
"DisplayName": "MyTimeClock",
|
||||||
|
"ColorIndex": 0
|
||||||
|
},
|
||||||
|
"62b5c3e8-4af1-4a7f-a40b-a6186f83dbd2": {
|
||||||
|
"ProjectGuid": "62b5c3e8-4af1-4a7f-a40b-a6186f83dbd2",
|
||||||
|
"DisplayName": "TimeClock",
|
||||||
|
"ColorIndex": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"NextColorIndex": 2
|
||||||
|
}
|
Binary file not shown.
|
@ -493,8 +493,15 @@ namespace TimeClock.DbOp
|
||||||
mStor.SetAttrValue("StickyBackColor", ColorTranslator.ToHtml(StickyBackColor));
|
mStor.SetAttrValue("StickyBackColor", ColorTranslator.ToHtml(StickyBackColor));
|
||||||
mStor.SetAttrValue("Left", this.Left);
|
mStor.SetAttrValue("Left", this.Left);
|
||||||
mStor.SetAttrValue("Top", this.Top);
|
mStor.SetAttrValue("Top", this.Top);
|
||||||
mStor.SetAttrValue("Width", this.Width);
|
if (!IsMini)
|
||||||
mStor.SetAttrValue("Height", this. Height);
|
{
|
||||||
|
mStor.SetAttrValue("Width", this.Width);
|
||||||
|
mStor.SetAttrValue("Height", this.Height);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
mStor.SetAttrValue("TopMost", this.TopMost);
|
mStor.SetAttrValue("TopMost", this.TopMost);
|
||||||
mStor.SetAttrValue("Opacity", this.Opacity);
|
mStor.SetAttrValue("Opacity", this.Opacity);
|
||||||
mStor.SetAttrValue("PullOverHide", this.靠边隐藏ToolStripMenuItem.Checked);
|
mStor.SetAttrValue("PullOverHide", this.靠边隐藏ToolStripMenuItem.Checked);
|
||||||
|
@ -554,6 +561,8 @@ namespace TimeClock.DbOp
|
||||||
mStor.SelectNodeBySet();
|
mStor.SelectNodeBySet();
|
||||||
this.Location = new Point(mStor.GetAttrValue("Left", 0), mStor.GetAttrValue("Top", 0));
|
this.Location = new Point(mStor.GetAttrValue("Left", 0), mStor.GetAttrValue("Top", 0));
|
||||||
this.Size = new Size(mStor.GetAttrValue("Width", 0), mStor.GetAttrValue("Height", 0));
|
this.Size = new Size(mStor.GetAttrValue("Width", 0), mStor.GetAttrValue("Height", 0));
|
||||||
|
if (this.Height < 50) { this.Height = 300; }
|
||||||
|
if (this.Width < 50) { this.Width = 200; }
|
||||||
if (this.Top < 0) { this.Top = 0; }
|
if (this.Top < 0) { this.Top = 0; }
|
||||||
if (this.Left < 0) { this.Left = 0; }
|
if (this.Left < 0) { this.Left = 0; }
|
||||||
var screen = Screen.GetWorkingArea(this);
|
var screen = Screen.GetWorkingArea(this);
|
||||||
|
@ -608,6 +617,14 @@ namespace TimeClock.DbOp
|
||||||
dt_change = DateTime.Now;
|
dt_change = DateTime.Now;
|
||||||
isChange = true;
|
isChange = true;
|
||||||
}
|
}
|
||||||
|
private int NormalWidth = 0;
|
||||||
|
private int NormalHeight = 0;
|
||||||
|
private bool IsMini = false;
|
||||||
|
private void SaveSize()
|
||||||
|
{
|
||||||
|
NormalWidth = this.Width;
|
||||||
|
NormalHeight = this.Height;
|
||||||
|
}
|
||||||
[DllImport("User32.dll")]
|
[DllImport("User32.dll")]
|
||||||
private static extern bool PtInRect(ref Rectangle Rects, Point lpPoint);
|
private static extern bool PtInRect(ref Rectangle Rects, Point lpPoint);
|
||||||
private void Timer1_Tick(object sender, EventArgs e)
|
private void Timer1_Tick(object sender, EventArgs e)
|
||||||
|
@ -653,24 +670,54 @@ namespace TimeClock.DbOp
|
||||||
System.Drawing.Point cursorPoint = new Point(Cursor.Position.X, Cursor.Position.Y);//获取鼠标在屏幕的坐标点
|
System.Drawing.Point cursorPoint = new Point(Cursor.Position.X, Cursor.Position.Y);//获取鼠标在屏幕的坐标点
|
||||||
Rectangle Rects = new Rectangle(this.Left, this.Top, this.Left + this.Width, this.Top + this.Height);//存储当前窗体在屏幕的所在区域
|
Rectangle Rects = new Rectangle(this.Left, this.Top, this.Left + this.Width, this.Top + this.Height);//存储当前窗体在屏幕的所在区域
|
||||||
bool prInRect = PtInRect(ref Rects, cursorPoint);
|
bool prInRect = PtInRect(ref Rects, cursorPoint);
|
||||||
|
var cur_screen = Screen.FromControl(this);
|
||||||
if (prInRect)
|
if (prInRect)
|
||||||
{//当鼠标在当前窗体内
|
{//当鼠标在当前窗体内
|
||||||
if (this.Top < 0)//窗体的Top属性小于0
|
if (IsMini)
|
||||||
this.Top = 0;
|
{
|
||||||
else if (this.Left < 0)//窗体的Left属性小于0
|
IsMini = false;
|
||||||
this.Left = 0;
|
this.Size = new Size(NormalWidth, NormalHeight);
|
||||||
else if (this.Right > Screen.PrimaryScreen.WorkingArea.Width)//窗体的Right属性大于屏幕宽度
|
if (this.Top <= 0)//窗体的Top属性小于0
|
||||||
this.Left = Screen.PrimaryScreen.WorkingArea.Width - this.Width;
|
{
|
||||||
|
this.Top = 0;
|
||||||
|
}
|
||||||
|
else if (this.Left <= 0)//窗体的Left属性小于0
|
||||||
|
{
|
||||||
|
this.Left = 0;
|
||||||
|
}
|
||||||
|
else if (this.Right > cur_screen.WorkingArea.Width)//窗体的Right属性大于屏幕宽度
|
||||||
|
{
|
||||||
|
this.Left = cur_screen.WorkingArea.Width - this.Width;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int space = 8;
|
//int space = 8;
|
||||||
if (this.Top < 5) //当窗体的上边框与屏幕的顶端的距离小于5时
|
if (!IsMini)
|
||||||
this.Top = 7 - this.Height + space; //将窗体隐藏到屏幕的顶端
|
{
|
||||||
else if (this.Left < 5) //当窗体的左边框与屏幕的左端的距离小于5时
|
if (this.Top < cur_screen.WorkingArea.Top+ 5) //当窗体的上边框与屏幕的顶端的距离小于5时
|
||||||
this.Left = 5 - this.Width + space; //将窗体隐藏到屏幕的左端
|
{
|
||||||
else if (this.Right > Screen.PrimaryScreen.WorkingArea.Width - 5)//当窗体的右边框与屏幕的右端的距离小于5时
|
SaveSize(); SaveSticky(); IsMini = true;
|
||||||
this.Left = Screen.PrimaryScreen.WorkingArea.Width - 5 - space;//将窗体隐藏到屏幕的右端
|
this.Height = 8;
|
||||||
|
this.Top = 0;
|
||||||
|
//this.Top = 7 - this.Height + space; //将窗体隐藏到屏幕的顶端
|
||||||
|
}
|
||||||
|
else if (this.Left < cur_screen.WorkingArea.Left+ 5) //当窗体的左边框与屏幕的左端的距离小于5时
|
||||||
|
{
|
||||||
|
// this.Left = 5 - this.Width + space; //将窗体隐藏到屏幕的左端
|
||||||
|
SaveSize(); SaveSticky(); IsMini = true;
|
||||||
|
this.Width = 8;
|
||||||
|
this.Left = 0;
|
||||||
|
}
|
||||||
|
else if (this.Right > cur_screen.WorkingArea.Right - 5)//当窗体的右边框与屏幕的右端的距离小于5时
|
||||||
|
{
|
||||||
|
//this.Left = cur_screen.WorkingArea.Width - 5 - space;//将窗体隐藏到屏幕的右端
|
||||||
|
SaveSize(); SaveSticky(); IsMini = true;
|
||||||
|
this.Width = 8;
|
||||||
|
this.Left = cur_screen.WorkingArea.Width- this.Width;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -725,9 +772,12 @@ namespace TimeClock.DbOp
|
||||||
protected override void OnSizeChanged(EventArgs e)
|
protected override void OnSizeChanged(EventArgs e)
|
||||||
{
|
{
|
||||||
base.OnSizeChanged(e);
|
base.OnSizeChanged(e);
|
||||||
SetFormRegion();
|
if (!IsMini)
|
||||||
if (ControlBox && controlBoxManager != null)
|
{
|
||||||
controlBoxManager.FormResize();
|
SetFormRegion();
|
||||||
|
if (ControlBox && controlBoxManager != null)
|
||||||
|
controlBoxManager.FormResize();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
private void FrmSticky_SizeChanged(object sender, EventArgs e)
|
private void FrmSticky_SizeChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||||
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
|
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
|
||||||
// 方法是按如下所示使用“*”: :
|
// 方法是按如下所示使用“*”: :
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("1.0.2110.1801")]
|
[assembly: AssemblyVersion("1.0.2112.1401")]
|
||||||
[assembly: AssemblyFileVersion("1.0.2110.1801")]
|
[assembly: AssemblyFileVersion("1.0.2112.1401")]
|
Loading…
Reference in New Issue
Block a user