Skip to content

Fixed Docked resizing + added docking restrictor#177

Open
yagarifullin wants to merge 2 commits into
flamendless:masterfrom
yagarifullin:master
Open

Fixed Docked resizing + added docking restrictor#177
yagarifullin wants to merge 2 commits into
flamendless:masterfrom
yagarifullin:master

Conversation

@yagarifullin
Copy link
Copy Markdown

Fix docked window resize behavior and add per-window dock restrictions

  • Prevent docked windows from undocking during resize by always
    calling AlterOptions for tethered windows and resetting position
    deltas when resize ends
  • Fix Right dock X position recalculation after resize (X = ViewW - W)
  • Fix Bottom dock Y position recalculation after resize (Y = ViewH - H)
  • Add DisableDocks option to restrict specific dock types per window
    (e.g., DisableDocks = {'Bottom'} prevents docking to bottom edge)

Copy link
Copy Markdown
Owner

@flamendless flamendless left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR!

Comment thread Internal/UI/Dock.lua Outdated
Translate comments to English
@flamendless
Copy link
Copy Markdown
Owner

flamendless commented May 28, 2026

Add DisableDocks option to restrict specific dock types per window
(e.g., DisableDocks = {'Bottom'} prevents docking to bottom edge)

@yagarifullin you also need to add that new option in the documentation in API.lua.
Also here https://github.com/flamendless/Slab/wiki (hopefully you have access to edit it)

@yagarifullin
Copy link
Copy Markdown
Author

Sorry, I don't have access to edit the wiki.

The idea for this feature came up when I realized that controls laid out vertically don't automatically rearrange into a horizontal layout when docked to Bottom. So I added this option to keep vertically arranged windows vertical everywhere. But it works for other sides as well.

DisableDocks is a list of dock types to disable for a specific window. Valid values are 'Left', 'Right', 'Bottom'. When set, the dock overlay for the specified sides will not appear while dragging that window.

Example: DisableDocks = {'Bottom'}

Slab.BeginWindow("MyWindow", {
Title = "My Window",
W = 300, H = 300,
DisableDocks = {'Bottom'},
})

@flamendless
Copy link
Copy Markdown
Owner

Sorry, I don't have access to edit the wiki.

The idea for this feature came up when I realized that controls laid out vertically don't automatically rearrange into a horizontal layout when docked to Bottom. So I added this option to keep vertically arranged windows vertical everywhere. But it works for other sides as well.

DisableDocks is a list of dock types to disable for a specific window. Valid values are 'Left', 'Right', 'Bottom'. When set, the dock overlay for the specified sides will not appear while dragging that window.

Example: DisableDocks = {'Bottom'}

Slab.BeginWindow("MyWindow", {
Title = "My Window",
W = 300, H = 300,
DisableDocks = {'Bottom'},
})

Thank you for the explanations! I'll merge it once the changes in API.lua has been made

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants