mirror of
https://github.com/aljazceru/notedeck.git
synced 2025-12-31 06:54:22 +01:00
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>
This commit is contained in:
committed by
William Casarin
parent
dae57d78ef
commit
bf23e778b3
@@ -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(
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user