Skip to content

Commit

Permalink
layouts window: Name new views more uniquely
Browse files Browse the repository at this point in the history
  • Loading branch information
crumblingstatue committed Oct 16, 2024
1 parent 3516c3b commit 9e049d0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/gui/windows/layouts_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@ fn add_new_view_menu(ui: &mut egui::Ui, low: &MetaLow, views: &mut ViewMap) -> O
let mut ret_key = None;
ui.separator();
ui.menu_button("New from perspective", |ui| {
for (k, per) in &low.perspectives {
for (per_key, per) in &low.perspectives {
if ui.button(&per.name).clicked() {
let key = views.insert(NamedView {
view: View::new(ViewKind::Hex(HexData::default()), k),
name: per.name.to_owned(),
let view_key = views.insert_with_key(|new_key| NamedView {
view: View::new(ViewKind::Hex(HexData::default()), per_key),
name: format!("View {:?} @ {}", new_key.data(), per.name),
});
ret_key = Some(key);
ret_key = Some(view_key);
}
}
});
Expand Down

0 comments on commit 9e049d0

Please sign in to comment.