Skip to repository content26 lines · 1.0 KB · rust
tenant.openagents/omega
No repository description is available.
OpenAgents Git authority 2026-07-28T04:34:17.206Z Public web read
NIP-34 coordinate
30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omegaMaintainersHidden in public view
References2 branches · 1 tag
Read-only clone
git clone https://openagents.com/git/tenant.openagents/omega.gitBrowse files
constants.rs
1use gpui::{Pixels, Window, px};
2
3pub const MACOS_SDK_26_OR_LATER: bool = cfg!(macos_sdk_26_or_later);
4
5// Use pixels here instead of a rem-based size because the macOS traffic
6// lights are a static size, and don't scale with the rest of the UI.
7//
8// Magic number: There is one extra pixel of padding on the left side due to
9// the 1px border around the window on macOS apps.
10pub const TRAFFIC_LIGHT_PADDING: f32 = if MACOS_SDK_26_OR_LATER { 78. } else { 71. };
11
12/// Returns the platform-appropriate title bar height.
13///
14/// On Windows, this returns a fixed height of 32px.
15/// On other platforms, it scales with the window's rem size (1.75x) with a minimum of 34px.
16#[cfg(not(target_os = "windows"))]
17pub fn platform_title_bar_height(window: &Window) -> Pixels {
18 (1.75 * window.rem_size()).max(px(34.))
19}
20
21#[cfg(target_os = "windows")]
22pub fn platform_title_bar_height(_window: &Window) -> Pixels {
23 // todo(windows) instead of hard coded size report the actual size to the Windows platform API
24 px(32.)
25}
26