Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
Ftt_Common
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Ftt_Common
Commits
2705cb1f
Commit
2705cb1f
authored
Jun 23, 2026
by
段廷瑞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pref: 自动打包工具优化;WebKit重置尺寸强制刷新
parent
e07d796b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
9 deletions
+58
-9
.gitignore
.gitignore
+1
-0
FrmMain.cs
Ftt.PatchPack/FrmMain.cs
+33
-7
FrmProject.cs
Ftt.PatchPack/FrmProject.cs
+8
-1
FrmWeb.cs
WebKit/FrmWeb.cs
+16
-1
No files found.
.gitignore
View file @
2705cb1f
...
...
@@ -61,3 +61,4 @@ bin
/Tools/.claude/settings.local.json
/.claude/settings.local.json
/AppHome/ClaudeChat
/CLAUDE.md
Ftt.PatchPack/FrmMain.cs
View file @
2705cb1f
...
...
@@ -2,6 +2,7 @@
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.IO
;
using
System.Linq
;
using
System.Text
;
using
System.Windows.Forms
;
...
...
@@ -38,7 +39,21 @@ namespace Ftt.PatchPack
{
projects
=
ProjectHelp
.
Read
();
if
(
projects
==
null
)
projects
=
new
Dictionary
<
string
,
Project
>();
foreach
(
var
cli
in
projects
)
// 自愈:清理因重命名 Bug 产生的幽灵条目(Key 与 Project.Name 不一致的残留 Key)
var
orphanKeys
=
new
List
<
string
>();
foreach
(
var
kv
in
projects
)
{
if
(
kv
.
Key
!=
kv
.
Value
.
Name
&&
projects
.
ContainsKey
(
kv
.
Value
.
Name
))
orphanKeys
.
Add
(
kv
.
Key
);
}
foreach
(
var
key
in
orphanKeys
)
projects
.
Remove
(
key
);
if
(
orphanKeys
.
Count
>
0
)
ProjectHelp
.
Save
(
projects
);
// 按名称字典序排序
foreach
(
var
cli
in
projects
.
OrderBy
(
p
=>
p
.
Key
))
{
lstProject
.
Items
.
Add
(
cli
.
Key
);
}
...
...
@@ -114,16 +129,21 @@ namespace Ftt.PatchPack
private
void
btnEdit_Click
(
object
sender
,
EventArgs
e
)
{
var
item
=
lstProject
.
SelectedItems
;
if
(
item
.
Count
==
0
)
return
;
var
items
=
lstProject
.
CheckedItems
;
if
(
items
.
Count
==
0
)
{
MessageBox
.
Show
(
"请勾选需要修改的项目!"
);
return
;
}
if
(
projects
.
TryGetValue
(
item
[
0
].
Text
,
out
Project
project
)
&&
project
!=
null
)
var
item
=
items
[
0
];
if
(
projects
.
TryGetValue
(
item
.
Text
,
out
Project
project
)
&&
project
!=
null
)
{
using
(
FrmProject
frmProject
=
new
FrmProject
(
projects
,
ref
project
))
{
if
(
frmProject
.
ShowDialog
()
==
DialogResult
.
Yes
)
{
item
[
0
]
.
Text
=
project
.
Name
;
item
.
Text
=
project
.
Name
;
}
}
}
...
...
@@ -134,7 +154,7 @@ namespace Ftt.PatchPack
var
items
=
lstProject
.
CheckedItems
;
if
(
items
.
Count
==
0
)
{
MessageBox
.
Show
(
"请
选择
需要删除的项目!"
);
MessageBox
.
Show
(
"请
勾选
需要删除的项目!"
);
return
;
}
if
(
MessageBox
.
Show
(
$"是否确定要删除勾选的
{
items
.
Count
}
个项目?"
,
"询问"
,
MessageBoxButtons
.
YesNo
)
!=
DialogResult
.
Yes
)
return
;
...
...
@@ -145,7 +165,13 @@ namespace Ftt.PatchPack
projects
.
TryGetValue
(
item
.
Text
,
out
Project
project
);
if
(
project
!=
null
&&
projects
.
ContainsKey
(
project
.
Name
))
projects
.
Remove
(
project
.
Name
);
// 优先按项目对象当前名称移除;如果已存在旧 Key 残留,也一并清理
if
(
project
!=
null
&&
projects
.
ContainsKey
(
project
.
Name
))
projects
.
Remove
(
project
.
Name
);
// 兜底:如果字典中仍存在 item.Text 对应的键(如幽灵条目),也一并移除
if
(
projects
.
ContainsKey
(
item
.
Text
))
projects
.
Remove
(
item
.
Text
);
lstProject
.
Items
.
Remove
(
item
);
}
...
...
Ftt.PatchPack/FrmProject.cs
View file @
2705cb1f
...
...
@@ -8,6 +8,7 @@ namespace Ftt.PatchPack
{
Project
project
=
null
;
Dictionary
<
string
,
Project
>
dictionary
;
string
originalName
=
null
;
// 记录编辑前的原始名称,用于重命名时清理旧 Key
private
FrmProject
()
{
...
...
@@ -24,7 +25,7 @@ namespace Ftt.PatchPack
public
FrmProject
(
Dictionary
<
string
,
Project
>
dictionary
,
ref
Project
project
)
:
this
()
{
this
.
project
=
project
;
this
.
originalName
=
project
.
Name
;
// 记录原始名称
this
.
dictionary
=
dictionary
;
}
...
...
@@ -122,6 +123,12 @@ namespace Ftt.PatchPack
project
.
RelativeDbFilePath
=
txtRelativeDbFilePath
.
Text
.
Trim
();
project
.
Name
=
txtProjectName
.
Text
.
Trim
();
// 如果名称已变更,先移除旧 Key 防止幽灵条目
if
(
originalName
!=
null
&&
originalName
!=
project
.
Name
)
{
dictionary
.
Remove
(
originalName
);
}
if
(
this
.
dictionary
.
ContainsKey
(
project
.
Name
))
{
if
(
dictionary
[
project
.
Name
]
!=
project
//如果是同一个对象,则不需要提示
...
...
WebKit/FrmWeb.cs
View file @
2705cb1f
...
...
@@ -64,7 +64,7 @@ namespace WebKit
protected
virtual
void
FrmWeb_Load
(
object
sender
,
EventArgs
e
)
{
// 解决窗体继承时:服务容器中已存在服务 System.Windows.Forms.Design.IEventHandlerService。参数名: serviceType
// 解决窗体继承时:服务容器中已存在服务 System.Windows.Forms.Design.IEventHandlerService。参数名: serviceType
// 如果构造函数中有代码,稳妥起见也需要放这里
if
(!
DesignMode
)
{
...
...
@@ -72,6 +72,21 @@ namespace WebKit
ShowToolBar
=
pnlToolBar
.
Visible
=
ToBool
(
ConfigurationManager
.
AppSettings
[
"ShowToolBar"
]);
InitWebKit
(
null
);
// 修复全屏/最大化时 CEF 渲染区域不跟随缩放的问题
this
.
ResizeEnd
+=
FrmWeb_ResizeEnd
;
}
}
/// <summary>
/// 窗口大小变化结束时强制刷新 CEF 内部渲染区域,
/// 解决全屏/最大化时右下角黑色区域问题。
/// </summary>
private
void
FrmWeb_ResizeEnd
(
object
sender
,
EventArgs
e
)
{
if
(
browser
!=
null
&&
panel1
.
Controls
.
Contains
(
browser
))
{
browser
.
Size
=
panel1
.
ClientSize
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment