godot icon indicating copy to clipboard operation
godot copied to clipboard

Fix FileSystemList renaming popup offset issue

Open alessandrofama opened this issue 1 year ago • 2 comments

This fix addresses an issue that occurs when renaming a file while having scrolled within the ItemList. The problem is that the popup for renaming an asset will spawn at an incorrect position because the scroll bar's current value is not considered when calculating the popup position. This behaviour can be observed in this video:

https://github.com/godotengine/godot/assets/26153311/f8e0d1e7-80e9-4759-b963-57aaebc0a796

To resolve this, I've removed the call to ensure_current_is_visible to prevent delayed adjustments to the VScrollBar (which calls queue_redraw on the ItemList and updates the scroll bar too late). Instead, the scroll bar's value is set directly if the item is not visible. The popup position is then adjusted, taking the scroll bar value into account.

Fix video:

https://github.com/godotengine/godot/assets/26153311/4f6cf7ec-b9eb-4444-9dcb-bd6820b163a7

  • Fixes https://github.com/godotengine/godot/issues/82369
  • Fixes https://github.com/godotengine/godot/issues/86437

alessandrofama avatar Jan 11 '24 23:01 alessandrofama

The popup still overlaps the scrollbar. It would be nice if it was fit properly, like in tree mode.

KoBeWi avatar Jan 14 '24 19:01 KoBeWi

The popup still overlaps the scrollbar. It would be nice if it was fit properly, like in tree mode.

Like this?

https://github.com/godotengine/godot/assets/26153311/3925ec09-daf1-4bd7-8747-e0b4e0a7604e

I noticed that the right-to-left functionality was not working correctly in both IconModes. I have fixed the issue as well :) https://github.com/godotengine/godot/assets/26153311/09023f83-c89d-4db6-bd5e-9fb09d2a750f

alessandrofama avatar Jan 15 '24 17:01 alessandrofama