some more ui changes

This commit is contained in:
2025-04-08 13:18:45 +01:00
parent 52ffb34d83
commit a4ebfc515c
3 changed files with 24 additions and 44 deletions
-1
View File
@@ -1,4 +1,3 @@
pub mod consts;
pub mod countdown;
pub mod elevation;
pub mod ui_ext;
-21
View File
@@ -1,21 +0,0 @@
use eframe::egui;
pub trait UiExt {
fn add_sized_left_aligned(
&mut self,
max_size: impl Into<egui::Vec2>,
widget: impl egui::Widget,
) -> egui::Response;
}
impl UiExt for egui::Ui {
fn add_sized_left_aligned(
&mut self,
max_size: impl Into<egui::Vec2>,
widget: impl egui::Widget,
) -> egui::Response {
let layout = egui::Layout::top_down_justified(egui::Align::LEFT);
self.allocate_ui_with_layout(max_size.into(), layout, |ui| ui.add(widget))
.inner
}
}