Add more actions to the Layer menu bar entries

This commit is contained in:
Keavon Chambers 2024-12-26 16:31:13 -08:00
parent a6676e4abd
commit feba87449b
3 changed files with 33 additions and 11 deletions

View File

@ -290,6 +290,11 @@ impl fmt::Display for Key {
KeyboardPlatformLayout::Standard => "Ctrl",
KeyboardPlatformLayout::Mac => "",
},
Self::MouseLeft => "LMB",
Self::MouseRight => "RMB",
Self::MouseMiddle => "MMB",
Self::MouseBack => "Mouse Back",
Self::MouseForward => "Mouse Fwd",
_ => key_name.as_str(),
};

View File

@ -183,6 +183,14 @@ impl LayoutHolder for MenuBarMessageHandler {
"Layer".into(),
no_active_document,
MenuBarEntryChildren(vec![
vec![MenuBarEntry {
label: "New".into(),
icon: Some("NewLayer".into()),
shortcut: action_keys!(DocumentMessageDiscriminant::CreateEmptyFolder),
action: MenuBarEntry::create_action(|_| DocumentMessage::CreateEmptyFolder.into()),
disabled: no_active_document,
..MenuBarEntry::default()
}],
vec![
MenuBarEntry {
label: "Select All".into(),
@ -213,14 +221,24 @@ impl LayoutHolder for MenuBarMessageHandler {
..MenuBarEntry::default()
},
],
vec![MenuBarEntry {
vec![
MenuBarEntry {
label: "Group Selected".into(),
icon: Some("Folder".into()),
shortcut: action_keys!(DocumentMessageDiscriminant::GroupSelectedLayers),
action: MenuBarEntry::create_action(|_| DocumentMessage::GroupSelectedLayers.into()),
disabled: no_active_document || !has_selected_layers,
..MenuBarEntry::default()
},
MenuBarEntry {
label: "Delete Selected".into(),
icon: Some("Trash".into()),
shortcut: action_keys!(DocumentMessageDiscriminant::DeleteSelectedLayers),
action: MenuBarEntry::create_action(|_| DocumentMessage::DeleteSelectedLayers.into()),
disabled: no_active_document || !has_selected_nodes,
..MenuBarEntry::default()
}],
},
],
vec![
MenuBarEntry {
label: "Grab Selected".into(),

View File

@ -164,9 +164,8 @@
margin: calc(calc(18px - 12px) / 2) 0;
}
& + .input-key::before {
line-height: 18px;
content: "+";
& + .input-key {
margin-left: 4px;
}
}
}