Decouple core Yaak logic from Tauri (#354)

This commit is contained in:
Gregory Schier
2026-01-08 20:44:25 -08:00
committed by GitHub
parent 3bcc0b8356
commit ef80216ca1
465 changed files with 3052 additions and 6234 deletions
@@ -0,0 +1,36 @@
use tauri::{Runtime, Window, command};
#[command]
pub(crate) fn set_title<R: Runtime>(window: Window<R>, title: &str) {
#[cfg(target_os = "macos")]
{
crate::mac::update_window_title(window, title.to_string());
}
#[cfg(not(target_os = "macos"))]
{
let _ = window.set_title(title);
}
}
#[command]
#[allow(unused)]
pub(crate) fn set_theme<R: Runtime>(window: Window<R>, bg_color: &str) {
#[cfg(target_os = "macos")]
{
use log::warn;
match csscolorparser::parse(bg_color.trim()) {
Ok(color) => {
crate::mac::update_window_theme(window, color);
}
Err(err) => {
warn!("Failed to parse background color '{}': {}", bg_color, err)
}
}
}
#[cfg(not(target_os = "macos"))]
{
// Nothing yet for non-Mac platforms
}
}