chore: compute controls as a single value per platform
This commit is contained in:
@@ -20,7 +20,7 @@ use gpui_native_theme::ActiveTheme as _;
|
||||
#[cfg(target_os = "linux")]
|
||||
use gpui::Decorations;
|
||||
#[cfg(target_os = "windows")]
|
||||
use gpui::rgba;
|
||||
use gpui::{SharedString, px, rgba};
|
||||
|
||||
/// macOS traffic-lights zone: the pad a leading titlebar strip reserves.
|
||||
pub const TRAFFIC_LIGHT_PAD: f32 = 78.0;
|
||||
@@ -52,13 +52,13 @@ impl RenderOnce for WindowControls {
|
||||
let id = self.id.clone();
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
let controls = {
|
||||
let _ = (id, window, cx);
|
||||
div()
|
||||
}
|
||||
};
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
let controls = {
|
||||
let controls = window.window_controls();
|
||||
div()
|
||||
.flex_none()
|
||||
@@ -97,10 +97,10 @@ impl RenderOnce for WindowControls {
|
||||
true,
|
||||
true,
|
||||
))
|
||||
}
|
||||
};
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
{
|
||||
let controls = {
|
||||
let _ = id;
|
||||
let controls = window.window_controls();
|
||||
let client_decorated =
|
||||
@@ -143,7 +143,9 @@ impl RenderOnce for WindowControls {
|
||||
|window, _cx| window.remove_window(),
|
||||
))
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
controls
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user