mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-15 12:24:19 +00:00
Merge pull request #7449 from dotCooCoo/fix/links-stored-brush-art
Links: placed images in stored brush art get Links rows
This commit is contained in:
@@ -360,8 +360,8 @@ fn badge(ui: &Ui, r: egui::Rect, status: &str) {
|
||||
}
|
||||
|
||||
/// The tooltip of row `r`. A row outside the layer tree also names where it is stored
|
||||
/// (`links.list`'s `owner`): the symbol, graph design or pattern whose art holds it, and the object
|
||||
/// whose opacity mask holds it, by `mask` (that object's name) or else by its id.
|
||||
/// (`links.list`'s `owner`): the symbol, graph design, pattern or brush whose art holds it, and the
|
||||
/// object whose opacity mask holds it, by `mask` (that object's name) or else by its id.
|
||||
pub(super) fn status_tip(r: &Value, mask: Option<String>) -> String {
|
||||
let tip = file_tip(r);
|
||||
let owner = &r["owner"];
|
||||
@@ -370,6 +370,7 @@ pub(super) fn status_tip(r: &Value, mask: Option<String>) -> String {
|
||||
Some("symbol") => Some(tl!("Symbols")),
|
||||
Some("graphDesign") => Some(tl!("Graph Design")),
|
||||
Some("pattern") => Some(tl!("Pattern")),
|
||||
Some("brush") => Some(tl!("Brushes")),
|
||||
_ => None,
|
||||
};
|
||||
let tip = match art {
|
||||
|
||||
@@ -189,6 +189,7 @@ fn a_nested_rows_tooltip_names_what_holds_it() {
|
||||
assert_eq!(tip(json!({"kind": "symbol", "name": "Mark"}), None), "/x/a.png\nSymbols: Mark");
|
||||
assert_eq!(tip(json!({"kind": "pattern", "name": "Dots"}), None), "/x/a.png\nPattern: Dots");
|
||||
assert_eq!(tip(json!({"kind": "graphDesign", "name": "Bar"}), None), "/x/a.png\nGraph Design: Bar");
|
||||
assert_eq!(tip(json!({"kind": "brush", "name": "Leaf", "index": 2}), None), "/x/a.png\nBrushes: Leaf");
|
||||
assert_eq!(tip(json!({"kind": "layers", "maskOf": 7}), Some("<Ellipse>")), "/x/a.png\nOpacity Mask: <Ellipse>");
|
||||
assert_eq!(tip(json!({"kind": "symbol", "name": "Mark", "maskOf": 7}), None), "/x/a.png\nSymbols: Mark\nOpacity Mask: 7");
|
||||
// A row in the layers says only its file.
|
||||
|
||||
Reference in New Issue
Block a user