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.id = id;
|
||||||
button.type = "button";
|
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.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.setAttribute("aria-label", "Open another Synapsis node window");
|
||||||
button.title = "Open another node tab";
|
button.title = "Open another node";
|
||||||
button.addEventListener("click", async () => {
|
button.addEventListener("click", async () => {
|
||||||
button.disabled = true;
|
button.disabled = true;
|
||||||
try {
|
try {
|
||||||
await window.__TAURI_INTERNALS__.invoke("open_login_window");
|
await window.__TAURI_INTERNALS__.invoke("open_login_window");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Could not open another Synapsis node tab", error);
|
console.error("Could not open another Synapsis window", error);
|
||||||
} finally {
|
} finally {
|
||||||
button.disabled = false;
|
button.disabled = false;
|
||||||
}
|
}
|
||||||
@@ -384,7 +384,7 @@ async fn open_login_window(
|
|||||||
) -> Result<(), String> {
|
) -> Result<(), String> {
|
||||||
let sequence = state.window_sequence.fetch_add(1, Ordering::Relaxed);
|
let sequence = state.window_sequence.fetch_add(1, Ordering::Relaxed);
|
||||||
let label = format!("node-{sequence}");
|
let label = format!("node-{sequence}");
|
||||||
let builder = WebviewWindowBuilder::new(
|
WebviewWindowBuilder::new(
|
||||||
&app,
|
&app,
|
||||||
label,
|
label,
|
||||||
WebviewUrl::App("index.html?newWindow=1".into()),
|
WebviewUrl::App("index.html?newWindow=1".into()),
|
||||||
@@ -395,17 +395,13 @@ async fn open_login_window(
|
|||||||
.inner_size(1280.0, 820.0)
|
.inner_size(1280.0, 820.0)
|
||||||
.min_inner_size(720.0, 560.0)
|
.min_inner_size(720.0, 560.0)
|
||||||
.center()
|
.center()
|
||||||
|
.hidden_title(true)
|
||||||
|
.title_bar_style(tauri::TitleBarStyle::Visible)
|
||||||
.theme(Some(tauri::Theme::Dark))
|
.theme(Some(tauri::Theme::Dark))
|
||||||
.background_color(tauri::webview::Color(8, 9, 9, 255));
|
.background_color(tauri::webview::Color(8, 9, 9, 255))
|
||||||
#[cfg(target_os = "macos")]
|
.build()
|
||||||
let builder = builder
|
.map(|_| ())
|
||||||
.hidden_title(true)
|
.map_err(|error| format!("Couldn’t open another Synapsis window: {error}"))
|
||||||
.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}"))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
"center": true,
|
"center": true,
|
||||||
"hiddenTitle": true,
|
"hiddenTitle": true,
|
||||||
"titleBarStyle": "Visible",
|
"titleBarStyle": "Visible",
|
||||||
"tabbingIdentifier": "synapsis-node-tabs",
|
|
||||||
"theme": "Dark",
|
"theme": "Dark",
|
||||||
"backgroundColor": "#080909"
|
"backgroundColor": "#080909"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user