Implement layer renaming (#501)

* Implement layer renaming

* Fix sneaky typo in CSS

Co-authored-by: Moritz Vetter <16950410+HansAuger@users.noreply.github.com>

Co-authored-by: Moritz Vetter <16950410+HansAuger@users.noreply.github.com>
This commit is contained in:
Keavon Chambers
2022-01-29 11:04:15 -08:00
co-authored by Moritz Vetter
parent 7910395191
commit dae79caf15
11 changed files with 144 additions and 42 deletions
+7
View File
@@ -364,6 +364,7 @@ impl JsEditorHandle {
self.dispatch(message);
}
/// Modify the layer selection based on the layer which is clicked while holding down the <kbd>Ctrl</kbd> and/or <kbd>Shift</kbd> modifier keys used for range selection behavior
pub fn select_layer(&self, layer_path: Vec<LayerId>, ctrl: bool, shift: bool) {
let message = DocumentMessage::SelectLayer { layer_path, ctrl, shift };
self.dispatch(message);
@@ -397,6 +398,12 @@ impl JsEditorHandle {
self.dispatch(message);
}
/// Set the name for the layer
pub fn set_layer_name(&self, layer_path: Vec<LayerId>, name: String) {
let message = DocumentMessage::SetLayerName { layer_path, name };
self.dispatch(message);
}
/// Set the blend mode for the selected layers
pub fn set_blend_mode_for_selected_layers(&self, blend_mode_svg_style_name: String) -> Result<(), JsValue> {
if let Some(blend_mode) = translate_blend_mode(blend_mode_svg_style_name.as_str()) {