Skip to content

ui::CaptionInsets

Header: winui/ui/WindowShell.hpp.

The caption space a window with content extended into its title bar still has to leave alone (WindowStyle::extend_content_into_title_bar): the OS's caption buttons on one side, and on the other whatever the OS keeps there (nothing on a left-to-right window). DIPs, window-client coordinates. All zero when the content is not extended, so a TitleBar can bind to it unconditionally. Read through Window::caption_insets().

Example:

// Keep a custom title row clear of the caption buttons.
ui::Border{
    .padding = ui::bind(window.caption_insets(), [](const ui::CaptionInsets& c) {
        return ui::Edges{.left = c.left, .right = c.right}; }),
    .content = ui::Text{.text = "My app"},
}

Field Type Default
left float 0.0f reserved at the left edge, in DIPs
right float 0.0f reserved at the right edge (the caption buttons), in DIPs
height float 0.0f the extended caption row's height