Compare commits
2 Commits
37ce63df82
...
de2588b60e
Author | SHA1 | Date |
---|---|---|
David Holland | de2588b60e | |
David Holland | 6297df6f28 |
File diff suppressed because it is too large
Load Diff
|
@ -21,9 +21,9 @@ dialoguer = "0.10.3"
|
|||
notify-rust = "4.7.0"
|
||||
crossterm = "0.25.0"
|
||||
rfd = "0.10.0"
|
||||
egui = "0.22.0"
|
||||
eframe = "0.22.0"
|
||||
|
||||
egui = { git = "https://github.com/emilk/egui", branch = "master" }
|
||||
eframe = { git = "https://github.com/emilk/egui", branch = "master" }
|
||||
|
||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||
tracing-subscriber = "0.3"
|
||||
|
|
|
@ -6,7 +6,7 @@ use crate::time::{unix_to_human_date, unix_to_human_date_time, unix_to_machine_d
|
|||
|
||||
use dialoguer::{theme::ColorfulTheme, MultiSelect};
|
||||
|
||||
use egui::plot::{PlotPoint, PlotPoints};
|
||||
use egui::widgets::plot::{PlotPoint, PlotPoints};
|
||||
use indicatif::{MultiProgress, ProgressBar, ProgressStyle};
|
||||
|
||||
use notify_rust::Notification;
|
||||
|
|
52
src/ui.rs
52
src/ui.rs
|
@ -3,7 +3,7 @@
|
|||
use eframe::egui;
|
||||
|
||||
use egui::{
|
||||
plot::{Legend, Line, Plot},
|
||||
widgets::plot::{Legend, Line, Plot},
|
||||
Align, Layout, ProgressBar,
|
||||
};
|
||||
use plotly::layout::Center;
|
||||
|
@ -94,12 +94,6 @@ impl Ui {
|
|||
}
|
||||
|
||||
impl eframe::App for Ui {
|
||||
fn on_close_event(&mut self) -> bool {
|
||||
self.modal = true;
|
||||
self.show_confirmation_dialog = true;
|
||||
self.allowed_to_close
|
||||
}
|
||||
|
||||
fn update(&mut self, ctx: &egui::Context, frame: &mut eframe::Frame) {
|
||||
if self.continuous_mode {
|
||||
ctx.request_repaint();
|
||||
|
@ -111,31 +105,31 @@ impl eframe::App for Ui {
|
|||
});
|
||||
|
||||
egui::TopBottomPanel::top("dark_light").show(ctx, |ui| {
|
||||
ui.vertical(|ui| {
|
||||
egui::menu::bar(ui, |ui| {
|
||||
let reload_button = ui.button("Reload");
|
||||
ui.vertical(|ui| {
|
||||
egui::menu::bar(ui, |ui| {
|
||||
let reload_button = ui.button("Reload");
|
||||
|
||||
if reload_button.clicked() {
|
||||
self.reload(ctx);
|
||||
}
|
||||
if reload_button.clicked() {
|
||||
self.reload(ctx);
|
||||
}
|
||||
|
||||
if reload_button.hovered() {
|
||||
if let Some(loader_thread) = &self.loader_thread {
|
||||
if !loader_thread.is_finished() {
|
||||
if reload_button.hovered() {
|
||||
if let Some(loader_thread) = &self.loader_thread {
|
||||
if !loader_thread.is_finished() {
|
||||
egui::show_tooltip(ctx, egui::Id::new("reload_tooltip"), |ui| {
|
||||
ui.label("Loading is still in progress.\nTo reload, please wait until previous loading has finished!");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ui.with_layout(Layout::right_to_left(Align::Min), |ui| {
|
||||
egui::widgets::global_dark_light_mode_buttons(ui);
|
||||
ui.heading("RustyBeans");
|
||||
});
|
||||
ui.with_layout(Layout::right_to_left(Align::Min), |ui| {
|
||||
egui::widgets::global_dark_light_mode_buttons(ui);
|
||||
ui.heading("RustyBeans");
|
||||
});
|
||||
})
|
||||
});
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
if self.modal {
|
||||
egui::CentralPanel::default().show(ctx, |ui| {
|
||||
|
@ -417,7 +411,7 @@ impl eframe::App for Ui {
|
|||
Line::new(plot_points_to_owned(
|
||||
&plot_points.1,
|
||||
))
|
||||
.name(plot_points.0.to_owned()),
|
||||
.name(plot_points.0.to_owned()),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -436,7 +430,7 @@ impl eframe::App for Ui {
|
|||
Ok(path) => path.to_str(),
|
||||
Err(_) => None,
|
||||
}
|
||||
.unwrap_or_default(),
|
||||
.unwrap_or_default(),
|
||||
)
|
||||
.pick_file()
|
||||
{
|
||||
|
@ -454,4 +448,10 @@ impl eframe::App for Ui {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
fn on_close_event(&mut self) -> bool {
|
||||
self.modal = true;
|
||||
self.show_confirmation_dialog = true;
|
||||
self.allowed_to_close
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue