diff --git a/src/SharpIDE.Godot/Features/BottomPanel/BottomPanelManager.cs b/src/SharpIDE.Godot/Features/BottomPanel/BottomPanelManager.cs index 80748fe..84b6cc2 100644 --- a/src/SharpIDE.Godot/Features/BottomPanel/BottomPanelManager.cs +++ b/src/SharpIDE.Godot/Features/BottomPanel/BottomPanelManager.cs @@ -9,7 +9,6 @@ public partial class BottomPanelManager : Panel private Control _problemsPanel = null!; private Dictionary _panelTypeMap = []; - private BottomPanelType? _currentPanelType = BottomPanelType.Run; public override void _Ready() { @@ -23,16 +22,15 @@ public partial class BottomPanelManager : Panel { BottomPanelType.Problems, _problemsPanel } }; - GodotGlobalEvents.LeftSideBarButtonClicked += OnLeftSideBarButtonClicked; + GodotGlobalEvents.BottomPanelTabSelected += OnBottomPanelTabSelected; } - private async Task OnLeftSideBarButtonClicked(BottomPanelType type) + private async Task OnBottomPanelTabSelected(BottomPanelType? type) { await this.InvokeAsync(() => { - if (type == _currentPanelType) + if (type == null) { - _currentPanelType = null; // TODO: Ask parent to to collapse slider. } foreach (var kvp in _panelTypeMap) diff --git a/src/SharpIDE.Godot/Features/LeftSideBar/LeftBottomSidebarButtonGroup.tres b/src/SharpIDE.Godot/Features/LeftSideBar/LeftBottomSidebarButtonGroup.tres new file mode 100644 index 0000000..5c90e98 --- /dev/null +++ b/src/SharpIDE.Godot/Features/LeftSideBar/LeftBottomSidebarButtonGroup.tres @@ -0,0 +1,4 @@ +[gd_resource type="ButtonGroup" format=3 uid="uid://c2nmo2x3va0gi"] + +[resource] +allow_unpress = true diff --git a/src/SharpIDE.Godot/Features/LeftSideBar/LeftSideBar.cs b/src/SharpIDE.Godot/Features/LeftSideBar/LeftSideBar.cs index 298bde1..e8c6959 100644 --- a/src/SharpIDE.Godot/Features/LeftSideBar/LeftSideBar.cs +++ b/src/SharpIDE.Godot/Features/LeftSideBar/LeftSideBar.cs @@ -5,6 +5,7 @@ namespace SharpIDE.Godot.Features.LeftSideBar; public partial class LeftSideBar : Panel { private Button _slnExplorerButton = null!; + // These are in a ButtonGroup, which handles mutual exclusivity of being toggled on private Button _problemsButton = null!; private Button _runButton = null!; private Button _buildButton = null!; @@ -16,8 +17,8 @@ public partial class LeftSideBar : Panel _runButton = GetNode