diff --git a/src/gui/mod.rs b/src/gui/mod.rs index a108560..472bdab 100644 --- a/src/gui/mod.rs +++ b/src/gui/mod.rs @@ -210,37 +210,31 @@ impl App { fn show_network(&mut self, _ctx: &egui::Context, ui: &mut egui::Ui) { header(ui, "Network"); - egui::Frame::new() - .inner_margin(egui::vec2(4.0, 4.0)) - .stroke(egui::Stroke::new( - 1.0, - self.settings.theme.to_catppuccin().overlay1, - )) - .show(ui, |ui| { - let response = ui.add_enabled_ui(self.flags.elevated, |ui| { - let label = ui.label("Game's network access"); - ui.horizontal(|ui| { - let available_width = label.rect.width(); - let spacing = ui.spacing().item_spacing.x; - let button_width = (available_width - spacing) / 2.0; - if ui - .add_sized([button_width, 18.0], egui::Button::new("Block")) - .clicked() - { - features::game_networking::block_all(&mut self.sysinfo); - }; - if ui - .add_sized([button_width, 18.0], egui::Button::new("Unblock")) - .clicked() - { - features::game_networking::unblock_all(); - }; - }); + egui::Frame::new().show(ui, |ui| { + let response = ui.add_enabled_ui(self.flags.elevated, |ui| { + let label = ui.label("Game's network access"); + ui.horizontal(|ui| { + let available_width = label.rect.width(); + let spacing = ui.spacing().item_spacing.x; + let button_width = (available_width - spacing) / 2.0; + if ui + .add_sized([button_width, 18.0], egui::Button::new("Block")) + .clicked() + { + features::game_networking::block_all(&mut self.sysinfo); + }; + if ui + .add_sized([button_width, 18.0], egui::Button::new("Unblock")) + .clicked() + { + features::game_networking::unblock_all(); + }; }); - response.response.on_disabled_hover_text( - "This requires administrator.\nUse the Elevate button.", - ); }); + response + .response + .on_disabled_hover_text("This requires administrator.\nUse the Elevate button."); + }); } #[allow(clippy::unused_self)]