Module window_controls
Expand description
The window’s own controls at the trailing end of its bar: maximize or restore, and close.
They belong to the window, not to a tab: they stand in the same place whether the window shows one tab or several, and act on the active tab. They are the one thing in the bar that is not the app’s — the app’s actions (its search, its History, the slots it publishes) stand on the window’s ground and look like the app; these stand in a pill of the floating material over it, so the bar says which controls belong to the window and which to what the window shows.
A Tilo window has no minimized state — it is a tab in a group, and its
group is what a person puts away — so the pill offers no minimize there.
A window of the app’s own on a desktop that leaves decorations to it does
have one (WindowControls::lay_out_own_window).
Structs§
- Button
Face - How one icon button of the window’s bar shows this frame.
- Controls
State - What the controls show this frame.
- Window
Controls - Where each control sits, and the pill behind them;
Rect::ZEROfor one the window doesn’t offer.
Enums§
Constants§
- CONTROL_
GAP - Between two of the bar’s other controls: the app’s slots
(
crate::window_toolbar), the new-tab button, and the room the window keeps for the app’s search control. - CONTROL_
PX - Side of each control’s square: a bar control.
- EDGE_
INSET - Between the pill and the window’s trailing edge.
- HISTORY_
GAP - Between the app’s own slots and the History toggle after them: the gap two of the app’s controls keep, so History reads as one more of the app’s actions rather than the first of the window’s.
- LEAD_
GAP - Between the pill and whatever stands before it in the row: the window’s controls are a section of their own, apart from the app’s by the gap between sections and by the glass the app’s ground has no part of, never by a drawn line. One step below the gap between groups, so the app’s content keeps the room it names its place with in a narrow window.
- PILL_
PAD - The pill’s own padding: between its edge and the control faces, and between two faces. It is also how far a hover ring stands off the pill’s edge, so the ring stays concentric with the capsule it sits in.
Functions§
- paint_
icon_ button - Paint one icon button of a window’s bar with the shared button face
(
crate::widget::Button::paint): the app’s slots (crate::window_toolbar), the History toggle and the new-tab button are the same control, so everything the app provides in the bar stands on the window’s ground as one row of them — the window’s own controls are the pill’s, not these. - paint_
pill - Paint the floating pill the window’s own controls stand in: the panel ground of the floating material, at the selector’s radius, over the window’s own ground or over the app’s header row. Every window’s controls stand in this one pill, so a bar says the same thing about them wherever the frame puts them.