mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-01 13:38:11 +08:00
Add support for double-clicking to rename document tabs (#4072)
This commit is contained in:
@@ -180,6 +180,11 @@
|
||||
clickAction={(tabIndex) => editor.selectDocument($portfolio.documents[tabIndex].id)}
|
||||
closeAction={(tabIndex) => editor.closeDocumentWithConfirmation($portfolio.documents[tabIndex].id)}
|
||||
reorderAction={(oldIndex, newIndex) => editor.reorderDocument($portfolio.documents[oldIndex].id, newIndex)}
|
||||
renameAction={(tabIndex, newName) => {
|
||||
// Ensure the target document is the active one before renaming, since `RenameDocument` operates on the active document
|
||||
editor.selectDocument($portfolio.documents[tabIndex].id);
|
||||
editor.renameDocument(newName);
|
||||
}}
|
||||
tabActiveIndex={$portfolio.activeDocumentIndex}
|
||||
groupDropAction={groupDrop}
|
||||
splitDropAction={splitDrop}
|
||||
|
||||
Reference in New Issue
Block a user