mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-27 16:59:43 +01:00
Keep the Graph status message in its source language
This commit is contained in:
1 parent
fba5f9e6ea
commit
fee2330c53
1 file changed
+10
-1
@@ -31,7 +31,7 @@ pub fn open_tool_dialog(app: &mut VectorcraftApp, kind: &str, p: Value) {
|
||||
// Graph tool click: the graph's size.
|
||||
"graph" => {
|
||||
let Some(document) = app.session.active().map(|doc| doc.uid) else {
|
||||
app.status(tl!("Open a document before drawing a graph").to_string());
|
||||
app.status("Open a document before drawing a graph");
|
||||
return;
|
||||
};
|
||||
let at = click_of(&p).map_or(Point::new(0.0, 0.0), |c| c.at);
|
||||
@@ -127,6 +127,15 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn graph_size_without_a_document_keeps_the_source_status() {
|
||||
let mut app = crate::testing::windowed(VectorcraftApp::new(Session::new(), Default::default()));
|
||||
open_tool_dialog(&mut app, "graph", json!({"x": 40.0, "y": 30.0}));
|
||||
|
||||
assert_eq!(app.ui.status, "Open a document before drawing a graph");
|
||||
assert!(!app.any_dialog_open());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn graph_size_does_not_draw_in_a_different_document() {
|
||||
let mut app = crate::testing::windowed(VectorcraftApp::new(Session::new(), Default::default()));
|
||||
|
||||
Reference in new issue
Block a user