Set theme from appstate on startup

This commit is contained in:
Matt Parker
2026-01-31 13:41:35 +10:00
parent 40bc8def26
commit 11c5bf2bcb

View File

@@ -2,6 +2,7 @@ using Godot;
using Microsoft.Extensions.Hosting;
using SharpIDE.Application.Features.Build;
using SharpIDE.Godot.Features.IdeSettings;
using SharpIDE.Godot.Features.Settings;
using SharpIDE.Godot.Features.SlnPicker;
using Environment = System.Environment;
@@ -32,6 +33,7 @@ public partial class IdeWindow : Control
GodotOtelExtensions.AddServiceDefaults();
Singletons.AppState = AppStateLoader.LoadAppStateFromConfigFile();
GetTree().GetRoot().ContentScaleFactor = Singletons.AppState.IdeSettings.UiScale;
SetIdeThemeFromAppState();
//GetWindow().SetMinSize(new Vector2I(1152, 648));
Callable.From(() => PickSolution(true)).CallDeferred();
}
@@ -57,6 +59,12 @@ public partial class IdeWindow : Control
Engine.MaxFps = refreshRateBelowCapRoundedDownToInt;
}
private void SetIdeThemeFromAppState()
{
var theme = Singletons.AppState.IdeSettings.Theme;
this.SetIdeTheme(theme);
}
public void PickSolution(bool fullscreen = false)
{
if (_slnPicker is not null) throw new InvalidOperationException("Solution picker is already active");