mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-18 06:49:50 +02:00
Better plugin reloading and theme parsing
This commit is contained in:
@@ -10,10 +10,10 @@ tauri-plugin = { workspace = true, features = ["build"] }
|
||||
|
||||
[target.'cfg(target_os = "macos")'.dependencies]
|
||||
cocoa = "0.26.0"
|
||||
hex_color = "3.0.0"
|
||||
log = "0.4.27"
|
||||
objc = "0.2.7"
|
||||
rand = "0.9.0"
|
||||
csscolorparser = "0.7.2"
|
||||
|
||||
[dependencies]
|
||||
tauri = { workspace = true }
|
||||
|
||||
@@ -18,7 +18,7 @@ pub(crate) fn set_title<R: Runtime>(window: Window<R>, title: &str) {
|
||||
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()) {
|
||||
match csscolorparser::parse(bg_color.trim()) {
|
||||
Ok(color) => {
|
||||
crate::mac::update_window_theme(window, color);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#![allow(deprecated)]
|
||||
use hex_color::HexColor;
|
||||
use csscolorparser::Color;
|
||||
use objc::{msg_send, sel, sel_impl};
|
||||
use tauri::{Emitter, Runtime, Window};
|
||||
|
||||
@@ -35,7 +35,7 @@ pub(crate) fn update_window_title<R: Runtime>(window: Window<R>, title: String)
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn update_window_theme<R: Runtime>(window: Window<R>, color: HexColor) {
|
||||
pub(crate) fn update_window_theme<R: Runtime>(window: Window<R>, color: Color) {
|
||||
use cocoa::appkit::{
|
||||
NSAppearance, NSAppearanceNameVibrantDark, NSAppearanceNameVibrantLight, NSWindow,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user