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

Change scene drag-and-drop modifier behavior in the 2D and 3D editors #87623

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Jan 26, 2024

Behavior is now consistent across 2D and 3D editors.

  • By default, drag-and-dropping adds the scene as a child of the selected node. Hold Alt when releasing the mouse to add the scene as a child of the root node, or Shift to add the scene as a sibling of the selected node.
  • To choose a different node type in the 2D editor when drag-and-dropping a texture resource, hold Alt + Shift (instead of just Alt).
  • If multiple nodes are selected, only the first one is taken into account. This was previously the behavior in 2D, but not in 3D (an error dialog appeared instead). This makes the UI more forgiving.

Ctrl is no longer used in shortcuts because it interferes with the grid snapping toggle. Using Alt in shortcuts here is fine, because it's checked when the mouse is released, not when it's pressed. Therefore, it'll work correctly on Linux with window manager defaults.


Preview

I hold Alt when performing the last drag-and-drop operation, which is why the last node is added to the root node instead.

simplescreenrecorder-2024-01-26_18.00.20.mp4

Behavior is now consistent across 2D and 3D editors.

- By default, drag-and-dropping adds the scene as a child of the selected
  node. Hold Alt when releasing the mouse to add the scene as a child
  of the root node, or Shift to add the scene as a sibling of the selected
  node.
- To choose a different node type in the 2D editor when drag-and-dropping
  a texture resource, hold Alt + Shift (instead of just Alt).
- If multiple nodes are selected, only the first one is taken into account.
  This was previously the behavior in 2D, but not in 3D (an error dialog
  appeared instead). This makes the UI more forgiving.
@Calinou Calinou requested a review from a team as a code owner January 26, 2024 17:06
@Calinou Calinou added enhancement topic:editor usability cherrypick:3.x Considered for cherry-picking into a future 3.x release labels Jan 26, 2024
@Calinou Calinou added this to the 4.3 milestone Jan 26, 2024
@ryevdokimov
Copy link
Contributor

#87126 is related.

@ryevdokimov
Copy link
Contributor

Tested every scenario in the description. Seems to work.

@akien-mga akien-mga requested a review from KoBeWi January 29, 2024 13:35
@KoBeWi
Copy link
Member

KoBeWi commented Jan 29, 2024

For 2D, the current behavior was implemented in #51011
Although before that there was no way to control where the node is added, so changing the default is fine.

@KoBeWi
Copy link
Member

KoBeWi commented Feb 5, 2024

Using Alt+Shift for changing type makes it impossible to change type and add as sibling.

Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

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

Looks fine overall.

The Shift+Alt conflict I mentioned is a corner-case, I'm not sure what modifier we could use to deconflict it. Maybe it's fine this way.

@akien-mga akien-mga merged commit 07655a0 into godotengine:master Feb 5, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:3.x Considered for cherry-picking into a future 3.x release enhancement regression topic:editor usability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dragging an object does not respect selection.
4 participants