From 548fbae90428e6ecabd687df47f1cb9a3b13d5f5 Mon Sep 17 00:00:00 2001 From: Matt Parker <61717342+MattParkerDev@users.noreply.github.com> Date: Sat, 2 Aug 2025 17:41:02 +1000 Subject: [PATCH] open terminal on launch --- src/SharpIDE.Photino/Layout/MainLayout.razor | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/SharpIDE.Photino/Layout/MainLayout.razor b/src/SharpIDE.Photino/Layout/MainLayout.razor index e751f33..ea06642 100644 --- a/src/SharpIDE.Photino/Layout/MainLayout.razor +++ b/src/SharpIDE.Photino/Layout/MainLayout.razor @@ -1,10 +1,12 @@ @using SharpIDE.Application.Features.Build @using SharpIDE.Application.Features.SolutionDiscovery @using SharpIDE.Application.Features.SolutionDiscovery.VsPersistence +@using SharpIDE.Photino.Models @inherits LayoutComponentBase @inject IDialogService DialogService @inject BuildService BuildService +@inject AppState AppState @@ -82,6 +84,16 @@ //await BuildService.BuildSolutionAsync(_solutionFilePath); var solutionModel = await VsPersistenceMapper.GetSolutionModel(_solutionFilePath); _solutionModel = solutionModel; + if (AppState.IdeSettings.AutoOpenTerminalOnLaunch) + { + _ = Task.Run(async () => + { + // The mud drawer is a pain, has an initial state, and won't open if you try to open it before it has rendered (presumably using js) + await Task.Delay(125).ConfigureAwait(false); + _terminalDrawerOpen = true; + await InvokeAsync(StateHasChanged).ConfigureAwait(false); + }).ConfigureAwait(false); + } } private async Task BuildSolution() => await MsBuildSolution(BuildType.Build);