mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-02 06:28:11 +08:00
Retire layer paths used throughout the code (#1531)
* Part 1 * Part 2 * Part 3 * Part 4 * Part 5 * Part 6 * Part 7 * Part 8
This commit is contained in:
@@ -40,7 +40,9 @@ A message is an enum variant of a certain message sub-type like `FrontendMessage
|
||||
DocumentMessage::DeleteSelectedLayers
|
||||
|
||||
// Carries a layer path and a string as data
|
||||
DocumentMessage::RenameLayer(Vec<LayerId>, String)
|
||||
DocumentMessage::DeleteLayer {
|
||||
id: NodeId,
|
||||
}
|
||||
```
|
||||
|
||||
Message sub-types hierarchically wrap other message sub-types; for example, `DocumentMessage` is wrapped by `PortfolioMessage` via:
|
||||
@@ -66,3 +68,8 @@ instead of:
|
||||
```rs
|
||||
Message(PortfolioMessage::Document(DocumentMessage::DeleteSelectedLayers))
|
||||
```
|
||||
|
||||
And when pushing a message to the queue, we have the `add` and `add_front` functions which call `.into()` for you. Therefore it's as simple as writing:
|
||||
```rs
|
||||
responses.add(DocumentMessage::DeleteSelectedLayers.into());
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user