From 5100070b248428868eb2f41d4463c5361340c9be Mon Sep 17 00:00:00 2001 From: William Casarin Date: Tue, 11 Jun 2024 18:44:40 -0700 Subject: [PATCH] fix colors again Signed-off-by: William Casarin --- src/ui/note/contents.rs | 2 +- src/ui/note/mod.rs | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/ui/note/contents.rs b/src/ui/note/contents.rs index e64ca2f..e92e932 100644 --- a/src/ui/note/contents.rs +++ b/src/ui/note/contents.rs @@ -80,7 +80,7 @@ fn render_note_preview( }; egui::Frame::none() - .fill(ui.visuals().noninteractive().bg_fill) + .fill(ui.visuals().noninteractive().weak_bg_fill) .inner_margin(egui::Margin::same(8.0)) .outer_margin(egui::Margin::symmetric(0.0, 8.0)) .rounding(egui::Rounding::same(10.0)) diff --git a/src/ui/note/mod.rs b/src/ui/note/mod.rs index f4c49a0..a13a465 100644 --- a/src/ui/note/mod.rs +++ b/src/ui/note/mod.rs @@ -22,11 +22,7 @@ pub struct NoteResponse { impl<'a> View for Note<'a> { fn ui(&mut self, ui: &mut egui::Ui) { - if self.app.textmode { - self.textmode_ui(ui); - } else { - self.show(ui); - } + self.show(ui); } } @@ -260,6 +256,17 @@ impl<'a> Note<'a> { } pub fn show(&mut self, ui: &mut egui::Ui) -> NoteResponse { + if self.app.textmode { + NoteResponse { + response: self.textmode_ui(ui), + action: None, + } + } else { + self.show_standard(ui) + } + } + + fn show_standard(&mut self, ui: &mut egui::Ui) -> NoteResponse { #[cfg(feature = "profiling")] puffin::profile_function!(); let note_key = self.note.key().expect("todo: support non-db notes");