perf: a few micro optimizations

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2025-08-03 20:12:31 -07:00
parent 7e73ed2760
commit 0dda26791a
4 changed files with 22 additions and 17 deletions

View File

@@ -56,7 +56,7 @@ pub fn hline_with_width(ui: &egui::Ui, range: egui::Rangef) {
ui.painter().hline(range, resize_y, stroke);
}
pub fn secondary_label(ui: &mut egui::Ui, s: impl Into<String>) {
pub fn secondary_label(ui: &mut egui::Ui, s: impl Into<String>) -> egui::Response {
let color = ui.style().visuals.noninteractive().fg_stroke.color;
ui.add(Label::new(RichText::new(s).size(10.0).color(color)).selectable(false));
ui.add(Label::new(RichText::new(s).size(10.0).color(color)).selectable(false))
}