diff --git a/src/SharpIDE.Photino/Components/RunPanel.razor b/src/SharpIDE.Photino/Components/RunPanel.razor new file mode 100644 index 0000000..71e0682 --- /dev/null +++ b/src/SharpIDE.Photino/Components/RunPanel.razor @@ -0,0 +1,5 @@ +Run + +@code { + +} diff --git a/src/SharpIDE.Photino/Components/TerminalOutputDisplay.razor b/src/SharpIDE.Photino/Components/TerminalOutputDisplay.razor index 65f1a20..961d5d1 100644 --- a/src/SharpIDE.Photino/Components/TerminalOutputDisplay.razor +++ b/src/SharpIDE.Photino/Components/TerminalOutputDisplay.razor @@ -11,7 +11,8 @@
- + Terminal +
@code { diff --git a/src/SharpIDE.Photino/Layout/MainLayout.razor b/src/SharpIDE.Photino/Layout/MainLayout.razor index bc4eaf8..93e5142 100644 --- a/src/SharpIDE.Photino/Layout/MainLayout.razor +++ b/src/SharpIDE.Photino/Layout/MainLayout.razor @@ -11,7 +11,7 @@ - + @@ -45,10 +45,10 @@ - + - - + +
@@ -70,34 +70,54 @@
-
Run
+
+ @if (_solutionFilePath is not null && _selectedBottomPanel is not null) + { + @(_selectedBottomPanel switch + { + BottomPanelType.Run => @, + BottomPanelType.Build => @, + _ => throw new InvalidOperationException("Unknown bottom panel type") + }) + } +
@* fake for StretchItems.Middle *@
- - @if (_solutionFilePath is not null) - { - Terminal - - } -
@code { private bool _drawerOpen = true; private bool _terminalDrawerOpen = false; - private bool _runDrawerOpen = true; + private bool _bottomDrawerOpen = true; private void DrawerToggle() => _drawerOpen = !_drawerOpen; private void TerminalDrawerToggle() => _terminalDrawerOpen = !_terminalDrawerOpen; - private void RunDrawerToggle() => _runDrawerOpen = !_runDrawerOpen; + private void BottomDrawerToggle() => _bottomDrawerOpen = !_bottomDrawerOpen; private string? _solutionFilePath; private SharpIdeSolutionModel? _solutionModel; private SharpIdeFile? _selectedFile; + private BottomPanelType? _selectedBottomPanel = BottomPanelType.Build; - private string MainContentHeight => _runDrawerOpen ? "70%" : "100%"; + private string MainContentHeight => _bottomDrawerOpen ? "70%" : "100%"; + + private void SelectRunPanel() => SelectBottomPanel(BottomPanelType.Run); + private void SelectBuildPanel() => SelectBottomPanel(BottomPanelType.Build); + private void SelectBottomPanel(BottomPanelType bottomPanelType) + { + if (_selectedBottomPanel == bottomPanelType) + { + _selectedBottomPanel = null; + _bottomDrawerOpen = false; + } + else + { + _selectedBottomPanel = bottomPanelType; + _bottomDrawerOpen = true; + } + } protected override async Task OnInitializedAsync() { diff --git a/src/SharpIDE.Photino/Models/BottomPanelType.cs b/src/SharpIDE.Photino/Models/BottomPanelType.cs new file mode 100644 index 0000000..036dad6 --- /dev/null +++ b/src/SharpIDE.Photino/Models/BottomPanelType.cs @@ -0,0 +1,7 @@ +namespace SharpIDE.Photino.Models; + +public enum BottomPanelType +{ + Run, + Build +}