Skip to content

Commit

Permalink
Visually indicate disabled mods
Browse files Browse the repository at this point in the history
  • Loading branch information
trumank committed Aug 13, 2023
1 parent e79a129 commit 6ccab23
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/gui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ impl App {
_group: Option<&str>,
state: egui_dnd::ItemState,
mc: &mut ModConfig| {
if !mc.enabled {
let vis = ui.visuals_mut();
vis.override_text_color = Some(vis.text_color());
vis.hyperlink_color = vis.text_color();
}

if ui
.add(egui::Checkbox::without_text(&mut mc.enabled))
.on_hover_text_at_pointer("enabled?")
Expand Down Expand Up @@ -307,7 +313,11 @@ impl App {
ui.ctx()
.load_texture("modio-logo", image, Default::default())
});
ui.image(texture, [16.0, 16.0]);
let mut img = egui::Image::new(texture, [16.0, 16.0]);
if !mc.enabled {
img = img.tint(Color32::LIGHT_RED);
}
ui.add(img);
}
"http" => {
ui.label("🌐");
Expand Down

0 comments on commit 6ccab23

Please sign in to comment.