|
1 | 1 | using CommunityToolkit.WinUI; |
2 | | -using CommunityToolkit.WinUI.Helpers; |
3 | 2 | using Files.App.Utils.Terminal; |
4 | 3 | using Files.App.Utils.Terminal.ConPTY; |
5 | 4 | using Microsoft.Extensions.Logging; |
6 | 5 | using Microsoft.UI.Xaml.Controls; |
7 | | -using Microsoft.UI.Xaml.Media; |
8 | 6 | using Microsoft.Web.WebView2.Core; |
9 | 7 | using Newtonsoft.Json; |
10 | 8 | using Newtonsoft.Json.Serialization; |
@@ -197,7 +195,7 @@ private Task<TerminalSize> CreateXtermViewAsync(TerminalOptions options, Termina |
197 | 195 | var serializedKeyBindings = JsonConvert.SerializeObject(keyBindings, serializerSettings); |
198 | 196 | return ExecuteScriptAsync( |
199 | 197 | $"createTerminal('{serializedOptions}', '{serializedTheme}', '{serializedKeyBindings}')") |
200 | | - .ContinueWith(t => JsonConvert.DeserializeObject<TerminalSize>(t.Result)); |
| 198 | + .ContinueWith(t => JsonConvert.DeserializeObject<TerminalSize>(t.Result)!); |
201 | 199 | } |
202 | 200 |
|
203 | 201 | private void WebViewControl_NavigationStarting(WebView2 sender, CoreWebView2NavigationStartingEventArgs args) |
@@ -445,20 +443,6 @@ private async void TerminalView_ActualThemeChanged(Microsoft.UI.Xaml.FrameworkEl |
445 | 443 | serializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); |
446 | 444 | var profile = _mainPageModel.TerminalSelectedProfile; |
447 | 445 | var theme = new DefaultValueProvider().GetPreInstalledThemes().First(x => x.Id == profile.TerminalThemeId); |
448 | | - var backgroundColor = ActualTheme switch |
449 | | - { |
450 | | - Microsoft.UI.Xaml.ElementTheme.Dark => "#000000", |
451 | | - _ => "#FFFFFF" |
452 | | - }; |
453 | | - var foregroundColor = ActualTheme switch |
454 | | - { |
455 | | - Microsoft.UI.Xaml.ElementTheme.Dark => "#FFFFFF", |
456 | | - _ => "#000000" |
457 | | - }; |
458 | | - theme.Colors.Background = backgroundColor; |
459 | | - theme.Colors.Foreground = foregroundColor; |
460 | | - theme.Colors.CursorAccent = backgroundColor; |
461 | | - theme.Colors.Cursor = foregroundColor; |
462 | 446 |
|
463 | 447 | WebViewControl.CoreWebView2.Profile.PreferredColorScheme = (ActualTheme == Microsoft.UI.Xaml.ElementTheme.Dark) ? CoreWebView2PreferredColorScheme.Dark : CoreWebView2PreferredColorScheme.Light; |
464 | 448 |
|
|
0 commit comments