feat(auto-theme): read full DE color scheme for system theme
Instead of using wallpaper k-means + accent override (which produced wrong backgrounds), the system source now reads ALL colors from the DE config (kdeglobals for KDE, dconf hints for GNOME). Maps Window/View/Button/Selection/Header sections directly to CSS variables — bg-primary from Window, bg-secondary from View, bg-tertiary from Button, accent from Selection, text from ForegroundNormal, etc. Adds SystemColorScheme type, get_system_color_scheme() in system.rs, generate_theme_from_scheme() in generator.rs, and two new V2 commands: v2_generate_theme_from_system_colors and v2_get_system_color_scheme. Frontend tryAccentColorTheme() replaced with trySystemColorSchemeTheme() which calls the new endpoint. Old color math helpers removed.
This commit is contained in:
6 files changed
+390
-138
No files matched your search
@@ -10175,6 +10175,17 @@ pub async fn v2_generate_theme_from_wallpaper() -> Result<crate::auto_theme::Gen
|
||||
.map_err(|e| format!("Theme generation task failed: {}", e))?
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn v2_generate_theme_from_system_colors() -> Result<crate::auto_theme::GeneratedTheme, String> {
|
||||
let scheme = crate::auto_theme::system::get_system_color_scheme()?;
|
||||
Ok(crate::auto_theme::generator::generate_theme_from_scheme(&scheme))
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn v2_get_system_color_scheme() -> Result<crate::auto_theme::SystemColorScheme, String> {
|
||||
crate::auto_theme::system::get_system_color_scheme()
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[allow(non_snake_case)]
|
||||
pub async fn v2_extract_palette(
|
||||
|
||||
Reference in new issue
Block a user