diff --git a/src/SharpIDE.Godot/Features/BottomPanel/BottomPanelManager.cs b/src/SharpIDE.Godot/Features/BottomPanel/BottomPanelManager.cs index 84abff4..80748fe 100644 --- a/src/SharpIDE.Godot/Features/BottomPanel/BottomPanelManager.cs +++ b/src/SharpIDE.Godot/Features/BottomPanel/BottomPanelManager.cs @@ -4,5 +4,41 @@ namespace SharpIDE.Godot.Features.BottomPanel; public partial class BottomPanelManager : Panel { + private Control _runPanel = null!; + private Control _buildPanel = null!; + private Control _problemsPanel = null!; + + private Dictionary _panelTypeMap = []; + private BottomPanelType? _currentPanelType = BottomPanelType.Run; + public override void _Ready() + { + _runPanel = GetNode("%RunPanel"); + _buildPanel = GetNode("%BuildPanel"); + _problemsPanel = GetNode("%ProblemsPanel"); + _panelTypeMap = new Dictionary + { + { BottomPanelType.Run, _runPanel }, + { BottomPanelType.Build, _buildPanel }, + { BottomPanelType.Problems, _problemsPanel } + }; + + GodotGlobalEvents.LeftSideBarButtonClicked += OnLeftSideBarButtonClicked; + } + + private async Task OnLeftSideBarButtonClicked(BottomPanelType type) + { + await this.InvokeAsync(() => + { + if (type == _currentPanelType) + { + _currentPanelType = null; + // TODO: Ask parent to to collapse slider. + } + foreach (var kvp in _panelTypeMap) + { + kvp.Value.Visible = kvp.Key == type; + } + }); + } } \ No newline at end of file diff --git a/src/SharpIDE.Godot/Features/LeftSideBar/LeftSideBar.cs b/src/SharpIDE.Godot/Features/LeftSideBar/LeftSideBar.cs new file mode 100644 index 0000000..298bde1 --- /dev/null +++ b/src/SharpIDE.Godot/Features/LeftSideBar/LeftSideBar.cs @@ -0,0 +1,23 @@ +using Godot; + +namespace SharpIDE.Godot.Features.LeftSideBar; + +public partial class LeftSideBar : Panel +{ + private Button _slnExplorerButton = null!; + private Button _problemsButton = null!; + private Button _runButton = null!; + private Button _buildButton = null!; + + public override void _Ready() + { + _slnExplorerButton = GetNode