switch between bottom panels

This commit is contained in:
Matt Parker
2025-08-27 20:57:25 +10:00
parent 9dae2140bb
commit c1dbaf4627
8 changed files with 101 additions and 4 deletions

View File

@@ -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<Button>("%SlnExplorerButton");
_problemsButton = GetNode<Button>("%ProblemsButton");
_runButton = GetNode<Button>("%RunButton");
_buildButton = GetNode<Button>("%BuildButton");
_problemsButton.Pressed += () => GodotGlobalEvents.InvokeLeftSideBarButtonClicked(BottomPanelType.Problems);
_runButton.Pressed += () => GodotGlobalEvents.InvokeLeftSideBarButtonClicked(BottomPanelType.Run);
_buildButton.Pressed += () => GodotGlobalEvents.InvokeLeftSideBarButtonClicked(BottomPanelType.Build);
}
}

View File

@@ -0,0 +1 @@
uid://bddno1bbvvp5q

View File

@@ -1,6 +1,7 @@
[gd_scene load_steps=2 format=3 uid="uid://biyhfwx36ium8"]
[gd_scene load_steps=3 format=3 uid="uid://biyhfwx36ium8"]
[ext_resource type="Texture2D" uid="uid://bkty6563cthj8" path="res://Features/Run/Resources/Run.svg" id="1_6wc7d"]
[ext_resource type="Script" uid="uid://bddno1bbvvp5q" path="res://Features/LeftSideBar/LeftSideBar.cs" id="1_rgaf0"]
[node name="LeftSideBar" type="Panel"]
custom_minimum_size = Vector2(80, 0)
@@ -10,6 +11,7 @@ anchor_right = 0.5
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_rgaf0")
[node name="MarginContainer" type="MarginContainer" parent="."]
layout_mode = 1
@@ -25,7 +27,8 @@ theme_override_constants/margin_bottom = 5
layout_mode = 2
size_flags_horizontal = 4
[node name="ExplorerButton" type="Button" parent="MarginContainer/VBoxContainer"]
[node name="SlnExplorerButton" type="Button" parent="MarginContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
focus_mode = 0
theme_override_font_sizes/font_size = 13
@@ -41,6 +44,7 @@ layout_mode = 2
size_flags_vertical = 3
[node name="ProblemsButton" type="Button" parent="MarginContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
focus_mode = 0
theme_override_font_sizes/font_size = 13
@@ -52,6 +56,7 @@ vertical_icon_alignment = 0
expand_icon = true
[node name="RunButton" type="Button" parent="MarginContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
focus_mode = 0
theme_override_font_sizes/font_size = 13
@@ -63,6 +68,7 @@ vertical_icon_alignment = 0
expand_icon = true
[node name="BuildButton" type="Button" parent="MarginContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
focus_mode = 0
theme_override_font_sizes/font_size = 13