greyed out 'X' if there's only one function
This commit is contained in:
parent
9837f51382
commit
099ca4ca23
@ -237,6 +237,7 @@ impl MathApp {
|
||||
.text("Interval"),
|
||||
);
|
||||
|
||||
let functions_len = self.functions.len();
|
||||
let mut remove_i: Option<usize> = None;
|
||||
for (i, function) in self.functions.iter_mut().enumerate() {
|
||||
let integral_enabled = function.integral;
|
||||
@ -248,6 +249,7 @@ impl MathApp {
|
||||
ui.horizontal(|ui| {
|
||||
ui.label("Function:");
|
||||
|
||||
if functions_len > 1 {
|
||||
if ui
|
||||
.add(Button::new("X"))
|
||||
.on_hover_text("Delete Function")
|
||||
@ -255,6 +257,9 @@ impl MathApp {
|
||||
{
|
||||
remove_i = Some(i);
|
||||
}
|
||||
} else {
|
||||
ui.add_enabled(false, Button::new("X"));
|
||||
}
|
||||
|
||||
integral_toggle = ui
|
||||
.add(Button::new("∫"))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user