diff --git a/src/SharpIDE.Godot/Features/BottomPanel/BottomPanelManager.cs b/src/SharpIDE.Godot/Features/BottomPanel/BottomPanelManager.cs index 84b6cc2..48f374d 100644 --- a/src/SharpIDE.Godot/Features/BottomPanel/BottomPanelManager.cs +++ b/src/SharpIDE.Godot/Features/BottomPanel/BottomPanelManager.cs @@ -31,7 +31,11 @@ public partial class BottomPanelManager : Panel { if (type == null) { - // TODO: Ask parent to to collapse slider. + GodotGlobalEvents.InvokeBottomPanelVisibilityChangeRequested(false); + } + else + { + GodotGlobalEvents.InvokeBottomPanelVisibilityChangeRequested(true); } foreach (var kvp in _panelTypeMap) { diff --git a/src/SharpIDE.Godot/Features/CustomControls/InvertedVSplitContainer.cs b/src/SharpIDE.Godot/Features/CustomControls/InvertedVSplitContainer.cs index 5c648f0..81f7d77 100644 --- a/src/SharpIDE.Godot/Features/CustomControls/InvertedVSplitContainer.cs +++ b/src/SharpIDE.Godot/Features/CustomControls/InvertedVSplitContainer.cs @@ -7,6 +7,23 @@ public partial class InvertedVSplitContainer : VSplitContainer { [Export] 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() { diff --git a/src/SharpIDE.Godot/GodotGlobalEvents.cs b/src/SharpIDE.Godot/GodotGlobalEvents.cs index e91e01e..181c702 100644 --- a/src/SharpIDE.Godot/GodotGlobalEvents.cs +++ b/src/SharpIDE.Godot/GodotGlobalEvents.cs @@ -4,6 +4,9 @@ public static class GodotGlobalEvents { public static event Func BottomPanelTabSelected = _ => Task.CompletedTask; public static void InvokeBottomPanelTabSelected(BottomPanelType? type) => BottomPanelTabSelected.Invoke(type); + + public static event Func BottomPanelVisibilityChangeRequested = _ => Task.CompletedTask; + public static void InvokeBottomPanelVisibilityChangeRequested(bool show) => BottomPanelVisibilityChangeRequested.Invoke(show); } public enum BottomPanelType diff --git a/src/SharpIDE.Godot/IdeRoot.cs b/src/SharpIDE.Godot/IdeRoot.cs index 627e7a8..163c34c 100644 --- a/src/SharpIDE.Godot/IdeRoot.cs +++ b/src/SharpIDE.Godot/IdeRoot.cs @@ -4,6 +4,7 @@ using Godot; using Microsoft.Build.Locator; using SharpIDE.Application.Features.Analysis; using SharpIDE.Application.Features.SolutionDiscovery.VsPersistence; +using SharpIDE.Godot.Features.CustomControls; using SharpIDE.Godot.Features.Run; using SharpIDE.Godot.Features.SolutionExplorer; @@ -16,6 +17,7 @@ public partial class IdeRoot : Control private FileDialog _fileDialog = null!; private SharpIdeCodeEdit _sharpIdeCodeEdit = null!; private SolutionExplorerPanel _solutionExplorerPanel = null!; + private InvertedVSplitContainer _invertedVSplitContainer = null!; private RunPanel _runPanel = null!; private Button _runMenuButton = null!; private Popup _runMenuPopup = null!; @@ -29,25 +31,29 @@ public partial class IdeRoot : Control _buildSlnButton = GetNode