🎨 Rust syntax format
This commit is contained in:
@@ -39,9 +39,9 @@ pub fn get_window(app: &mut App, config: &PakeConfig, _data_dir: PathBuf) -> Web
|
|||||||
//This is necessary to allow for file injection by external developers for customization purposes.
|
//This is necessary to allow for file injection by external developers for customization purposes.
|
||||||
.initialization_script(include_str!("../inject/custom.js"));
|
.initialization_script(include_str!("../inject/custom.js"));
|
||||||
|
|
||||||
if config.proxy_url != "" {
|
if !config.proxy_url.is_empty() {
|
||||||
window_builder =
|
window_builder =
|
||||||
window_builder.proxy_url(Url::from_str(&config.proxy_url.as_str()).unwrap());
|
window_builder.proxy_url(Url::from_str(config.proxy_url.as_str()).unwrap());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ pub fn run_app() {
|
|||||||
|
|
||||||
// Save the value of toggle_app_shortcut before pake_config is moved
|
// Save the value of toggle_app_shortcut before pake_config is moved
|
||||||
let activation_shortcut = pake_config.windows[0].activation_shortcut.clone();
|
let activation_shortcut = pake_config.windows[0].activation_shortcut.clone();
|
||||||
let init_fullscreen = pake_config.windows[0].fullscreen.clone();
|
let init_fullscreen = pake_config.windows[0].fullscreen;
|
||||||
|
|
||||||
let window_state_plugin = if init_fullscreen {
|
let window_state_plugin = if init_fullscreen {
|
||||||
windowStatePlugin::default()
|
windowStatePlugin::default()
|
||||||
@@ -43,7 +43,7 @@ pub fn run_app() {
|
|||||||
download_file_by_binary
|
download_file_by_binary
|
||||||
])
|
])
|
||||||
.setup(move |app| {
|
.setup(move |app| {
|
||||||
let data_dir = get_data_dir(&app.app_handle(), tauri_config.clone());
|
let data_dir = get_data_dir(app.app_handle(), tauri_config.clone());
|
||||||
|
|
||||||
let _window = get_window(app, &pake_config, data_dir);
|
let _window = get_window(app, &pake_config, data_dir);
|
||||||
|
|
||||||
@@ -51,14 +51,14 @@ pub fn run_app() {
|
|||||||
_window.show().unwrap();
|
_window.show().unwrap();
|
||||||
|
|
||||||
if show_system_tray {
|
if show_system_tray {
|
||||||
let _ = set_system_tray(&app.app_handle());
|
let _ = set_system_tray(app.app_handle());
|
||||||
} else {
|
} else {
|
||||||
app.app_handle().remove_tray_by_id("pake-tray");
|
app.app_handle().remove_tray_by_id("pake-tray");
|
||||||
}
|
}
|
||||||
|
|
||||||
if !activation_shortcut.is_empty() {
|
if !activation_shortcut.is_empty() {
|
||||||
let app_handle = app.app_handle().clone();
|
let app_handle = app.app_handle().clone();
|
||||||
let shortcut_hotkey = Shortcut::from_str(&activation_shortcut.as_str()).unwrap();
|
let shortcut_hotkey = Shortcut::from_str(activation_shortcut.as_str()).unwrap();
|
||||||
let last_triggered = Arc::new(Mutex::new(Instant::now()));
|
let last_triggered = Arc::new(Mutex::new(Instant::now()));
|
||||||
|
|
||||||
app_handle
|
app_handle
|
||||||
|
|||||||
Reference in New Issue
Block a user