From 625b8020b2cfa754684cad857c725941c78468f8 Mon Sep 17 00:00:00 2001 From: alemidev Date: Tue, 21 Jun 2022 12:24:28 +0200 Subject: [PATCH] feat: allow to rename panels --- Cargo.toml | 2 +- src/app/gui/metric.rs | 4 ++-- src/app/gui/panel.rs | 39 ++++++++++++++++++++++----------------- 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4e54ebd..b6fbb39 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dashboard" -version = "0.3.0" +version = "0.3.1" edition = "2021" [[bin]] diff --git a/src/app/gui/metric.rs b/src/app/gui/metric.rs index ce96cc1..df06a59 100644 --- a/src/app/gui/metric.rs +++ b/src/app/gui/metric.rs @@ -38,7 +38,7 @@ pub fn metric_display_ui(ui: &mut Ui, metric: &Metric, _width: f32) { } pub fn metric_edit_ui(ui: &mut Ui, metric: &mut Metric, panels: Option<&Vec>, width: f32) { - let text_width = width - 190.0; + let text_width = width - 195.0; ui.horizontal(|ui| { ui.color_edit_button_srgba(&mut metric.color); TextEdit::singleline(&mut metric.name) @@ -57,7 +57,7 @@ pub fn metric_edit_ui(ui: &mut Ui, metric: &mut Metric, panels: Option<&Vec) { for metric in metrics { if metric.panel_id == panel.id { let values = metric.values(min_x, max_x, chunk_size); - if !panel.timeserie && panel.view_scroll && values.len() > 0 { - let l = values.len() - 1; - p = p.include_x(values[0].x) - .include_x(values[l].x) - .include_y(values[0].y) - .include_y(values[l].y); - } + // if !panel.timeserie && panel.view_scroll && values.len() > 0 { + // let l = values.len() - 1; + // p = p.include_x(values[0].x) + // .include_x(values[l].x) + // .include_y(values[0].y) + // .include_y(values[l].y); + // } lines.push( Line::new(Values::from_values(values)) - .name(metric.name.as_str()) - .color(metric.color) + .name(metric.name.as_str()) + .color(metric.color) ); } }