Skip to main content

Module studio_layout

Module studio_layout 

Source
Expand description

The Studio’s resizable layout: the desktop columns — file sidebar, then up to three panels — and the height of the bottom-docked debugger drawer.

Widths are CSS pixels. The sidebar, the left panel and the right panel each hold their width; the center panel is the flexible one and takes whatever the others leave. A resizer moves exactly one boundary, so a drag changes only the two columns beside it — every other column keeps its width to the pixel. Every column has a minimum, and the minimums fit side by side at the narrowest desktop width, so the row never overflows.

The layout the user shapes by dragging is a preference; what the Studio draws is that preference Columns::fit to the current width. Narrowing the window squeezes the drawn layout, and widening it again brings the preference back unchanged.

A phone shows one pane at a time (MobileTab, opened on first_pane), and keeps the caret’s line above its keyboard (caret_in_view).

Structs§

Columns
The fixed-width columns. The center is derived: see Columns::center.
Extent
A stretch of the page from top to bottom, in CSS pixels.
Shown
Which optional columns are on screen. The left and center panels always are.

Enums§

MobileTab
The pane a phone shows, one at a time: the editor, the output, or the third panel (Console, Context or the picture). Every Run and Execute shows the output.
Resizer
A resizer, named by the boundary it moves.

Constants§

CENTER_MIN
DESKTOP_MIN_WIDTH
The narrowest window that gets the side-by-side layout; below it the Studio stacks.
DRAWER_INITIAL
The drawer’s height when it first opens: room for its controls and its tabs.
DRAWER_MIN
The drawer can shrink to its control bar and no further.
GAP
The hairline between neighbours in the panel row.
LEFT_MIN
PANELS_MIN_HEIGHT
However tall the drawer grows, the panel row above it keeps at least this much.
PROOF_DRAWER_INITIAL
The proof drawer’s height when it first opens: room for its bar and the three steps.
PROOF_MIN
Logic’s proof drawer shrinks to its bar and no further.
RESIZER
Width of a resizer bar.
RIGHT_MIN
SIDEBAR_MIN
SPLIT_MAX
SPLIT_MIN
On a phone the panels stack; the upper one’s share of the stack, in percent, stays between these bounds so neither panel can be dragged out of sight.

Functions§

caret_in_view
How far the editor scrolls so the caret’s line shows in view, the part of its pane the reader can see (above an on-screen keyboard): nothing when it shows already, up to its top when it is above, down to its bottom when it is below. A line taller than the view shows from its top.
drawer_dragged
The drawer’s height after dragging its grip by dy pixels (down is positive), where start is its height when the drag began and room is the height the panel row and the drawer share.
drawer_fit
A drawer height drawn in room pixels shared with the panel row: never below the control bar, and never so tall the panels lose their minimum.
first_pane
The pane a phone opens a file of mode on: the output for a file that runs or previews as it opens, the editor for Math, which waits for Execute. Decided by the mode alone, so the server’s render is the phone’s first frame.
proof_dragged
The proof drawer’s height after dragging its grip by dy pixels (down is positive), where start is its height when the drag began and room is the height the panel row and the drawer share: never below its bar, and never so tall the panels lose their minimum.
split_percent
The upper panel’s share of a stack height pixels tall whose top edge is at top, when the split bar is at y.