diff options
| author | user <user@clank> | 2026-08-14 19:48:30 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-08-14 19:48:30 +0200 |
| commit | e021e0d05926fbaae2b53edaf256fdd7b31aff1d (patch) | |
| tree | e841ac08f4b5a241d4013fcfd0a6207eb78e4f43 /src/app.h | |
| parent | sl0ppty: zoom a pane, and give the frame buttons for it (diff) | |
| download | slosh-e021e0d05926fbaae2b53edaf256fdd7b31aff1d.tar.gz slosh-e021e0d05926fbaae2b53edaf256fdd7b31aff1d.tar.xz slosh-e021e0d05926fbaae2b53edaf256fdd7b31aff1d.zip | |
sl0ppty: minimise a pane into a strip along the bottom
A pane can be put away: it leaves the layout, becomes one row at the bottom of
the tab, and keeps running. The panes it leaves behind take the space back.
Clicking its row brings it back.
Minimised is intent, so it sits beside the weight on the node rather than with
the rect and the collapsed flag — and layout_node has to be careful not to
clear it the way it clears those, or every frame would undo it. That is the
only sharp edge in the whole thing and it has a comment.
Everything else fell out of rules that already existed. A split divides among
the children that still want space, so a split with one live child is that
child, exactly as a split with one child already was. A minimised leaf returns
from layout_node before its rect is touched, which also skips the floor check —
a pane that is one row by request is not a pane that failed to fit. And the row
itself is drawn by the same code as a collapsed header, because it is the same
thing: a pane you can see the name of and click.
Restoring is not a verb. A focused pane is never minimised, checked once a
frame, so every route that ends with the pane focused restores it — clicking
the row, the control API, and anything added later that moves focus without
knowing minimising exists.
In a tab that has flattened into a list, minimising has no effect at all, which
is what was asked for and also what falls out: every pane down there is already
a row, so there is no second thing for it to be. The strip is not reserved when
it would leave too little above it to be worth looking at; the tab flattens
instead, and arrives at the same place.
Minimising the last visible pane is refused with a toast. A tab showing nothing
has no way back that can be discovered from the tab, and it is not a state
worth being able to reach by accident.
The frame's third button costs another three columns, which is why they are
drawn right to left and stop when they run out: a narrow pane keeps close and
zoom, and loses minimise first.
Diffstat (limited to 'src/app.h')
| -rw-r--r-- | src/app.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -87,6 +87,11 @@ bool app_apply_layout_file(app_t *a, const char *path, bool replace, char *err, * because it opened the socket under that name. */ void app_set_session(app_t *a, const char *name); +/* Put a pane away into the strip along the bottom. 0 means the focused one. + * False if it would leave the tab with nothing on screen. Restoring is done by + * focusing it, which is what clicking its row does. */ +bool app_minimize(app_t *a, uint32_t id); + /* Fill the tab with one pane, or put it back. 0 means the focused one. */ bool app_toggle_zoom(app_t *a, uint32_t id); bool app_pane_zoomed(app_t *a, uint32_t id); |
