Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Editor dock resizing consistent #83359

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions doc/classes/SplitContainer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@
<member name="dragger_visibility" type="int" setter="set_dragger_visibility" getter="get_dragger_visibility" enum="SplitContainer.DraggerVisibility" default="0">
Determines the dragger's visibility. See [enum DraggerVisibility] for details.
</member>
<member name="push_nested" type="bool" setter="set_push_nested" getter="is_pushing_nested" default="false">
If [code]true[/code], the [SplitContainer] will adjust its parent's [member split_offset] when dragging has reached the child's minimum size so dragging can continue. This can be chained in multiple [SplitContainer]s.
[b]Note:[/b] If the parent [SplitContainer] is not aligned with [member vertical], its parent will be used instead. If the parent is not a [SplitContainer], nothing happens.
</member>
<member name="resize_separately" type="bool" setter="set_resize_separately" getter="is_resizing_separately" default="false">
If [code]true[/code], the [SplitContainer] will adjust its child's [member split_offset] when dragging so only the closest split gets resized, until prevented by the child's minimum size. If [member push_nested] is [code]false[/code], dragging cannot continue past its descendent [SplitContainer]s [member split_offset] if it is in the same [member vertical] direction.
</member>
<member name="split_offset" type="int" setter="set_split_offset" getter="get_split_offset" default="0">
The initial offset of the splitting between the two [Control]s, with [code]0[/code] being at the end of the first [Control].
</member>
Expand Down
4 changes: 4 additions & 0 deletions editor/debugger/script_editor_debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1871,11 +1871,15 @@ ScriptEditorDebugger::ScriptEditorDebugger() {
vbc->add_child(parent_sc);
parent_sc->set_v_size_flags(SIZE_EXPAND_FILL);
parent_sc->set_split_offset(500 * EDSCALE);
parent_sc->set_push_nested(true);
parent_sc->set_resize_separately(true);

HSplitContainer *sc = memnew(HSplitContainer);
sc->set_v_size_flags(SIZE_EXPAND_FILL);
sc->set_h_size_flags(SIZE_EXPAND_FILL);
parent_sc->add_child(sc);
sc->set_push_nested(true);
sc->set_resize_separately(true);

VBoxContainer *stack_vb = memnew(VBoxContainer);
stack_vb->set_h_size_flags(SIZE_EXPAND_FILL);
Expand Down
4 changes: 4 additions & 0 deletions editor/editor_dock_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -657,11 +657,15 @@ bool EditorDockManager::are_docks_visible() const {
void EditorDockManager::add_vsplit(DockSplitContainer *p_split) {
vsplits.push_back(p_split);
p_split->connect("dragged", callable_mp(this, &EditorDockManager::_dock_split_dragged));
p_split->set_push_nested(true);
p_split->set_resize_separately(true);
}

void EditorDockManager::add_hsplit(DockSplitContainer *p_split) {
hsplits.push_back(p_split);
p_split->connect("dragged", callable_mp(this, &EditorDockManager::_dock_split_dragged));
p_split->set_push_nested(true);
p_split->set_resize_separately(true);
}

void EditorDockManager::register_dock_slot(DockSlot p_dock_slot, TabContainer *p_tab_container) {
Expand Down
Loading
Loading