Skip to content

Commit

Permalink
added more ui stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Spooky-Firefox committed Jul 10, 2024
1 parent deab78e commit 3d1ac5c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/gui_egui/menu.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use crate::common::RunningState;
use crate::gui_egui::{
editor::{Editor, GridOptions},
gui::Gui,
keymap,
};
use egui::{menu, Button, DragValue, KeyboardShortcut, Response, Ui};

use egui::{menu, Button, Color32, DragValue, KeyboardShortcut, Response, RichText, Ui};
pub(crate) struct Menu {}

impl Menu {
Expand Down Expand Up @@ -53,7 +53,13 @@ impl Menu {

// This displays the current state of the simulation,
// if hovered displays the component condition vector
let r = ui.label(format!("State: {:?}", s.get_state()));
let r = ui.label(RichText::new(format!("State: {:?}", s.get_state())).color(
match s.get_state() {
RunningState::Halt => Color32::YELLOW,
RunningState::Err => Color32::RED,
_ => Color32::PLACEHOLDER,
},
));

// if there are some components that reported a condition show it when
// state is hovered over
Expand Down

0 comments on commit 3d1ac5c

Please sign in to comment.