commit 19bc37b0bc7a8b30947c8a3d585aad362cbbf25d
parent 2e9a00ee57a127f566bad1d1f9356cae2d8f26ce
Author: kernelkind <kernelkind@gmail.com>
Date: Fri, 29 Nov 2024 10:04:09 -0800
panel: off-white
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git 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
@@ -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 {