Restore isolated node logins as separate Synapsis windows and remove native and custom tab behavior
Hop-State: A_06FPHMM1PFMSCK40M0GEWBR Hop-Proposal: R_06FPHMKH27FXXCWW817HVYR Hop-Task: T_06FPHGD2KCWG1MGS7615MY8 Hop-Attempt: AT_06FPHGD2KE7PCEC2AXHKM18
This commit is contained in:
+10
-14
@@ -345,14 +345,14 @@ fn new_window_button_script(accent_color: Option<&str>) -> String {
|
||||
button.id = id;
|
||||
button.type = "button";
|
||||
button.innerHTML = '<svg viewBox="0 0 22 22" aria-hidden="true"><path d="M11 2.5V19.5M2.5 11H19.5" fill="none" stroke="black" stroke-width="2.5" stroke-linecap="round"/></svg>';
|
||||
button.setAttribute("aria-label", "Open another Synapsis node tab");
|
||||
button.title = "Open another node tab";
|
||||
button.setAttribute("aria-label", "Open another Synapsis node window");
|
||||
button.title = "Open another node";
|
||||
button.addEventListener("click", async () => {
|
||||
button.disabled = true;
|
||||
try {
|
||||
await window.__TAURI_INTERNALS__.invoke("open_login_window");
|
||||
} catch (error) {
|
||||
console.error("Could not open another Synapsis node tab", error);
|
||||
console.error("Could not open another Synapsis window", error);
|
||||
} finally {
|
||||
button.disabled = false;
|
||||
}
|
||||
@@ -384,7 +384,7 @@ async fn open_login_window(
|
||||
) -> Result<(), String> {
|
||||
let sequence = state.window_sequence.fetch_add(1, Ordering::Relaxed);
|
||||
let label = format!("node-{sequence}");
|
||||
let builder = WebviewWindowBuilder::new(
|
||||
WebviewWindowBuilder::new(
|
||||
&app,
|
||||
label,
|
||||
WebviewUrl::App("index.html?newWindow=1".into()),
|
||||
@@ -395,17 +395,13 @@ async fn open_login_window(
|
||||
.inner_size(1280.0, 820.0)
|
||||
.min_inner_size(720.0, 560.0)
|
||||
.center()
|
||||
.hidden_title(true)
|
||||
.title_bar_style(tauri::TitleBarStyle::Visible)
|
||||
.theme(Some(tauri::Theme::Dark))
|
||||
.background_color(tauri::webview::Color(8, 9, 9, 255));
|
||||
#[cfg(target_os = "macos")]
|
||||
let builder = builder
|
||||
.hidden_title(true)
|
||||
.title_bar_style(tauri::TitleBarStyle::Visible)
|
||||
.tabbing_identifier("synapsis-node-tabs");
|
||||
builder
|
||||
.build()
|
||||
.map(|_| ())
|
||||
.map_err(|error| format!("Couldn’t open another Synapsis node tab: {error}"))
|
||||
.background_color(tauri::webview::Color(8, 9, 9, 255))
|
||||
.build()
|
||||
.map(|_| ())
|
||||
.map_err(|error| format!("Couldn’t open another Synapsis window: {error}"))
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
"center": true,
|
||||
"hiddenTitle": true,
|
||||
"titleBarStyle": "Visible",
|
||||
"tabbingIdentifier": "synapsis-node-tabs",
|
||||
"theme": "Dark",
|
||||
"backgroundColor": "#080909"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user