Skip to main content

controls

Function controls 

Source
pub fn controls(side: CaptionSide, window: &Window, cx: &App) -> Div
Expand description

The caption buttons, for a window whose system caption is gone — appears_transparent on Windows, Decorations::Client on Linux.

Call it at both ends. Rectangular captions follow App::button_layout, falling back to the right. Lights always use close/minimise/zoom on the left.

Empty in full screen, and short whatever Window::window_controls says the compositor will refuse. Close is never refused.

The cluster takes its own width in the bar, so nothing is reserved for it the way Theme::TRAFFIC_LIGHT_INSET is reserved for AppKit’s lights — those are painted over the client area by someone else, and these are not.

ⓘ
titlebar::titlebar("titlebar", true, window)
    .child(titlebar::controls(CaptionSide::Left, window, cx))
    .child(titlebar::grip("titlebar-grip", &self.drag, window))
    .child(titlebar::controls(CaptionSide::Right, window, cx))