From 05c72d22913d7a1e7e0e0ea3a09188e397deb51a Mon Sep 17 00:00:00 2001
From: Matt Parker <61717342+MattParkerDev@users.noreply.github.com>
Date: Sun, 10 Aug 2025 00:07:46 +1000
Subject: [PATCH] fix opening build panel
---
src/SharpIDE.Photino/Layout/MainLayout.razor | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/src/SharpIDE.Photino/Layout/MainLayout.razor b/src/SharpIDE.Photino/Layout/MainLayout.razor
index afde863..afc467e 100644
--- a/src/SharpIDE.Photino/Layout/MainLayout.razor
+++ b/src/SharpIDE.Photino/Layout/MainLayout.razor
@@ -52,8 +52,8 @@
-
-
+
+
@@ -105,9 +105,9 @@
private string MainContentHeight => _bottomDrawerOpen ? "70%" : "100%";
- private void SelectRunPanel() => SelectBottomPanel(BottomPanelType.Run);
- private void SelectBuildPanel() => SelectBottomPanel(BottomPanelType.Build);
- private void SelectBottomPanel(BottomPanelType bottomPanelType)
+ private void ClickRunPanel() => SwitchOrToggleBottomPanel(BottomPanelType.Run);
+ private void ClickBuildPanel() => SwitchOrToggleBottomPanel(BottomPanelType.Build);
+ private void SwitchOrToggleBottomPanel(BottomPanelType bottomPanelType)
{
if (_selectedBottomPanel == bottomPanelType)
{
@@ -120,6 +120,11 @@
_bottomDrawerOpen = true;
}
}
+ private void SelectBottomPanel(BottomPanelType bottomPanelType)
+ {
+ _selectedBottomPanel = bottomPanelType;
+ _bottomDrawerOpen = true;
+ }
protected override async Task OnInitializedAsync()
{
@@ -129,8 +134,7 @@
private async Task OnStartedRunningProject()
{
- _selectedBottomPanel = BottomPanelType.Run;
- _bottomDrawerOpen = true;
+ SelectBottomPanel(BottomPanelType.Run);
await InvokeAsync(StateHasChanged);
}
@@ -155,7 +159,7 @@
private async Task RestoreSolution() => await MsBuildSolution(BuildType.Restore);
private async Task MsBuildSolution(BuildType buildType)
{
- if (AppState.IdeSettings.OpenTerminalOnBuildRebuildRestore) SelectBuildPanel();
+ if (AppState.IdeSettings.OpenTerminalOnBuildRebuildRestore) SelectBottomPanel(BottomPanelType.Build);
_cancellationTokenSource = new CancellationTokenSource();
await BuildService.MsBuildSolutionAsync(_solutionFilePath!, buildType, _cancellationTokenSource.Token);
_cancellationTokenSource = null;