Set theme from appstate on startup
This commit is contained in:
@@ -2,6 +2,7 @@ using Godot;
|
|||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
using SharpIDE.Application.Features.Build;
|
using SharpIDE.Application.Features.Build;
|
||||||
using SharpIDE.Godot.Features.IdeSettings;
|
using SharpIDE.Godot.Features.IdeSettings;
|
||||||
|
using SharpIDE.Godot.Features.Settings;
|
||||||
using SharpIDE.Godot.Features.SlnPicker;
|
using SharpIDE.Godot.Features.SlnPicker;
|
||||||
using Environment = System.Environment;
|
using Environment = System.Environment;
|
||||||
|
|
||||||
@@ -32,6 +33,7 @@ public partial class IdeWindow : Control
|
|||||||
GodotOtelExtensions.AddServiceDefaults();
|
GodotOtelExtensions.AddServiceDefaults();
|
||||||
Singletons.AppState = AppStateLoader.LoadAppStateFromConfigFile();
|
Singletons.AppState = AppStateLoader.LoadAppStateFromConfigFile();
|
||||||
GetTree().GetRoot().ContentScaleFactor = Singletons.AppState.IdeSettings.UiScale;
|
GetTree().GetRoot().ContentScaleFactor = Singletons.AppState.IdeSettings.UiScale;
|
||||||
|
SetIdeThemeFromAppState();
|
||||||
//GetWindow().SetMinSize(new Vector2I(1152, 648));
|
//GetWindow().SetMinSize(new Vector2I(1152, 648));
|
||||||
Callable.From(() => PickSolution(true)).CallDeferred();
|
Callable.From(() => PickSolution(true)).CallDeferred();
|
||||||
}
|
}
|
||||||
@@ -56,6 +58,12 @@ public partial class IdeWindow : Control
|
|||||||
GD.Print($"Detected display refresh rate: {refreshRate} Hz, setting max FPS to {refreshRateBelowCapRoundedDownToInt} Hz");
|
GD.Print($"Detected display refresh rate: {refreshRate} Hz, setting max FPS to {refreshRateBelowCapRoundedDownToInt} Hz");
|
||||||
Engine.MaxFps = refreshRateBelowCapRoundedDownToInt;
|
Engine.MaxFps = refreshRateBelowCapRoundedDownToInt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SetIdeThemeFromAppState()
|
||||||
|
{
|
||||||
|
var theme = Singletons.AppState.IdeSettings.Theme;
|
||||||
|
this.SetIdeTheme(theme);
|
||||||
|
}
|
||||||
|
|
||||||
public void PickSolution(bool fullscreen = false)
|
public void PickSolution(bool fullscreen = false)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user