Implement dragging layers into the group/new/delete buttons in the Layers panel (#4153)

This commit is contained in:
Keavon Chambers
2026-05-15 15:39:01 -07:00
committed by GitHub
parent 79df7cfa87
commit 06e2a049de
8 changed files with 98 additions and 3 deletions
@@ -3288,17 +3288,23 @@ impl DocumentMessageHandler {
let group_folder_type = GroupFolderType::Layer;
DocumentMessage::GroupSelectedLayers { group_folder_type }.into()
})
.on_drag_drop(|_| {
let group_folder_type = GroupFolderType::Layer;
DocumentMessage::GroupSelectedLayers { group_folder_type }.into()
})
.disabled(!has_selection)
.widget_instance(),
IconButton::new("NewLayer", 24)
.tooltip_label("New Layer")
.tooltip_shortcut(action_shortcut!(DocumentMessageDiscriminant::CreateEmptyFolder))
.on_update(|_| DocumentMessage::CreateEmptyFolder.into())
.on_drag_drop(|_| DocumentMessage::DuplicateSelectedLayers.into())
.widget_instance(),
IconButton::new("Trash", 24)
.tooltip_label("Delete Selected")
.tooltip_shortcut(action_shortcut!(DocumentMessageDiscriminant::DeleteSelectedLayers))
.on_update(|_| DocumentMessage::DeleteSelectedLayers.into())
.on_drag_drop(|_| DocumentMessage::DeleteSelectedLayers.into())
.disabled(!has_selection)
.widget_instance(),
];