feat(ui): 调整FormLogin窗体和web控件尺寸

- 添加关闭事件,用于释放web资源
This commit is contained in:
LittleBoy 2025-04-09 21:24:45 +08:00
parent e52fd188b6
commit cf148e9000
3 changed files with 28 additions and 2 deletions

Binary file not shown.

View File

@ -41,7 +41,7 @@
this.web.Dock = System.Windows.Forms.DockStyle.Fill; this.web.Dock = System.Windows.Forms.DockStyle.Fill;
this.web.Location = new System.Drawing.Point(0, 0); this.web.Location = new System.Drawing.Point(0, 0);
this.web.Name = "web"; this.web.Name = "web";
this.web.Size = new System.Drawing.Size(650, 400); this.web.Size = new System.Drawing.Size(650, 500);
this.web.TabIndex = 0; this.web.TabIndex = 0;
this.web.ZoomFactor = 1D; this.web.ZoomFactor = 1D;
// //
@ -49,7 +49,7 @@
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(650, 400); this.ClientSize = new System.Drawing.Size(650, 500);
this.Controls.Add(this.web); this.Controls.Add(this.web);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "FormLogin"; this.Name = "FormLogin";

View File

@ -14,6 +14,19 @@ namespace AIProofread.Controls
public FormLogin() public FormLogin()
{ {
InitializeComponent(); InitializeComponent();
this.FormClosed += (s, e) =>
{
// 关闭时释放资源
try
{
if (web != null)
{
web.Dispose();
web = null;
}
}
catch { };
};
//Bridge.InitWebEnvAsync("login", web); //Bridge.InitWebEnvAsync("login", web);
//Bridge.AddEventHandler(BridgeEvent.LoginSuccess, OnLoginSuccess); //Bridge.AddEventHandler(BridgeEvent.LoginSuccess, OnLoginSuccess);
} }
@ -21,6 +34,19 @@ namespace AIProofread.Controls
{ {
this.action = action; this.action = action;
InitializeComponent(); InitializeComponent();
this.FormClosed += (s, e) =>
{
// 关闭时释放资源
try
{
if (web != null)
{
web.Dispose();
web = null;
}
}
catch { };
};
} }
private void OnLoginSuccess(object sender, EventArgs e) private void OnLoginSuccess(object sender, EventArgs e)