collapse bottom panel
This commit is contained in:
@@ -31,7 +31,11 @@ public partial class BottomPanelManager : Panel
|
|||||||
{
|
{
|
||||||
if (type == null)
|
if (type == null)
|
||||||
{
|
{
|
||||||
// TODO: Ask parent to to collapse slider.
|
GodotGlobalEvents.InvokeBottomPanelVisibilityChangeRequested(false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GodotGlobalEvents.InvokeBottomPanelVisibilityChangeRequested(true);
|
||||||
}
|
}
|
||||||
foreach (var kvp in _panelTypeMap)
|
foreach (var kvp in _panelTypeMap)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,6 +7,23 @@ public partial class InvertedVSplitContainer : VSplitContainer
|
|||||||
{
|
{
|
||||||
[Export]
|
[Export]
|
||||||
private int _invertedOffset = 200;
|
private int _invertedOffset = 200;
|
||||||
|
private bool _invertedCollapsed = false;
|
||||||
|
|
||||||
|
public void InvertedSetCollapsed(bool collapsed)
|
||||||
|
{
|
||||||
|
if (_invertedCollapsed == collapsed) return;
|
||||||
|
_invertedCollapsed = collapsed;
|
||||||
|
if (collapsed)
|
||||||
|
{
|
||||||
|
SplitOffset = (int)Size.Y + 100;
|
||||||
|
DraggingEnabled = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SplitOffset = (int)Size.Y - _invertedOffset;
|
||||||
|
DraggingEnabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override void _Ready()
|
public override void _Ready()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ public static class GodotGlobalEvents
|
|||||||
{
|
{
|
||||||
public static event Func<BottomPanelType?, Task> BottomPanelTabSelected = _ => Task.CompletedTask;
|
public static event Func<BottomPanelType?, Task> BottomPanelTabSelected = _ => Task.CompletedTask;
|
||||||
public static void InvokeBottomPanelTabSelected(BottomPanelType? type) => BottomPanelTabSelected.Invoke(type);
|
public static void InvokeBottomPanelTabSelected(BottomPanelType? type) => BottomPanelTabSelected.Invoke(type);
|
||||||
|
|
||||||
|
public static event Func<bool, Task> BottomPanelVisibilityChangeRequested = _ => Task.CompletedTask;
|
||||||
|
public static void InvokeBottomPanelVisibilityChangeRequested(bool show) => BottomPanelVisibilityChangeRequested.Invoke(show);
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum BottomPanelType
|
public enum BottomPanelType
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using Godot;
|
|||||||
using Microsoft.Build.Locator;
|
using Microsoft.Build.Locator;
|
||||||
using SharpIDE.Application.Features.Analysis;
|
using SharpIDE.Application.Features.Analysis;
|
||||||
using SharpIDE.Application.Features.SolutionDiscovery.VsPersistence;
|
using SharpIDE.Application.Features.SolutionDiscovery.VsPersistence;
|
||||||
|
using SharpIDE.Godot.Features.CustomControls;
|
||||||
using SharpIDE.Godot.Features.Run;
|
using SharpIDE.Godot.Features.Run;
|
||||||
using SharpIDE.Godot.Features.SolutionExplorer;
|
using SharpIDE.Godot.Features.SolutionExplorer;
|
||||||
|
|
||||||
@@ -16,6 +17,7 @@ public partial class IdeRoot : Control
|
|||||||
private FileDialog _fileDialog = null!;
|
private FileDialog _fileDialog = null!;
|
||||||
private SharpIdeCodeEdit _sharpIdeCodeEdit = null!;
|
private SharpIdeCodeEdit _sharpIdeCodeEdit = null!;
|
||||||
private SolutionExplorerPanel _solutionExplorerPanel = null!;
|
private SolutionExplorerPanel _solutionExplorerPanel = null!;
|
||||||
|
private InvertedVSplitContainer _invertedVSplitContainer = null!;
|
||||||
private RunPanel _runPanel = null!;
|
private RunPanel _runPanel = null!;
|
||||||
private Button _runMenuButton = null!;
|
private Button _runMenuButton = null!;
|
||||||
private Popup _runMenuPopup = null!;
|
private Popup _runMenuPopup = null!;
|
||||||
@@ -29,25 +31,29 @@ public partial class IdeRoot : Control
|
|||||||
_buildSlnButton = GetNode<Button>("%BuildSlnButton");
|
_buildSlnButton = GetNode<Button>("%BuildSlnButton");
|
||||||
_runMenuPopup = GetNode<Popup>("%RunMenuPopup");
|
_runMenuPopup = GetNode<Popup>("%RunMenuPopup");
|
||||||
_runMenuButton = GetNode<Button>("%RunMenuButton");
|
_runMenuButton = GetNode<Button>("%RunMenuButton");
|
||||||
_runMenuButton.Pressed += () =>
|
|
||||||
{
|
|
||||||
var popupMenuPosition = _runMenuButton.GlobalPosition;
|
|
||||||
const int buttonHeight = 37;
|
|
||||||
_runMenuPopup.Position = new Vector2I((int)popupMenuPosition.X, (int)popupMenuPosition.Y + buttonHeight);
|
|
||||||
_runMenuPopup.Popup();
|
|
||||||
};
|
|
||||||
|
|
||||||
_sharpIdeCodeEdit = GetNode<SharpIdeCodeEdit>("%SharpIdeCodeEdit");
|
_sharpIdeCodeEdit = GetNode<SharpIdeCodeEdit>("%SharpIdeCodeEdit");
|
||||||
_fileDialog = GetNode<FileDialog>("%OpenSolutionDialog");
|
_fileDialog = GetNode<FileDialog>("%OpenSolutionDialog");
|
||||||
_solutionExplorerPanel = GetNode<SolutionExplorerPanel>("%SolutionExplorerPanel");
|
_solutionExplorerPanel = GetNode<SolutionExplorerPanel>("%SolutionExplorerPanel");
|
||||||
|
_runPanel = GetNode<RunPanel>("%RunPanel");
|
||||||
|
_invertedVSplitContainer = GetNode<InvertedVSplitContainer>("%InvertedVSplitContainer");
|
||||||
|
|
||||||
|
_runMenuButton.Pressed += OnRunMenuButtonPressed;
|
||||||
_solutionExplorerPanel.FileSelected += OnSolutionExplorerPanelOnFileSelected;
|
_solutionExplorerPanel.FileSelected += OnSolutionExplorerPanelOnFileSelected;
|
||||||
_fileDialog.FileSelected += OnFileSelected;
|
_fileDialog.FileSelected += OnFileSelected;
|
||||||
_runPanel = GetNode<RunPanel>("%RunPanel");
|
|
||||||
_openSlnButton.Pressed += () => _fileDialog.Visible = true;
|
_openSlnButton.Pressed += () => _fileDialog.Visible = true;
|
||||||
_buildSlnButton.Pressed += OnBuildSlnButtonPressed;
|
_buildSlnButton.Pressed += OnBuildSlnButtonPressed;
|
||||||
|
GodotGlobalEvents.BottomPanelVisibilityChangeRequested += async show => await this.InvokeAsync(() => _invertedVSplitContainer.InvertedSetCollapsed(!show));
|
||||||
OnFileSelected(@"C:\Users\Matthew\Documents\Git\BlazorCodeBreaker\BlazorCodeBreaker.slnx");
|
OnFileSelected(@"C:\Users\Matthew\Documents\Git\BlazorCodeBreaker\BlazorCodeBreaker.slnx");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnRunMenuButtonPressed()
|
||||||
|
{
|
||||||
|
var popupMenuPosition = _runMenuButton.GlobalPosition;
|
||||||
|
const int buttonHeight = 37;
|
||||||
|
_runMenuPopup.Position = new Vector2I((int)popupMenuPosition.X, (int)popupMenuPosition.Y + buttonHeight);
|
||||||
|
_runMenuPopup.Popup();
|
||||||
|
}
|
||||||
|
|
||||||
private async void OnBuildSlnButtonPressed()
|
private async void OnBuildSlnButtonPressed()
|
||||||
{
|
{
|
||||||
await Singletons.BuildService.MsBuildSolutionAsync(_solutionExplorerPanel.SolutionModel.FilePath);
|
await Singletons.BuildService.MsBuildSolutionAsync(_solutionExplorerPanel.SolutionModel.FilePath);
|
||||||
|
|||||||
@@ -99,24 +99,25 @@ size_flags_vertical = 3
|
|||||||
[node name="LeftSideBar" parent="VBoxContainer/HBoxContainer" instance=ExtResource("3_f60gr")]
|
[node name="LeftSideBar" parent="VBoxContainer/HBoxContainer" instance=ExtResource("3_f60gr")]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
|
||||||
[node name="VSplitContainer" type="VSplitContainer" parent="VBoxContainer/HBoxContainer"]
|
[node name="InvertedVSplitContainer" type="VSplitContainer" parent="VBoxContainer/HBoxContainer"]
|
||||||
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
split_offset = 402
|
split_offset = 402
|
||||||
script = ExtResource("3_0ybuf")
|
script = ExtResource("3_0ybuf")
|
||||||
metadata/_custom_type_script = "uid://kvnhndc3l6ih"
|
metadata/_custom_type_script = "uid://kvnhndc3l6ih"
|
||||||
|
|
||||||
[node name="HSplitContainer" type="HSplitContainer" parent="VBoxContainer/HBoxContainer/VSplitContainer"]
|
[node name="HSplitContainer" type="HSplitContainer" parent="VBoxContainer/HBoxContainer/InvertedVSplitContainer"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
split_offset = 400
|
split_offset = 400
|
||||||
|
|
||||||
[node name="SolutionExplorerPanel" type="Panel" parent="VBoxContainer/HBoxContainer/VSplitContainer/HSplitContainer"]
|
[node name="SolutionExplorerPanel" type="Panel" parent="VBoxContainer/HBoxContainer/InvertedVSplitContainer/HSplitContainer"]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
script = ExtResource("2_tcy02")
|
script = ExtResource("2_tcy02")
|
||||||
|
|
||||||
[node name="Tree" type="Tree" parent="VBoxContainer/HBoxContainer/VSplitContainer/HSplitContainer/SolutionExplorerPanel"]
|
[node name="Tree" type="Tree" parent="VBoxContainer/HBoxContainer/InvertedVSplitContainer/HSplitContainer/SolutionExplorerPanel"]
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
anchors_preset = 15
|
anchors_preset = 15
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
@@ -124,7 +125,7 @@ anchor_bottom = 1.0
|
|||||||
grow_horizontal = 2
|
grow_horizontal = 2
|
||||||
grow_vertical = 2
|
grow_vertical = 2
|
||||||
|
|
||||||
[node name="SharpIdeCodeEdit" type="CodeEdit" parent="VBoxContainer/HBoxContainer/VSplitContainer/HSplitContainer"]
|
[node name="SharpIdeCodeEdit" type="CodeEdit" parent="VBoxContainer/HBoxContainer/InvertedVSplitContainer/HSplitContainer"]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
theme_override_colors/current_line_color = Color(0.0588235, 0.0588235, 0.0588235, 1)
|
theme_override_colors/current_line_color = Color(0.0588235, 0.0588235, 0.0588235, 1)
|
||||||
@@ -142,26 +143,26 @@ auto_brace_completion_enabled = true
|
|||||||
auto_brace_completion_highlight_matching = true
|
auto_brace_completion_highlight_matching = true
|
||||||
script = ExtResource("2_qjf5e")
|
script = ExtResource("2_qjf5e")
|
||||||
|
|
||||||
[node name="CodeFixesMenu" type="PopupMenu" parent="VBoxContainer/HBoxContainer/VSplitContainer/HSplitContainer/SharpIdeCodeEdit"]
|
[node name="CodeFixesMenu" type="PopupMenu" parent="VBoxContainer/HBoxContainer/InvertedVSplitContainer/HSplitContainer/SharpIdeCodeEdit"]
|
||||||
size = Vector2i(217, 100)
|
size = Vector2i(217, 100)
|
||||||
item_count = 1
|
item_count = 1
|
||||||
item_0/text = "Getting Context Actions..."
|
item_0/text = "Getting Context Actions..."
|
||||||
item_0/id = 0
|
item_0/id = 0
|
||||||
|
|
||||||
[node name="BottomPanel" type="Panel" parent="VBoxContainer/HBoxContainer/VSplitContainer"]
|
[node name="BottomPanel" type="Panel" parent="VBoxContainer/HBoxContainer/InvertedVSplitContainer"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
script = ExtResource("7_i62lx")
|
script = ExtResource("7_i62lx")
|
||||||
|
|
||||||
[node name="RunPanel" parent="VBoxContainer/HBoxContainer/VSplitContainer/BottomPanel" instance=ExtResource("5_y3aoi")]
|
[node name="RunPanel" parent="VBoxContainer/HBoxContainer/InvertedVSplitContainer/BottomPanel" instance=ExtResource("5_y3aoi")]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
|
|
||||||
[node name="BuildPanel" parent="VBoxContainer/HBoxContainer/VSplitContainer/BottomPanel" instance=ExtResource("9_rllbf")]
|
[node name="BuildPanel" parent="VBoxContainer/HBoxContainer/InvertedVSplitContainer/BottomPanel" instance=ExtResource("9_rllbf")]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
visible = false
|
visible = false
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
|
|
||||||
[node name="ProblemsPanel" parent="VBoxContainer/HBoxContainer/VSplitContainer/BottomPanel" instance=ExtResource("11_b7c1a")]
|
[node name="ProblemsPanel" parent="VBoxContainer/HBoxContainer/InvertedVSplitContainer/BottomPanel" instance=ExtResource("11_b7c1a")]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
visible = false
|
visible = false
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
|
|||||||
Reference in New Issue
Block a user