Skip to content

Commit

Permalink
enhance: hide lingering Settings text when not required
Browse files Browse the repository at this point in the history
  • Loading branch information
carrascomj committed Nov 1, 2023
1 parent 6a88f3f commit a558645
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/gui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ impl ActiveData {
_ => panic!("{key} should never be an ActiveData key!"),
}
}

fn any_hist(&self) -> bool {
self.histogram.top | self.histogram.left | self.histogram.right
}
}

#[derive(Event)]
Expand Down Expand Up @@ -248,7 +252,7 @@ pub fn ui_settings(
}

let condition = state.condition.clone();
if condition != "ALL" {
if (condition != "ALL") & active_set.any_hist() {
ui.label("Histogram scale");
for side in ["left", "right", "top"] {
if !active_set.get(side) {
Expand Down

0 comments on commit a558645

Please sign in to comment.