diff --git a/.vs/AIProofread/v17/.suo b/.vs/AIProofread/v17/.suo index 1dc1541..2d1846c 100644 Binary files a/.vs/AIProofread/v17/.suo and b/.vs/AIProofread/v17/.suo differ diff --git a/AIProofread/Config.cs b/AIProofread/Config.cs index a19722d..ed16fe6 100644 --- a/AIProofread/Config.cs +++ b/AIProofread/Config.cs @@ -52,7 +52,7 @@ namespace AIProofread /// /// 网页访问地址 /// - public static string WEB_PATH = AppServer.GM_FN; //pre-gm-plugin.gachafun.com localhost:5173 gm2-plugin.zverse.group + public static string WEB_PATH = AppServer.DEV; //pre-gm-plugin.gachafun.com localhost:5173 gm2-plugin.zverse.group public static bool RUN_IN_DEBUG = true; public static AppEnvironment APP_ENV = AppEnvironment.Dev; #else @@ -103,7 +103,7 @@ namespace AIProofread /// public static string WebPath(string path) { - return WEB_PATH + path; + return WEB_PATH + path + (path.IndexOf("?") == -1 ? "?" : "&") + "version=" + APP_VERSION; } } } diff --git a/AIProofread/Controls/FormWebView.Designer.cs b/AIProofread/Controls/FormWebView.Designer.cs index 9802b30..1b16b59 100644 --- a/AIProofread/Controls/FormWebView.Designer.cs +++ b/AIProofread/Controls/FormWebView.Designer.cs @@ -29,6 +29,7 @@ private void InitializeComponent() { this.WebView = new Microsoft.Web.WebView2.WinForms.WebView2(); + this.label1 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.WebView)).BeginInit(); this.SuspendLayout(); // @@ -44,23 +45,36 @@ this.WebView.TabIndex = 0; this.WebView.ZoomFactor = 1D; // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(380, 219); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(41, 12); + this.label1.TabIndex = 1; + this.label1.Text = "校对王"; + this.label1.Visible = false; + // // FormWebView // this.AllowDrop = true; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(800, 450); + this.Controls.Add(this.label1); this.Controls.Add(this.WebView); this.Name = "FormWebView"; this.ShowIcon = false; this.Load += new System.EventHandler(this.FormWebView_Load); ((System.ComponentModel.ISupportInitialize)(this.WebView)).EndInit(); this.ResumeLayout(false); + this.PerformLayout(); } #endregion private Microsoft.Web.WebView2.WinForms.WebView2 WebView; + private System.Windows.Forms.Label label1; } } \ No newline at end of file diff --git a/AIProofread/Controls/FormWebView.cs b/AIProofread/Controls/FormWebView.cs index 4a970a2..640a9b3 100644 --- a/AIProofread/Controls/FormWebView.cs +++ b/AIProofread/Controls/FormWebView.cs @@ -16,10 +16,16 @@ namespace AIProofread.Controls public partial class FormWebView : BaseWinForm { public string WebUrl { get; set; } + private double dpiScaleFactor; public FormWebView(string url,int width,int height) { InitializeComponent(); this.WebUrl = url; + + this.dpiScaleFactor = this.label1.Width / 42.0; // 设置的宽度为42,实际渲染宽度 / 42 即为缩放比例 + + Screen screen = Screen.FromControl(this); + this.SetSize(width, height); this.StartPosition = FormStartPosition.CenterScreen; } @@ -31,8 +37,8 @@ namespace AIProofread.Controls public void SetSize(int width, int height) { - this.Width = width; - this.Height = height; + this.Width = (int)(width * dpiScaleFactor); + this.Height = (int)(height * dpiScaleFactor); } private void FormWebView_Load(object sender, EventArgs e) diff --git a/AIProofread/ThisAddIn.cs b/AIProofread/ThisAddIn.cs index 448ac75..7495735 100644 --- a/AIProofread/ThisAddIn.cs +++ b/AIProofread/ThisAddIn.cs @@ -97,7 +97,7 @@ namespace AIProofread { if (fromStockQuery == null || fromStockQuery.IsDisposed) { - fromStockQuery = new FormWebView(Config.WebPath("stock-query"),500,400); + fromStockQuery = new FormWebView(Config.WebPath("stock-query?app_v=101"),500 ,400); } fromStockQuery.Show(); // 显示在最前面