From 912d1b99b32081f2fdabf3b0aed3fef052419d04 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Tue, 27 Aug 2024 15:35:58 -0700 Subject: [PATCH] Render field color in labels. --- src/app.rs | 6 +++++- src/main.rs | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/app.rs b/src/app.rs index bfffc24..3f599fd 100644 --- a/src/app.rs +++ b/src/app.rs @@ -2436,7 +2436,11 @@ impl ProfApp { body.row(height, |mut row| { row.col(|ui| { - ui.strong(k); + if let Some(color) = color { + ui.label(RichText::new(k).color(color).strong()); + } else { + ui.strong(k); + } }); row.col(|ui| { if let Some(x) = diff --git a/src/main.rs b/src/main.rs index d0d3dd6..e3f2e1c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -218,7 +218,11 @@ impl RandomDataSource { Field::Interval(Interval::new(start, stop)), None, ), - (self.item_uid_field, Field::U64(item_uid.0), None), + ( + self.item_uid_field, + Field::U64(item_uid.0), + Some(Color32::RED), + ), ], }); }