Skip to main content

titlebar_height

Function titlebar_height 

Source
pub fn titlebar_height(ui: &Ui<'_>) -> f32
Expand description

The height the titlebar strip draws at — what an app laying out its own strip, or something under it, should read instead of ui.metrics().titlebar_h. Where the OS keeps controls of its own over the strip (env.window.native_controls: the macOS traffic lights under custom chrome) the strip is the OS’s own titlebar, as tall as the keep-out rect says that titlebar is, so the strip’s content centres on the buttons the OS centred in it. Everywhere else the strip is the app’s alone and Metrics::titlebar_h is its height. A keep-out with no height (a host that reported a width only) falls back to the metric.