Skip to content

Commit

Permalink
WIP collapsible mod group UI
Browse files Browse the repository at this point in the history
  • Loading branch information
trumank committed Aug 13, 2023
1 parent 6ccab23 commit e65c39b
Showing 1 changed file with 31 additions and 7 deletions.
38 changes: 31 additions & 7 deletions src/gui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,13 +521,37 @@ impl App {
}
};

egui::ScrollArea::vertical().show(ui, |ui| {
if let Some(profile) = profiles.get_mut(profile) {
ui_profile(ui, profile);
} else {
ui.label("no such profile");
}
});
egui::Frame::none()
.show(ui, |ui| {
egui::ScrollArea::vertical().show(ui, |ui| {
if let Some(profile) = profiles.get_mut(profile) {
ui_profile(ui, profile);
} else {
ui.label("no such profile");
}
});
ui.allocate_space(ui.available_size());
})
.response
.context_menu(|ui| {
if let Some(profile) = profiles.get_mut(profile) {
ui.menu_button("add group", |ui| {
for group in groups.keys() {
if ui.button(group).clicked() {
profile.mods.push(ModOrGroup::Group {
group_name: group.clone(),
enabled: true,
});
ctx.needs_save = true;
ui.close_menu();
}
}
});
}
if ui.button("close").clicked() {
ui.close_menu();
}
});

if let Some(add_deps) = ctx.add_deps {
message::ResolveMods::send(self, ui.ctx(), add_deps, true);
Expand Down

0 comments on commit e65c39b

Please sign in to comment.