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

Import dock randomly causes sidebar size jumps #64273

Closed
KoBeWi opened this issue Aug 11, 2022 · 4 comments · Fixed by #65036
Closed

Import dock randomly causes sidebar size jumps #64273

KoBeWi opened this issue Aug 11, 2022 · 4 comments · Fixed by #65036

Comments

@KoBeWi
Copy link
Member

KoBeWi commented Aug 11, 2022

Godot version

e9e9e92

System information

Windows 10 x64

Issue description

Seems like minimum size of the import dock varies greatly and it can abruptly change sidebar's width. It always happens when switching to Import tab, but also randomly on it's own.
ezgif com-gif-maker

Might be caused #59303
But the random jumps and minsize weirdness looks similar to #43749

Steps to reproduce

  1. Select different files in the filesystem dock (scene, texture, sample etc)
  2. The left dock will randomly change size
  3. If not, switch to Import tab and observe size jump

EDIT:
Better reproduction steps:

  1. Select any texture in filesystem dock
  2. Create a new folder -> the dock expands
  3. Select a scene file
  4. Rename the folder -> the dock shrinks again

Minimal reproduction project

No response

@KoBeWi
Copy link
Member Author

KoBeWi commented Aug 13, 2022

Ok I found a way to trigger this reliably. The random jump seems to happen on filesystem update.
godot_fteS2KJT9C
So it's indeed the same as #43749 + some random size refresh from filesystem + #59303 making the import dock wider.

@Rindbee
Copy link
Contributor

Rindbee commented Aug 24, 2022

It feels like the TabContainer here has use_hidden_tabs_for_min_size enabled.

And the split_offset of SplitContainer is not relative to the begin of the container, but the end (according to the minimum size) of the first child control.

Peek 2022-08-25 07-15
When it is negative, it resets to 0 on dragging again, then the jump happens.

Changes in the minimum size of the first child control will not cause split_offset to change, but the absolute offset (relative to the begin of the container) does change.

@Rindbee
Copy link
Contributor

Rindbee commented Aug 27, 2022

Take back the previous conclusions. drag_ofs uses the split_offset at the start of dragging in the following code, which will cause the split_offset calculated by the change of the minimum size of the child control to be overwritten.

if (!vertical && is_layout_rtl()) {
split_offset = drag_ofs + (drag_from - (vertical ? mm->get_position().y : mm->get_position().x));
} else {
split_offset = drag_ofs + ((vertical ? mm->get_position().y : mm->get_position().x) - drag_from);
}
should_clamp_split_offset = true;
queue_sort();

@KoBeWi
Copy link
Member Author

KoBeWi commented Aug 29, 2022

This is the culprit for wide import dock:
image
It either should be shorter or the OptionButton should have trimming enabled

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

Successfully merging a pull request may close this issue.

3 participants