Add Test Explorer Panel stub

This commit is contained in:
Matt Parker
2025-11-04 19:32:27 +10:00
parent f54790667c
commit 908495d2dd
8 changed files with 49 additions and 5 deletions

View File

@@ -6,6 +6,7 @@ using SharpIDE.Godot.Features.IdeDiagnostics;
using SharpIDE.Godot.Features.Nuget;
using SharpIDE.Godot.Features.Problems;
using SharpIDE.Godot.Features.Run;
using SharpIDE.Godot.Features.TestExplorer;
namespace SharpIDE.Godot.Features.BottomPanel;
@@ -27,6 +28,7 @@ public partial class BottomPanelManager : Panel
private ProblemsPanel _problemsPanel = null!;
private IdeDiagnosticsPanel _ideDiagnosticsPanel = null!;
private NugetPanel _nugetPanel = null!;
private TestExplorerPanel _testExplorerPanel = null!;
private Dictionary<BottomPanelType, Control> _panelTypeMap = [];
@@ -38,6 +40,7 @@ public partial class BottomPanelManager : Panel
_problemsPanel = GetNode<ProblemsPanel>("%ProblemsPanel");
_ideDiagnosticsPanel = GetNode<IdeDiagnosticsPanel>("%IdeDiagnosticsPanel");
_nugetPanel = GetNode<NugetPanel>("%NugetPanel");
_testExplorerPanel = GetNode<TestExplorerPanel>("%TestExplorerPanel");
_panelTypeMap = new Dictionary<BottomPanelType, Control>
{
@@ -46,7 +49,8 @@ public partial class BottomPanelManager : Panel
{ BottomPanelType.Build, _buildPanel },
{ BottomPanelType.Problems, _problemsPanel },
{ BottomPanelType.IdeDiagnostics, _ideDiagnosticsPanel },
{ BottomPanelType.Nuget, _nugetPanel }
{ BottomPanelType.Nuget, _nugetPanel },
{ BottomPanelType.TestExplorer, _testExplorerPanel }
};
GodotGlobalEvents.Instance.BottomPanelTabSelected.Subscribe(OnBottomPanelTabSelected);

View File

@@ -7,5 +7,6 @@ public enum BottomPanelType
Build,
Problems,
IdeDiagnostics,
Nuget
Nuget,
TestExplorer
}

View File

@@ -13,6 +13,7 @@ public partial class LeftSideBar : Panel
private Button _debugButton = null!;
private Button _ideDiagnosticsButton = null!;
private Button _nugetButton = null!;
private Button _testExplorerButton = null!;
public override void _Ready()
{
@@ -23,6 +24,7 @@ public partial class LeftSideBar : Panel
_debugButton = GetNode<Button>("%DebugButton");
_ideDiagnosticsButton = GetNode<Button>("%IdeDiagnosticsButton");
_nugetButton = GetNode<Button>("%NugetButton");
_testExplorerButton = GetNode<Button>("%TestExplorerButton");
_problemsButton.Toggled += toggledOn => GodotGlobalEvents.Instance.BottomPanelTabSelected.InvokeParallelFireAndForget(toggledOn ? BottomPanelType.Problems : null);
_runButton.Toggled += toggledOn => GodotGlobalEvents.Instance.BottomPanelTabSelected.InvokeParallelFireAndForget(toggledOn ? BottomPanelType.Run : null);
@@ -30,6 +32,7 @@ public partial class LeftSideBar : Panel
_debugButton.Toggled += toggledOn => GodotGlobalEvents.Instance.BottomPanelTabSelected.InvokeParallelFireAndForget(toggledOn ? BottomPanelType.Debug : null);
_ideDiagnosticsButton.Toggled += toggledOn => GodotGlobalEvents.Instance.BottomPanelTabSelected.InvokeParallelFireAndForget(toggledOn ? BottomPanelType.IdeDiagnostics : null);
_nugetButton.Toggled += toggledOn => GodotGlobalEvents.Instance.BottomPanelTabSelected.InvokeParallelFireAndForget(toggledOn ? BottomPanelType.Nuget : null);
_testExplorerButton.Toggled += toggledOn => GodotGlobalEvents.Instance.BottomPanelTabSelected.InvokeParallelFireAndForget(toggledOn ? BottomPanelType.TestExplorer : null);
GodotGlobalEvents.Instance.BottomPanelTabExternallySelected.Subscribe(OnBottomPanelTabExternallySelected);
}
@@ -45,6 +48,7 @@ public partial class LeftSideBar : Panel
case BottomPanelType.Problems: _problemsButton.ButtonPressed = true; break;
case BottomPanelType.IdeDiagnostics: _ideDiagnosticsButton.ButtonPressed = true; break;
case BottomPanelType.Nuget: _nugetButton.ButtonPressed = true; break;
case BottomPanelType.TestExplorer: _testExplorerButton.ButtonPressed = true; break;
default: throw new ArgumentOutOfRangeException(nameof(arg), arg, null);
}
});

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=12 format=3 uid="uid://biyhfwx36ium8"]
[gd_scene load_steps=13 format=3 uid="uid://biyhfwx36ium8"]
[ext_resource type="Script" uid="uid://bddno1bbvvp5q" path="res://Features/LeftSideBar/LeftSideBar.cs" id="1_rgaf0"]
[ext_resource type="ButtonGroup" uid="uid://c2nmo2x3va0gi" path="res://Features/LeftSideBar/LeftBottomSidebarButtonGroup.tres" id="2_1aad6"]
@@ -11,6 +11,7 @@
[ext_resource type="Texture2D" uid="uid://butisxqww0boc" path="res://Features/LeftSideBar/Resources/SidebarDebug.svg" id="6_jg03n"]
[ext_resource type="Texture2D" uid="uid://dx8bt0adxpqgy" path="res://Features/LeftSideBar/Resources/Ide.svg" id="9_6ih3m"]
[ext_resource type="Texture2D" uid="uid://b5ih61vdjv5e6" path="res://Features/LeftSideBar/Resources/Nuget.svg" id="11_csqeq"]
[ext_resource type="Texture2D" uid="uid://dged1mm438qli" path="res://Features/LeftSideBar/Resources/SidebarTestExplorer.svg" id="12_rlff3"]
[node name="LeftSideBar" type="Panel"]
custom_minimum_size = Vector2(80, 0)
@@ -123,6 +124,7 @@ expand_icon = true
[node name="IdeDiagnosticsButton" type="Button" parent="MarginContainer/VBoxContainer"]
unique_name_in_owner = true
visible = false
custom_minimum_size = Vector2(0, 50)
layout_mode = 2
focus_mode = 0
@@ -152,3 +154,19 @@ icon = ExtResource("11_csqeq")
icon_alignment = 1
vertical_icon_alignment = 0
expand_icon = true
[node name="TestExplorerButton" type="Button" parent="MarginContainer/VBoxContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 50)
layout_mode = 2
focus_mode = 0
theme_override_font_sizes/font_size = 13
theme_override_styles/normal = ExtResource("4_umcfu")
theme_override_styles/pressed = ExtResource("5_csqeq")
toggle_mode = true
button_group = ExtResource("2_1aad6")
text = "Tests"
icon = ExtResource("12_rlff3")
icon_alignment = 1
vertical_icon_alignment = 0
expand_icon = true

View File

@@ -0,0 +1,7 @@
using Godot;
namespace SharpIDE.Godot.Features.TestExplorer;
public partial class TestExplorerPanel : Control
{
}

View File

@@ -0,0 +1 @@
uid://8o78ti2hb0pu

View File

@@ -1,4 +1,6 @@
[gd_scene format=3 uid="uid://hwdok1kch3b3"]
[gd_scene load_steps=2 format=3 uid="uid://hwdok1kch3b3"]
[ext_resource type="Script" uid="uid://8o78ti2hb0pu" path="res://Features/TestExplorer/TestExplorerPanel.cs" id="1_b5miy"]
[node name="TestExplorerPanel" type="Control"]
layout_mode = 3
@@ -7,6 +9,7 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_b5miy")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 1

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=21 format=3 uid="uid://b2oniigcp5ew5"]
[gd_scene load_steps=22 format=3 uid="uid://b2oniigcp5ew5"]
[ext_resource type="FontFile" uid="uid://38igu11xwba6" path="res://Inter-VariableFont.ttf" id="1_7ptyn"]
[ext_resource type="Script" uid="uid://bavypuy7b375x" path="res://IdeRoot.cs" id="1_whawi"]
@@ -17,6 +17,7 @@
[ext_resource type="PackedScene" uid="uid://b0tjuqq3bca5e" path="res://Features/IdeDiagnostics/IdeDiagnosticsPanel.tscn" id="13_woo5i"]
[ext_resource type="PackedScene" uid="uid://b8kytk23cfo4x" path="res://Features/Search/SearchAllFiles/SearchAllFilesWindow.tscn" id="15_gh8b1"]
[ext_resource type="PackedScene" uid="uid://duyxg107nfh2f" path="res://Features/Nuget/NugetPanel.tscn" id="15_lv3f5"]
[ext_resource type="PackedScene" uid="uid://hwdok1kch3b3" path="res://Features/TestExplorer/TestExplorerPanel.tscn" id="16_0sv7o"]
[sub_resource type="Theme" id="Theme_s2dv6"]
default_font = ExtResource("1_7ptyn")
@@ -190,6 +191,11 @@ unique_name_in_owner = true
visible = false
layout_mode = 1
[node name="TestExplorerPanel" parent="VBoxContainer/HBoxContainer/InvertedVSplitContainer/BottomPanel" instance=ExtResource("16_0sv7o")]
unique_name_in_owner = true
visible = false
layout_mode = 1
[node name="SearchWindow" parent="." instance=ExtResource("13_7ptyn")]
unique_name_in_owner = true
visible = false