Skip to content

Commit 9680671

Browse files
gave92Marco Gavelli
authored andcommitted
Stupid solution n.1
1 parent ed29c7e commit 9680671

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/Files.App/UserControls/TerminalView.xaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
Unloaded="TerminalView_Unloaded"
1313
mc:Ignorable="d">
1414

15-
<Border x:Name="RootGrid">
15+
<Border
16+
x:Name="RootGrid"
17+
Padding="0,8,0,8"
18+
CornerRadius="8">
1619

1720
<WebView2
1821
x:Name="WebViewControl"

src/Files.App/UserControls/TerminalView.xaml.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using Files.App.Utils.Terminal.ConPTY;
44
using Microsoft.Extensions.Logging;
55
using Microsoft.UI.Xaml.Controls;
6+
using Microsoft.UI.Xaml.Media;
67
using Microsoft.Web.WebView2.Core;
78
using System.IO;
89
using System.Text;
@@ -154,6 +155,7 @@ private async void WebViewControl_Loaded(object sender, Microsoft.UI.Xaml.Routed
154155
var theme = provider.GetPreInstalledThemes().First(x => x.Id == _profile.TerminalThemeId);
155156

156157
WebViewControl.CoreWebView2.Profile.PreferredColorScheme = (ActualTheme == Microsoft.UI.Xaml.ElementTheme.Dark) ? CoreWebView2PreferredColorScheme.Dark : CoreWebView2PreferredColorScheme.Light;
158+
RootGrid.Background = new SolidColorBrush(ColorHelpers.FromHex(theme.Colors.Background));
157159

158160
var size = await CreateXtermViewAsync(options, theme.Colors,
159161
keyBindings.Values.SelectMany(k => k)).ConfigureAwait(false);
@@ -448,6 +450,7 @@ private async void TerminalView_ActualThemeChanged(Microsoft.UI.Xaml.FrameworkEl
448450
var theme = new DefaultValueProvider().GetPreInstalledThemes().First(x => x.Id == _profile.TerminalThemeId);
449451

450452
WebViewControl.CoreWebView2.Profile.PreferredColorScheme = (ActualTheme == Microsoft.UI.Xaml.ElementTheme.Dark) ? CoreWebView2PreferredColorScheme.Dark : CoreWebView2PreferredColorScheme.Light;
453+
RootGrid.Background = new SolidColorBrush(ColorHelpers.FromHex(theme.Colors.Background));
451454

452455
var serializedTheme = JsonSerializer.Serialize(theme.Colors, serializerSettings);
453456
await ExecuteScriptAsync($"changeTheme('{serializedTheme}')");

0 commit comments

Comments
 (0)