Skip to main content

Module edge_resize

Module edge_resize 

Expand description

Resizing windows from their edges: which edge an edge drag changes, and how.

The strip is infinitely wide, so a resize is never zero-sum unless the person asks for it. Every pointer path goes through the same few rules: crate::widget::GroupRow’s hover, press and drag for a window on a strip, crate::widget::FloatingWindow’s for a free one.

  • seam_owner — who owns an edge on a strip. Every window owns both edges; the seam between two is split down the middle, except that the focused window owns the whole seam. Hovering shows that owner’s edge before anything is pressed.
  • RectEdge::at — which sides a point on a free rect grabs: a side, the bottom or a corner, never the top where the title bar drags.
  • EdgeDrag::resize and RectEdge::resize — what a drag does on dragged_span: the grabbed side follows the pointer 1:1 and its opposite holds still, so everything beyond is pushed away or pulled along at its own size. On a strip, Shift+drag is zero-sum between the two windows sharing that seam. A limit (the app’s minimum, a client’s maximum) stops the edge; nothing else is resized to make up for it.

This is a design rule, not a tuning: docs/architecture/window-management.md (“Resizing a window”) is its contract.

Structs§

DraggedWindow
One window of a drag, as it was when the drag began.
EdgeDrag
An edge drag, from the moment it was pressed.
EdgeGrab
A window edge a pointer can grab: the strip’s group-th window, and which of its edges.
EdgeResize
What a drag sets for one pointer position.
RectEdge
The edge of a free rect (a floating window, a picture in a document) that a drag grabbed: which side of each axis moves. Absent on an axis the edge leaves alone, so a side edge moves one axis and a corner both.
Seam
The two windows either side of a seam, as laid out on screen: the strip’s left-th window and the one after it.
WidthLimits
The widths a window may take, in logical px.

Enums§

ResizeMode
How a drag shares out width.
WindowEdge
One of a window’s two vertical edges.

Functions§

seam_owner
The seam rule: whose edge a point x on the seam between two windows is.