@@ -47,7 +47,7 @@ private void OnStateChanged(object? _, EventArgs __)
4747 if ( App ! . Profile . WindowBorderless ) WebView . Margin = Margin0 ;
4848 break ;
4949 default :
50- // if (App!.Profile.WindowBorderless) WebView.Margin = Margin4;
50+ if ( App ! . Profile . WindowBorderless ) WebView . Margin = Margin4 ;
5151 break ;
5252 }
5353
@@ -102,11 +102,12 @@ public void Init(KurisuApp app)
102102 {
103103 App = app ;
104104
105- // TODO:不要再使用系统边框 ,先搞透明窗口,接着Webview留出边距,然后H5自绘边框
105+ //不再使用系统边框 ,先搞透明窗口,接着Webview留出边距,然后H5自绘边框
106106
107107 WpfWindow . Title = app . Profile . Name ;
108108 WpfWindow . Width = app . Profile . WindowWidth ;
109109 WpfWindow . Height = app . Profile . WindowHeight ;
110+
110111 if ( app . Profile . UseIcon )
111112 WpfWindow . Icon = new BitmapImage ( new Uri ( app . Profile . Icon , UriKind . RelativeOrAbsolute ) ) ;
112113
@@ -116,17 +117,15 @@ public void Init(KurisuApp app)
116117 it . Source = new Uri ( app . Profile is { IsDebug : true , DebugStartUpWithDebugUrl : true }
117118 ? app . Profile . DebugStartUpUrl
118119 : app . Profile . StartUpUrl ) ;
119-
120- // 设置Webview背景透明
121- if ( app . Profile . WindowBorderless ) it . DefaultBackgroundColor = DrawingColor . Transparent ;
122120 }
123121 ) ;
124122
125123 //
126124 if ( app . Profile . WindowBorderless )
127125 {
128- // 处理WebView
129- // WebView.Margin = Margin4;
126+ // 设置Webview背景透明与边距
127+ WebView . DefaultBackgroundColor = DrawingColor . Transparent ;
128+ WebView . Margin = Margin4 ;
130129
131130 // 设置窗口背景为透明
132131 WpfWindow . AllowsTransparency = true ;
0 commit comments