dear-imgui-rs 0.12.0

High-level Rust bindings to Dear ImGui v1.92.7 with docking, WGPU/GL backends, and extensions (ImPlot/ImPlot3D, ImNodes, ImGuizmo, file browser, reflection-based UI)
Documentation
//! Content region helpers
//!
//! Query the available region inside the current window, excluding decorations
//! such as title bars and scrollbars. Handy for adaptive sizing.
//!
use crate::Ui;
use crate::sys;

impl Ui {
    /// Returns the size of the content region available for widgets
    ///
    /// This is the size of the window minus decorations (title bar, scrollbars, etc.)
    #[doc(alias = "GetContentRegionAvail")]
    pub fn content_region_avail(&self) -> [f32; 2] {
        let size = unsafe { sys::igGetContentRegionAvail() };
        [size.x, size.y]
    }

    /// Returns the width of the content region available for widgets
    ///
    /// This is equivalent to `content_region_avail()[0]`
    pub fn content_region_avail_width(&self) -> f32 {
        self.content_region_avail()[0]
    }

    /// Returns the height of the content region available for widgets
    ///
    /// This is equivalent to `content_region_avail()[1]`
    pub fn content_region_avail_height(&self) -> f32 {
        self.content_region_avail()[1]
    }
}