From 99ba399ea3f141eb1ce38dcbb5783b1535879d19 Mon Sep 17 00:00:00 2001
From: pdone <617941447@qq.com>
Date: Fri, 12 Jan 2024 14:49:00 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=BB=E7=AA=97=E5=8F=A3?=
=?UTF-8?q?=E4=BD=8D=E7=BD=AE=E8=AE=B0=E5=BF=86=20=E8=B0=83=E6=95=B4?=
=?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E4=BF=9D=E5=AD=98=E6=97=B6?=
=?UTF-8?q?=E6=9C=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
FreeControl/Main.cs | 19 +++++++++++++++++--
FreeControl/Properties/AssemblyInfo.cs | 10 +++++-----
FreeControl/Setting.cs | 13 +++++++++++--
FreeControl/Update.en.md | 4 ++++
FreeControl/Update.md | 4 ++++
FreeControl/en.FreeControl.resources.dll | Bin 40960 -> 40960 bytes
README.en.md | 6 +++---
README.md | 6 +++---
8 files changed, 47 insertions(+), 15 deletions(-)
diff --git a/FreeControl/Main.cs b/FreeControl/Main.cs
index 743fc1e..0f06868 100644
--- a/FreeControl/Main.cs
+++ b/FreeControl/Main.cs
@@ -187,7 +187,12 @@ public void InitPdone()
}
// 提取资源
ExtractResource(reload);
-
+ if (_Setting.MainWindowX != 0 || _Setting.MainWindowY != 0)
+ {
+ // 主窗口位置
+ StartPosition = FormStartPosition.Manual;
+ Location = new Point(_Setting.MainWindowX, _Setting.MainWindowY);
+ }
#region 事件绑定
// 退出时保存用户配置数据
Application.ApplicationExit += (sender, e) =>
@@ -198,9 +203,16 @@ public void InitPdone()
FormClosed += (sender, e) => Application.Exit();
// 窗口拖动
MouseDown += (sender, e) => Extend.DragWindow(Handle);
+ // 窗口位置改变
+ LocationChanged += (sender, e) =>
+ {
+ _Setting.MainWindowX = Location.X;
+ _Setting.MainWindowY = Location.Y;
+ };
ledTitle.MouseDown += (sender, e) => Extend.DragWindow(Handle);
tabHome.MouseDown += (sender, e) => Extend.DragWindow(Handle);
tabSetting.MouseDown += (sender, e) => Extend.DragWindow(Handle);
+ uiLabel1.MouseDown += (sender, e) => Extend.DragWindow(Handle);
// 关闭按钮和最小化按钮
btnClose.Click += (sender, e) => Close();
btnMini.Click += (sender, e) => WindowState = FormWindowState.Minimized;
@@ -208,7 +220,7 @@ public void InitPdone()
btnStart.Click += StartButtonClick;
// 深色模式切换
switchDarkMode.ValueChanged += SwitchDarkMode_ValueChanged;
- // 窗口大小设置
+ // scrcpy窗口大小设置
updownHeight.ValueChanged += (sender, e) => _Setting.WindowHeight = updownHeight.Value;
updownWidth.ValueChanged += (sender, e) => _Setting.WindowWidth = updownWidth.Value;
rbtnShortcuts.ValueChanged += RbtnShortcuts_ValueChanged;
@@ -440,6 +452,7 @@ private void ADBConnectCallback(IAsyncResult ar)
///
private void RunScrcpy()
{
+ SetUserData(_Setting);// 启动前保存一下配置文件
Logger.Info("scrcpy running...");
string args = "";
StartParameters.ForEach(x =>
@@ -487,6 +500,7 @@ private void RunScrcpy()
};
scrcpy.Exited += (ss, ee) =>
{
+ SetUserData(_Setting);// 关闭scrcpy后保存一下配置文件
string strOriginIme = _Setting.IMEOrigin;
if (_Setting.IME != 0 && _Setting.IMEOrigin.IsNotNull())
{
@@ -573,6 +587,7 @@ private void FromHandle(bool isStart)
_Controller?.Dispose();
Show();
Activate();
+ Focus();
}
};
Invoke(action);
diff --git a/FreeControl/Properties/AssemblyInfo.cs b/FreeControl/Properties/AssemblyInfo.cs
index e7e9b1c..6d9893a 100644
--- a/FreeControl/Properties/AssemblyInfo.cs
+++ b/FreeControl/Properties/AssemblyInfo.cs
@@ -5,12 +5,12 @@
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
-[assembly: AssemblyTitle("在PC上控制Android设备。")]//在PC上控制Android设备。
-[assembly: AssemblyDescription("在PC上控制Android设备。")]
+[assembly: AssemblyTitle("在PC上控制Android设备")]//在PC上控制Android设备。
+[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Pdone Technology Ltd.")]
[assembly: AssemblyProduct("Free Control")]
-[assembly: AssemblyCopyright("Copyright © 2023 awaw.cc")]
+[assembly: AssemblyCopyright("Copyright © 2024 awaw.cc")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -33,5 +33,5 @@
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
//[assembly: AssemblyVersion("1.0.0")]
-[assembly: AssemblyFileVersion("1.6.6")]
-[assembly: AssemblyVersion("1.6.6")]
+[assembly: AssemblyFileVersion("1.6.7")]
+[assembly: AssemblyVersion("1.6.7")]
diff --git a/FreeControl/Setting.cs b/FreeControl/Setting.cs
index aa76e5f..1b6b145 100644
--- a/FreeControl/Setting.cs
+++ b/FreeControl/Setting.cs
@@ -106,11 +106,11 @@ public class Setting
public bool AudioEnabled { get; set; } = true;
///
- /// 窗口高度
+ /// Scrcpy 窗口高度
///
public int WindowHeight { get; set; } = 0;
///
- /// 窗口宽度
+ /// Scrcpy 窗口宽度
///
public int WindowWidth { get; set; } = 0;
@@ -187,5 +187,14 @@ public List ControllerButton
/// 界面语言
///
public Lang Language { get; set; } = Lang.zh_cn;
+
+ ///
+ /// 主窗口 x坐标
+ ///
+ public int MainWindowX { get; set; } = 0;
+ ///
+ /// 主窗口 y坐标
+ ///
+ public int MainWindowY { get; set; } = 0;
}
}
diff --git a/FreeControl/Update.en.md b/FreeControl/Update.en.md
index eeeaeea..208b591 100644
--- a/FreeControl/Update.en.md
+++ b/FreeControl/Update.en.md
@@ -1,5 +1,9 @@
# Free Control Update Record
+## v1.6.7
+- Add main window location memory
+- Adjust profile save time
+
## v1.6.6
- Add i18n
- Based on scrcpy v2.3.1(x64)
diff --git a/FreeControl/Update.md b/FreeControl/Update.md
index 7bb1d17..a126b81 100644
--- a/FreeControl/Update.md
+++ b/FreeControl/Update.md
@@ -1,5 +1,9 @@
# Free Control 更新记录
+## v1.6.7
+- 增加主窗口位置记忆
+- 调整配置文件保存时机
+
## v1.6.6
- 增加多语言支持
- 基于scrcpy v2.3.1(x64)
diff --git a/FreeControl/en.FreeControl.resources.dll b/FreeControl/en.FreeControl.resources.dll
index db6667180dbc443f90fa5c5baf27b5b168534389..c7e2a8e8a8f891d379736f28aead65160d7d9971 100644
GIT binary patch
delta 271
zcmZoTz|?SnX+j5c%>4xuyG!|OwlgsJGXTK>28IR96BUIgD>Ak-E||QMF`F@CvnZ4N
z6vic!O{eYDbY;+EkY?}(lFAHeKvJ8b0!SJ&fW)mCrZccKFfcGOuraW27N1_oC~&Fy
z!>$J@8$1>oiW%y7ztEpNV}=Tg0waU;^~
H-hV~_cVSG4
delta 310
zcmW-cze@sf7{;IX&JzlXB*Z}~kGsXB!{hLl3Idm)s4Zv|5rVR)6dMmE5+q1o%llDn
zLCp>lG~5vV4HX1NOKW43ee-$X!}~t(@bEgJuyJ3W0R;O8|
zGaB#%?b2Q^F3ol5o^w}^X&nZVSQXSz6wIJ1XrUvx2pM7ZP@tN4ljEqA9?Q+
zO?ecI(By4DHzt}y9}wlPU!ZUP^)-6tnII8gLQGupI6zsrgnd+S%y)q*OIffPY|871
laU;k_#14K5=E>%tz$1%W*KcAj-B^k(-paB`dXH|0^aqn#RZ0K=
diff --git a/README.en.md b/README.en.md
index b9595ea..5170110 100644
--- a/README.en.md
+++ b/README.en.md
@@ -30,9 +30,9 @@ Based on the open source project [**scrcpy**](https://github.com/Genymobile/scrc
https://github.com/pdone/FreeControl/releases/latest/download/FreeControl.exe
-### ghproxy
+### My Proxy
-https://mirror.ghproxy.com/github.com/pdone/FreeControl/releases/latest/download/FreeControl.exe
+https://cdn.awaw.cc/gh/pdone/FreeControl/releases/latest/download/FreeControl.exe
## Code Repository
@@ -203,4 +203,4 @@ If you think this project is helpful, please invite the author to have a cup of
[![Donate](https://img.shields.io/badge/Donate-PayPal-blue.svg?style=for-the-badge)](https://paypal.me/alexpdone)
## Stargazers Over Time
-[![Stargazers over time](https://starchart.cc/pdone/FreeControl.svg)](https://starchart.cc/pdone/FreeControl)
+[![Stargazers over time](https://starchart.cc/pdone/FreeControl.svg?variant=adaptive)](https://starchart.cc/pdone/FreeControl)
diff --git a/README.md b/README.md
index 469398e..9b074eb 100644
--- a/README.md
+++ b/README.md
@@ -30,9 +30,9 @@
https://github.com/pdone/FreeControl/releases/latest/download/FreeControl.exe
-### ghproxy
+### My Proxy
-https://mirror.ghproxy.com/github.com/pdone/FreeControl/releases/latest/download/FreeControl.exe
+https://cdn.awaw.cc/gh/pdone/FreeControl/releases/latest/download/FreeControl.exe
## 代码存储库
@@ -219,4 +219,4 @@ Android 11 及更高版本支持使用 Android 调试桥 (adb) 从工作站以
## Stargazers Over Time
-[![Stargazers over time](https://starchart.cc/pdone/FreeControl.svg)](https://starchart.cc/pdone/FreeControl)
\ No newline at end of file
+[![Stargazers over time](https://starchart.cc/pdone/FreeControl.svg?variant=adaptive)](https://starchart.cc/pdone/FreeControl)