mirror of
https://github.com/storytold/gridcraft.git
synced 2026-10-31 14:17:12 -06:00
Merge pull request #448 from Dejan-Port:select-inserted-chart
This commit is contained in:
@@ -1432,7 +1432,13 @@ fn insert(app: &mut SheetApp, ui: &mut Ui) {
|
||||
let __k = big_button(ui, Icon::Chart, "Recommended\nCharts", "Recommended Charts", false);
|
||||
control_keytip(app, ui, &__k, "insert.recommendedCharts");
|
||||
if __k.clicked() {
|
||||
act(app, "insert.recommendedCharts", json!({}));
|
||||
match app.run("insert.recommendedCharts", json!({})) {
|
||||
// The new chart is selected, as after inserting any other object (see insert.chart
|
||||
// in dialogs.rs) — otherwise the prior cell/range selection is left in place, and
|
||||
// Del right after inserting deletes the source data instead of the chart.
|
||||
Ok(r) => app.selected_chart = r.get("chart").and_then(serde_json::Value::as_u64).and_then(|id| u32::try_from(id).ok()),
|
||||
Err(e) => app.message = Some(("GridCraft".into(), crate::clean_error(&e))),
|
||||
}
|
||||
}
|
||||
ui.vertical(|ui| {
|
||||
ui.horizontal(|ui| {
|
||||
|
||||
Reference in New Issue
Block a user