mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-16 23:08:05 +08:00
committed by
Keavon Chambers
parent
564560c7dd
commit
a5bea53db2
@@ -300,6 +300,14 @@ impl Document {
|
||||
let children = self.layer_panel(path.as_slice())?;
|
||||
Some(vec![DocumentResponse::DocumentChanged, DocumentResponse::ExpandFolder { path, children }])
|
||||
}
|
||||
Operation::ToggleVisibility { path } => {
|
||||
let _ = self.layer_mut(&path).map(|layer| {
|
||||
layer.visible = !layer.visible;
|
||||
layer.cache_dirty = true;
|
||||
});
|
||||
let children = self.layer_panel(&path.as_slice()[..path.len() - 1])?;
|
||||
Some(vec![DocumentResponse::ExpandFolder { path: vec![], children }])
|
||||
}
|
||||
};
|
||||
Ok(responses)
|
||||
}
|
||||
|
||||
@@ -68,4 +68,7 @@ pub enum Operation {
|
||||
DiscardWorkingFolder,
|
||||
ClearWorkingFolder,
|
||||
CommitTransaction,
|
||||
ToggleVisibility {
|
||||
path: Vec<LayerId>,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user