X Tutup
Skip to content

Unify FileDialog context menus#111116

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
KoBeWi:fdm
Oct 6, 2025
Merged

Unify FileDialog context menus#111116
Repiteo merged 1 commit intogodotengine:masterfrom
KoBeWi:fdm

Conversation

@KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Oct 1, 2025

Part of godotengine/godot-proposals#6831

This PR adds missing context menu options to FileDialog, which existed in EditorFileDialog.

  • Fixed ITEM_MENU_COPY_PATH being unused
  • Added ITEM_MENU_DELETE
    • Moves file/folder to trash, after confirmation
    • Can be disabled with new customization flag
  • Added ITEM_MENU_REFRESH
  • Added ITEM_MENU_NEW_FOLDER
    • Same as New Folder button, and also can be disabled by the same customization flag
  • Text for ITEM_MENU_SHOW_IN_EXPLORER changes depending whether file or folder is clicked
  • Menu creation is unified into single method
gaxH6c4lxO.mp4

The items are missing icons and shortcuts, I will add them in a follow-up.

@KoBeWi KoBeWi added this to the 4.6 milestone Oct 1, 2025
@KoBeWi KoBeWi requested review from a team as code owners October 1, 2025 12:56
@YeldhamDev
Copy link
Member

YeldhamDev commented Oct 1, 2025

Unlike with EditorFileDialog, pressing delete doesn't trigger the file's deletion. Also, toggling deleting_enabled doesn't seem to disable deletion, but instead changes layout_toggle_enabled.

@KoBeWi
Copy link
Member Author

KoBeWi commented Oct 1, 2025

pressing delete doesn't trigger the file's deletion

That's because the shortcut is not assigned yet. I'll do it in a follow-up, as it involves adding new ui_ actions.

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

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

Tested locally, it works as expected. Code looks good to me.

@Repiteo Repiteo merged commit f9a2ecd into godotengine:master Oct 6, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Oct 6, 2025

Thanks!

@KoBeWi KoBeWi deleted the fdm branch October 6, 2025 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

X Tutup