commit bf23e778b359f9738374c5154bd3686e8fde2b1f
parent dae57d78ef5d8e0a58e70a8a92a85e2c1e49abb1
Author: kernelkind <kernelkind@gmail.com>
Date: Wed, 17 Apr 2024 13:36:21 -0400
Seperate mobile dark color theme into its own func
I believe this is less messy
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
2 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/src/app_style.rs b/src/app_style.rs
@@ -1,4 +1,6 @@
-use crate::colors::{dark_color_theme, light_color_theme, ColorTheme};
+use crate::colors::{
+ desktop_dark_color_theme, light_color_theme, mobile_dark_color_theme, ColorTheme,
+};
use egui::{
epaint::Shadow,
style::{WidgetVisuals, Widgets},
@@ -14,7 +16,14 @@ pub fn light_mode() -> Visuals {
}
pub fn dark_mode(mobile: bool) -> Visuals {
- create_themed_visuals(dark_color_theme(mobile), Visuals::dark())
+ create_themed_visuals(
+ if mobile {
+ mobile_dark_color_theme()
+ } else {
+ desktop_dark_color_theme()
+ },
+ Visuals::dark(),
+ )
}
pub fn user_requested_visuals_change(
diff --git a/src/colors.rs b/src/colors.rs
@@ -42,10 +42,10 @@ pub struct ColorTheme {
pub inactive_weak_bg_fill: Color32,
}
-pub fn dark_color_theme(mobile: bool) -> ColorTheme {
+pub fn desktop_dark_color_theme() -> ColorTheme {
ColorTheme {
// VISUALS
- panel_fill: if mobile { Color32::BLACK } else { DARKER_BG },
+ panel_fill: DARKER_BG,
extreme_bg_color: SEMI_DARKER_BG,
text_color: Color32::WHITE,
err_fg_color: RED_700,
@@ -68,6 +68,13 @@ pub fn dark_color_theme(mobile: bool) -> ColorTheme {
}
}
+pub fn mobile_dark_color_theme() -> ColorTheme {
+ ColorTheme {
+ panel_fill: Color32::BLACK,
+ ..desktop_dark_color_theme()
+ }
+}
+
pub fn light_color_theme() -> ColorTheme {
ColorTheme {
// VISUALS