working emulator UI - just need to implement the instruction set
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
use crate::emulator::ui::interface::{Category, EmulatorUI};
|
||||
|
||||
pub fn render_menu(state: &mut EmulatorUI, ui: &mut egui::Ui, _ctx: &egui::Context) {
|
||||
ui.with_layout(
|
||||
egui::Layout::top_down_justified(egui::Align::Center),
|
||||
|ui| {
|
||||
ui.set_max_width(300.0);
|
||||
ui.set_min_width(300.0);
|
||||
ui.spacing_mut().button_padding = egui::vec2(10.0, 5.0);
|
||||
|
||||
for cat in Category::list() {
|
||||
ui.add_space(10.0);
|
||||
ui.heading(cat.as_str());
|
||||
ui.add_space(10.0);
|
||||
|
||||
for comp in state.components.iter_mut() {
|
||||
let name = comp.name();
|
||||
if comp.category() == cat {
|
||||
ui.toggle_value(comp.visible(), name);
|
||||
}
|
||||
}
|
||||
|
||||
ui.add_space(10.0);
|
||||
ui.separator();
|
||||
}
|
||||
|
||||
ui.add_space(10.0);
|
||||
},
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user