sciter hide cm (#12570)

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages
2025-08-07 13:29:21 +08:00
committed by GitHub
parent 725a47268e
commit 77be752ff1
3 changed files with 36 additions and 8 deletions

View File

@@ -118,6 +118,11 @@ pub fn start(args: &mut [String]) {
Box::new(cm::SciterConnectionManager::new())
});
page = "cm.html";
*cm::HIDE_CM.lock().unwrap() = crate::ipc::get_config("hide_cm")
.ok()
.flatten()
.unwrap_or_default()
== "true";
} else if (args[0] == "--connect"
|| args[0] == "--file-transfer"
|| args[0] == "--port-forward"
@@ -178,6 +183,13 @@ pub fn start(args: &mut [String]) {
.unwrap_or("".to_owned()),
page
));
let hide_cm = *cm::HIDE_CM.lock().unwrap();
if !args.is_empty() && args[0] == "--cm" && hide_cm {
// run_app calls expand(show) + run_loop, we use collapse(hide) + run_loop instead to create a hidden window
frame.collapse(true);
frame.run_loop();
return;
}
frame.run_app();
}
@@ -633,9 +645,9 @@ impl UI {
pub fn verify2fa(&self, code: String) -> bool {
verify2fa(code)
}
fn verify_login(&self, raw: String, id: String) -> bool {
crate::verify_login(&raw, &id)
crate::verify_login(&raw, &id)
}
fn generate_2fa_img_src(&self, data: String) -> String {