use bitxor_assign
This commit is contained in:
parent
3827242a0a
commit
c292c8e72a
@ -13,7 +13,7 @@ use epi::{Frame, Storage};
|
|||||||
use include_flate::flate;
|
use include_flate::flate;
|
||||||
use instant::Duration;
|
use instant::Duration;
|
||||||
use shadow_rs::shadow;
|
use shadow_rs::shadow;
|
||||||
use std::ops::RangeInclusive;
|
use std::ops::{BitXorAssign, RangeInclusive};
|
||||||
|
|
||||||
shadow!(build);
|
shadow!(build);
|
||||||
|
|
||||||
@ -343,16 +343,14 @@ impl epi::App for MathApp {
|
|||||||
// Creates Top bar that contains some general options
|
// Creates Top bar that contains some general options
|
||||||
TopBottomPanel::top("top_bar").show(ctx, |ui| {
|
TopBottomPanel::top("top_bar").show(ctx, |ui| {
|
||||||
ui.horizontal(|ui| {
|
ui.horizontal(|ui| {
|
||||||
if ui
|
self.settings.show_side_panel.bitxor_assign(
|
||||||
.add(Button::new("Panel"))
|
ui.add(Button::new("Panel"))
|
||||||
.on_hover_text(match self.settings.show_side_panel {
|
.on_hover_text(match self.settings.show_side_panel {
|
||||||
true => "Hide Side Panel",
|
true => "Hide Side Panel",
|
||||||
false => "Show Side Panel",
|
false => "Show Side Panel",
|
||||||
})
|
})
|
||||||
.clicked()
|
.clicked(),
|
||||||
{
|
);
|
||||||
self.settings.show_side_panel = !self.settings.show_side_panel;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ui
|
if ui
|
||||||
.add(Button::new("Add Function"))
|
.add(Button::new("Add Function"))
|
||||||
@ -367,30 +365,26 @@ impl epi::App for MathApp {
|
|||||||
self.func_strs.push(String::new());
|
self.func_strs.push(String::new());
|
||||||
}
|
}
|
||||||
|
|
||||||
if ui
|
self.settings.help_open.bitxor_assign(
|
||||||
.add(Button::new("Help"))
|
ui.add(Button::new("Help"))
|
||||||
.on_hover_text(match self.settings.help_open {
|
.on_hover_text(match self.settings.help_open {
|
||||||
true => "Close Help Window",
|
true => "Close Help Window",
|
||||||
false => "Open Help Window",
|
false => "Open Help Window",
|
||||||
})
|
})
|
||||||
.clicked()
|
.clicked(),
|
||||||
{
|
);
|
||||||
self.settings.help_open = !self.settings.help_open;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ui
|
self.settings.info_open.bitxor_assign(
|
||||||
.add(Button::new("Info"))
|
ui.add(Button::new("Info"))
|
||||||
.on_hover_text(match self.settings.info_open {
|
.on_hover_text(match self.settings.info_open {
|
||||||
true => "Close Info Window",
|
true => "Close Info Window",
|
||||||
false => "Open Info Window",
|
false => "Open Info Window",
|
||||||
})
|
})
|
||||||
.clicked()
|
.clicked(),
|
||||||
{
|
);
|
||||||
self.settings.info_open = !self.settings.info_open;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ui
|
self.settings.dark_mode.bitxor_assign(
|
||||||
.add(Button::new(match self.settings.dark_mode {
|
ui.add(Button::new(match self.settings.dark_mode {
|
||||||
true => "🌞",
|
true => "🌞",
|
||||||
false => "🌙",
|
false => "🌙",
|
||||||
}))
|
}))
|
||||||
@ -398,10 +392,8 @@ impl epi::App for MathApp {
|
|||||||
true => "Turn the Lights on!",
|
true => "Turn the Lights on!",
|
||||||
false => "Turn the Lights off.",
|
false => "Turn the Lights off.",
|
||||||
})
|
})
|
||||||
.clicked()
|
.clicked(),
|
||||||
{
|
);
|
||||||
self.settings.dark_mode = !self.settings.dark_mode;
|
|
||||||
}
|
|
||||||
|
|
||||||
ui.label(format!(
|
ui.label(format!(
|
||||||
"Area: {:?} Took: {:?}",
|
"Area: {:?} Took: {:?}",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user