From d2473822191ef50609e613544c7ca52283410d16 Mon Sep 17 00:00:00 2001 From: William Casarin Date: Sun, 14 Apr 2024 18:23:33 -0700 Subject: [PATCH] ui: add frame around note previews Signed-off-by: William Casarin --- src/ui/note/contents.rs | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/ui/note/contents.rs b/src/ui/note/contents.rs index 211f2628..91a011f6 100644 --- a/src/ui/note/contents.rs +++ b/src/ui/note/contents.rs @@ -44,6 +44,8 @@ impl egui::Widget for NoteContents<'_> { } } +/// Render an inline note preview with a border. These are used when +/// notes are references within a note fn render_note_preview( ui: &mut egui::Ui, app: &mut Damus, @@ -74,11 +76,22 @@ fn render_note_preview( */ }; - ui.add( - ui::Note::new(app, ¬e) - .actionbar(false) - .note_previews(false), - ) + egui::Frame::none() + //.fill(egui::Color32::BLACK.gamma_multiply(0.2)) + // + .rounding(egui::Rounding::same(10.0)) + .stroke(egui::Stroke::new( + 1.0, + egui::Color32::from_rgb(0x2C, 0x2C, 0x2C), + )) + .show(ui, |ui| { + ui.add( + ui::Note::new(app, ¬e) + .actionbar(false) + .note_previews(false), + ) + }) + .response } fn render_note_contents(