use eframe::egui::{Align, InnerResponse, Layout, Response, Ui, Widget}; pub trait UiExtensions { fn fill_button(&mut self, widget: impl Widget) -> Response; fn column(&mut self, width: f32, f: impl FnOnce(&mut Self)-> R) -> InnerResponse; } impl UiExtensions for Ui { fn fill_button(&mut self, widget: impl Widget) -> Response { self.add_sized((self.available_width(), 20.0), widget) } fn column(&mut self, width: f32, f: impl FnOnce(&mut Self) -> R) -> InnerResponse { let third = (width, self.available_height()).into(); self.allocate_ui_with_layout(third, Layout::top_down(Align::Max), f) } }