We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e5c5aa9 commit 3c40be0Copy full SHA for 3c40be0
1 file changed
MaiChartManager/Browser.cs
@@ -27,6 +27,17 @@ public Browser(string? loopbackUrl = null)
27
webView21.Source = new Uri("https://mcm.invalid/index.html");
28
webView21.DefaultBackgroundColor = Color.Transparent;
29
IapManager.BindToForm(this);
30
+
31
+ // 竖屏显示器时,限制窗口高度不超过显示器宽度的 2/3
32
+ var landscape = Screen.AllScreens.FirstOrDefault(s => s.WorkingArea.Width >= s.WorkingArea.Height);
33
+ if (landscape == null)
34
+ {
35
+ var portrait = Screen.PrimaryScreen ?? Screen.AllScreens[0];
36
+ var maxHeight = portrait.WorkingArea.Width * 2 / 3;
37
+ if (Height > maxHeight)
38
+ Height = maxHeight;
39
+ }
40
41
StartPosition = FormStartPosition.Manual;
42
Location = WebViewHelper.CalculatePosition(Width, Height);
43
}
0 commit comments