Skip to content

Commit 11c5bf2

Browse files
committed
Set theme from appstate on startup
1 parent 40bc8de commit 11c5bf2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/SharpIDE.Godot/IdeWindow.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using Microsoft.Extensions.Hosting;
33
using SharpIDE.Application.Features.Build;
44
using SharpIDE.Godot.Features.IdeSettings;
5+
using SharpIDE.Godot.Features.Settings;
56
using SharpIDE.Godot.Features.SlnPicker;
67
using Environment = System.Environment;
78

@@ -32,6 +33,7 @@ public override void _Ready()
3233
GodotOtelExtensions.AddServiceDefaults();
3334
Singletons.AppState = AppStateLoader.LoadAppStateFromConfigFile();
3435
GetTree().GetRoot().ContentScaleFactor = Singletons.AppState.IdeSettings.UiScale;
36+
SetIdeThemeFromAppState();
3537
//GetWindow().SetMinSize(new Vector2I(1152, 648));
3638
Callable.From(() => PickSolution(true)).CallDeferred();
3739
}
@@ -56,6 +58,12 @@ private void SetMaxFpsForMonitor()
5658
GD.Print($"Detected display refresh rate: {refreshRate} Hz, setting max FPS to {refreshRateBelowCapRoundedDownToInt} Hz");
5759
Engine.MaxFps = refreshRateBelowCapRoundedDownToInt;
5860
}
61+
62+
private void SetIdeThemeFromAppState()
63+
{
64+
var theme = Singletons.AppState.IdeSettings.Theme;
65+
this.SetIdeTheme(theme);
66+
}
5967

6068
public void PickSolution(bool fullscreen = false)
6169
{

0 commit comments

Comments
 (0)