From 19bc37b0bc7a8b30947c8a3d585aad362cbbf25d Mon Sep 17 00:00:00 2001 From: kernelkind Date: Fri, 29 Nov 2024 10:04:09 -0800 Subject: [PATCH] panel: off-white Signed-off-by: William Casarin --- src/colors.rs | 1 + src/ui/side_panel.rs | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/colors.rs b/src/colors.rs index e8300cd..886a2d0 100644 --- a/src/colors.rs +++ b/src/colors.rs @@ -22,6 +22,7 @@ const LIGHT_GRAY: Color32 = Color32::from_rgb(0xc8, 0xc8, 0xc8); // 78% pub const MID_GRAY: Color32 = Color32::from_rgb(0xbd, 0xbd, 0xbd); const DARKER_GRAY: Color32 = Color32::from_rgb(0xa5, 0xa5, 0xa5); // 65% const EVEN_DARKER_GRAY: Color32 = Color32::from_rgb(0x89, 0x89, 0x89); // 54% +pub const ALMOST_WHITE: Color32 = Color32::from_rgb(0xFA, 0xFA, 0xFA); pub struct ColorTheme { // VISUALS diff --git a/src/ui/side_panel.rs b/src/ui/side_panel.rs index 8e652e2..9702157 100644 --- a/src/ui/side_panel.rs +++ b/src/ui/side_panel.rs @@ -70,10 +70,13 @@ impl<'a> DesktopSidePanel<'a> { } pub fn show(&mut self, ui: &mut egui::Ui) -> SidePanelResponse { - egui::Frame::none() - .inner_margin(Margin::same(8.0)) - .show(ui, |ui| self.show_inner(ui)) - .inner + let mut frame = egui::Frame::none().inner_margin(Margin::same(8.0)); + + if !ui.visuals().dark_mode { + frame = frame.fill(colors::ALMOST_WHITE); + } + + frame.show(ui, |ui| self.show_inner(ui)).inner } fn show_inner(&mut self, ui: &mut egui::Ui) -> SidePanelResponse {