From cff88764462a220ff6c5edf744985770b1f70c24 Mon Sep 17 00:00:00 2001 From: Matt Parker <61717342+MattParkerDev@users.noreply.github.com> Date: Wed, 27 Aug 2025 19:48:09 +1000 Subject: [PATCH] Create InvertedVSplitContainer node type --- .../CustomControls/InvertedVSplitContainer.cs | 28 +++++++++++++++++++ .../InvertedVSplitContainer.cs.uid | 1 + 2 files changed, 29 insertions(+) create mode 100644 src/SharpIDE.Godot/Features/CustomControls/InvertedVSplitContainer.cs create mode 100644 src/SharpIDE.Godot/Features/CustomControls/InvertedVSplitContainer.cs.uid diff --git a/src/SharpIDE.Godot/Features/CustomControls/InvertedVSplitContainer.cs b/src/SharpIDE.Godot/Features/CustomControls/InvertedVSplitContainer.cs new file mode 100644 index 0000000..5c648f0 --- /dev/null +++ b/src/SharpIDE.Godot/Features/CustomControls/InvertedVSplitContainer.cs @@ -0,0 +1,28 @@ +using Godot; + +namespace SharpIDE.Godot.Features.CustomControls; + +[GlobalClass, Tool] +public partial class InvertedVSplitContainer : VSplitContainer +{ + [Export] + private int _invertedOffset = 200; + + public override void _Ready() + { + Dragged += OnDragged; + } + + private void OnDragged(long offset) + { + _invertedOffset = (int)Size.Y - SplitOffset; + } + + public override void _Notification(int what) + { + if (what == NotificationResized) + { + SplitOffset = (int)Size.Y - _invertedOffset; + } + } +} \ No newline at end of file diff --git a/src/SharpIDE.Godot/Features/CustomControls/InvertedVSplitContainer.cs.uid b/src/SharpIDE.Godot/Features/CustomControls/InvertedVSplitContainer.cs.uid new file mode 100644 index 0000000..7ac5634 --- /dev/null +++ b/src/SharpIDE.Godot/Features/CustomControls/InvertedVSplitContainer.cs.uid @@ -0,0 +1 @@ +uid://kvnhndc3l6ih