Size the rail to the traffic lights instead of guessing
The collapsed rail was a fixed 72px, which left the cluster with more room on its left than its right. The width now comes from the buttons themselves - the close button's own inset plus the zoom button's right edge - so the margin matches on both sides. That inset is macOS's to choose and has changed between releases, so it is asked for rather than assumed. Measured at startup rather than on demand. The answer arrives on the main thread, and a command waiting for it there deadlocks until the timeout and silently returns the fallback - which is what the first attempt did.
This commit is contained in:
@@ -91,6 +91,9 @@ pub fn run() {
|
||||
let chrome = webviews::measure_chrome(&handle);
|
||||
*handle.state::<commands::AppState>().chrome.lock().unwrap() = chrome;
|
||||
|
||||
let rail = commands::measure_rail(&handle);
|
||||
*handle.state::<commands::AppState>().rail.lock().unwrap() = rail;
|
||||
|
||||
let theme = app.state::<commands::AppState>().cfg().settings.theme;
|
||||
commands::apply_window_theme(&app.handle().clone(), &theme);
|
||||
Ok(())
|
||||
@@ -120,6 +123,7 @@ pub fn run() {
|
||||
commands::reset_config,
|
||||
commands::set_window_chrome,
|
||||
commands::chrome_height,
|
||||
commands::rail_width,
|
||||
commands::unread_counts,
|
||||
commands::focus_window,
|
||||
commands::save_password,
|
||||
|
||||
Reference in New Issue
Block a user