mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-23 01:08:28 +02:00
[WIP] Encryption for secure values (#183)
This commit is contained in:
35
src-tauri/yaak-mac-window/src/commands.rs
Normal file
35
src-tauri/yaak-mac-window/src/commands.rs
Normal file
@@ -0,0 +1,35 @@
|
||||
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")]
|
||||
{
|
||||
match hex_color::HexColor::parse_rgb(bg_color.trim()) {
|
||||
Ok(color) => {
|
||||
crate::mac::update_window_theme(window, color);
|
||||
}
|
||||
Err(err) => {
|
||||
log::warn!("Failed to parse background color '{}': {}", bg_color, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
{
|
||||
// Nothing yet for non-Mac platforms
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user