simplify some UI code
This commit is contained in:
parent
5e6edae547
commit
46b503f680
@ -389,33 +389,29 @@ impl MathApp {
|
|||||||
"Right",
|
"Right",
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
let riemann_changed = prev_sum != self.settings.riemann_sum;
|
let riemann_changed = prev_sum != self.settings.riemann_sum;
|
||||||
|
|
||||||
// Config options for Extrema and roots
|
|
||||||
let mut extrema_toggled: bool = false;
|
|
||||||
let mut roots_toggled: bool = false;
|
|
||||||
ui.horizontal(|ui| {
|
ui.horizontal(|ui| {
|
||||||
extrema_toggled = ui
|
self.settings.do_extrema.bitxor_assign(
|
||||||
.add(Button::new("Extrema"))
|
ui.add(Button::new("Extrema"))
|
||||||
.on_hover_text(match self.settings.do_extrema {
|
.on_hover_text(match self.settings.do_extrema {
|
||||||
true => "Disable Displaying Extrema",
|
true => "Disable Displaying Extrema",
|
||||||
false => "Display Extrema",
|
false => "Display Extrema",
|
||||||
})
|
})
|
||||||
.clicked();
|
.clicked(),
|
||||||
|
);
|
||||||
|
|
||||||
roots_toggled = ui
|
self.settings.do_roots.bitxor_assign(
|
||||||
.add(Button::new("Roots"))
|
ui.add(Button::new("Roots"))
|
||||||
.on_hover_text(match self.settings.do_roots {
|
.on_hover_text(match self.settings.do_roots {
|
||||||
true => "Disable Displaying Roots",
|
true => "Disable Displaying Roots",
|
||||||
false => "Display Roots",
|
false => "Display Roots",
|
||||||
})
|
})
|
||||||
.clicked();
|
.clicked(),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
// If options toggled, flip the boolean
|
|
||||||
self.settings.do_extrema.bitxor_assign(extrema_toggled);
|
|
||||||
self.settings.do_roots.bitxor_assign(roots_toggled);
|
|
||||||
|
|
||||||
let min_x_old = self.settings.integral_min_x;
|
let min_x_old = self.settings.integral_min_x;
|
||||||
let min_x_changed = ui
|
let min_x_changed = ui
|
||||||
.add(
|
.add(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user