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
@@ -641,6 +641,13 @@ impl Document {
layer.visible = *visible;
Some([vec![DocumentChanged], update_thumbnails_upstream(path)].concat())
}
Operation::SetLayerName { path, name } => {
self.mark_as_dirty(path)?;
let mut layer = self.layer_mut(path)?;
layer.name = if name.as_str() == "" { None } else { Some(name.clone()) };
Some(vec![LayerChanged { path: path.clone() }])
}
Operation::SetLayerBlendMode { path, blend_mode } => {
self.mark_as_dirty(path)?;
self.layer_mut(path)?.blend_mode = *blend_mode;