control center theme

This commit is contained in:
tk103331
2023-01-05 11:52:23 +08:00
parent f646684f4d
commit f7335d9162
3 changed files with 21 additions and 8 deletions

View File

@@ -4,7 +4,7 @@ use crate::{
};
use log::info;
use std::{collections::HashMap, fs, path::PathBuf};
use tauri::{api, command, AppHandle, Manager};
use tauri::{api, command, AppHandle, Manager, Theme};
#[command]
pub fn drag_window(app: AppHandle) {
@@ -38,6 +38,11 @@ pub fn get_chat_conf() -> ChatConfJson {
ChatConfJson::get_chat_conf()
}
#[command]
pub fn get_theme() -> String {
ChatConfJson::theme().unwrap_or(Theme::Light).to_string()
}
#[command]
pub fn reset_chat_conf() -> ChatConfJson {
ChatConfJson::reset_chat_conf()

View File

@@ -56,6 +56,7 @@ async fn main() {
cmd::download,
cmd::open_link,
cmd::get_chat_conf,
cmd::get_theme,
cmd::reset_chat_conf,
cmd::run_check_update,
cmd::form_cancel,