mirror of
https://github.com/Cyrix126/gupaxx.git
synced 2024-12-22 22:59:27 +00:00
fix: don't change metric if already selected
This commit is contained in:
parent
d3e4220982
commit
a9c4381c94
1 changed files with 6 additions and 2 deletions
|
@ -195,11 +195,15 @@ impl crate::disk::state::Xvb {
|
|||
egui::Slider::new(&mut self.amount, 0.0..=(hashrate_xmrig as f64))
|
||||
).on_hover_text(slider_help_text);
|
||||
|
||||
if ui.add(egui::SelectableLabel::new(self.manual_donation_metric == ManualDonationMetric::Hash, "H/s")).clicked() {
|
||||
if ui.add(egui::SelectableLabel::new(self.manual_donation_metric == ManualDonationMetric::Hash, "H/s")).clicked() &&
|
||||
self.manual_donation_metric != ManualDonationMetric::Hash
|
||||
{
|
||||
self.amount *= 1000.0;
|
||||
self.manual_donation_metric = ManualDonationMetric::Hash;
|
||||
}
|
||||
if ui.add(egui::SelectableLabel::new(self.manual_donation_metric == ManualDonationMetric::Kilo, "kH/s")).clicked() {
|
||||
if ui.add(egui::SelectableLabel::new(self.manual_donation_metric == ManualDonationMetric::Kilo, "kH/s")).clicked() &&
|
||||
self.manual_donation_metric != ManualDonationMetric::Kilo
|
||||
{
|
||||
self.amount /= 1000.0;
|
||||
self.manual_donation_metric = ManualDonationMetric::Kilo;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue