SNaBorderedWindow: self-contained drag via real layout position#20
Merged
Conversation
…in Widgets/WindowWidgets Co-authored-by: SodiumZH <46860829+SodiumZH@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement SNaBorderedWindow widget for UE5 Slate
Implement SNaBorderedWindow: 9-part bordered window widget with drag/resize
Feb 23, 2026
…form Co-authored-by: SodiumZH <46860829+SodiumZH@users.noreply.github.com>
Copilot
AI
changed the title
Implement SNaBorderedWindow: 9-part bordered window widget with drag/resize
SNaBorderedWindow: implement self-contained top-border drag
Feb 24, 2026
… via TAttribute Co-authored-by: SodiumZH <46860829+SodiumZH@users.noreply.github.com>
Copilot
AI
changed the title
SNaBorderedWindow: implement self-contained top-border drag
SNaBorderedWindow: self-contained drag via real layout position
Feb 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Top-border drag was silently ignored, then fixed with
SetRenderTransform— which only shifts pixels. Layout geometry stays put, so all child widget hit-boxes remain at the original position regardless of where the window visually appears.Changes
Real position tracking (
WindowPosition)CurrentRenderOffset/DragStartRenderOffsetwithWindowPosition/DragStartWindowPosition(FVector2D, zero-initialised).GetWindowPosition() constfor callers to read the live position.Outer canvas with
TAttribute-bound slotRebuildLayoutnow wraps the innerSBox/Canvastree in a widget-ownedOuterCanvas:The slot position is a live delegate — re-evaluated by
ArrangeChildrenon every layout pass.Drag move path
WindowPosition = DragStartWindowPosition + Delta; OuterCanvas->Invalidate(EInvalidateWidgetReason::Layout);Invalidate(Layout)triggers re-arrangement; Slate re-queries theTAttribute, places the entire subtree (9-patch +ContentWidget) at the new real layout position, and child hit-boxes follow correctly.Original prompt
Implement SNaBorderedWindow Widget
Overview
Create a fully functional bordered window widget for UE5 Slate that supports dragging and resizing with 9-part image composition (similar to 9-slice scaling pattern).
Requirements
1. Core Architecture
SCompoundWidget2. Size Parameters Structure
Create a configuration struct
FNaBorderedWindowParams:3. Widget Structure
File locations:
Plugins/NaWidgets/Source/NaWidgets/Public/Widgets/SNaBorderedWindow.hPlugins/NaWidgets/Source/NaWidgets/Private/Widgets/SNaBorderedWindow.cppClass definition:
4. Drag-and-Drop Functionality
4.1 Top Border Dragging (Window Movement)
4.2 Bottom-Right Corner Dragging (Window Resizing)
This pull request was created from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.