Add more actions to the Layer menu bar entries
This commit is contained in:
parent
a6676e4abd
commit
feba87449b
|
|
@ -290,6 +290,11 @@ impl fmt::Display for Key {
|
||||||
KeyboardPlatformLayout::Standard => "Ctrl",
|
KeyboardPlatformLayout::Standard => "Ctrl",
|
||||||
KeyboardPlatformLayout::Mac => "⌘",
|
KeyboardPlatformLayout::Mac => "⌘",
|
||||||
},
|
},
|
||||||
|
Self::MouseLeft => "LMB",
|
||||||
|
Self::MouseRight => "RMB",
|
||||||
|
Self::MouseMiddle => "MMB",
|
||||||
|
Self::MouseBack => "Mouse Back",
|
||||||
|
Self::MouseForward => "Mouse Fwd",
|
||||||
|
|
||||||
_ => key_name.as_str(),
|
_ => key_name.as_str(),
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -183,6 +183,14 @@ impl LayoutHolder for MenuBarMessageHandler {
|
||||||
"Layer".into(),
|
"Layer".into(),
|
||||||
no_active_document,
|
no_active_document,
|
||||||
MenuBarEntryChildren(vec![
|
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![
|
vec![
|
||||||
MenuBarEntry {
|
MenuBarEntry {
|
||||||
label: "Select All".into(),
|
label: "Select All".into(),
|
||||||
|
|
@ -213,14 +221,24 @@ impl LayoutHolder for MenuBarMessageHandler {
|
||||||
..MenuBarEntry::default()
|
..MenuBarEntry::default()
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
vec![MenuBarEntry {
|
vec![
|
||||||
label: "Delete Selected".into(),
|
MenuBarEntry {
|
||||||
icon: Some("Trash".into()),
|
label: "Group Selected".into(),
|
||||||
shortcut: action_keys!(DocumentMessageDiscriminant::DeleteSelectedLayers),
|
icon: Some("Folder".into()),
|
||||||
action: MenuBarEntry::create_action(|_| DocumentMessage::DeleteSelectedLayers.into()),
|
shortcut: action_keys!(DocumentMessageDiscriminant::GroupSelectedLayers),
|
||||||
disabled: no_active_document || !has_selected_nodes,
|
action: MenuBarEntry::create_action(|_| DocumentMessage::GroupSelectedLayers.into()),
|
||||||
..MenuBarEntry::default()
|
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![
|
vec![
|
||||||
MenuBarEntry {
|
MenuBarEntry {
|
||||||
label: "Grab Selected".into(),
|
label: "Grab Selected".into(),
|
||||||
|
|
|
||||||
|
|
@ -164,9 +164,8 @@
|
||||||
margin: calc(calc(18px - 12px) / 2) 0;
|
margin: calc(calc(18px - 12px) / 2) 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
& + .input-key::before {
|
& + .input-key {
|
||||||
line-height: 18px;
|
margin-left: 4px;
|
||||||
content: "+";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue