diff options
| author | user <user@clank> | 2026-08-15 11:32:47 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-08-15 11:32:47 +0200 |
| commit | d006c523de132dafa5748345ceb22f4a9f5d4cd4 (patch) | |
| tree | b81b8481a9a48bd770a0f30df66f1da8d2f7a7f7 /src/expr.c | |
| parent | sl0ppty: C-a ? shows every binding you have (diff) | |
| download | slosh-d006c523de132dafa5748345ceb22f4a9f5d4cd4.tar.gz slosh-d006c523de132dafa5748345ceb22f4a9f5d4cd4.tar.xz slosh-d006c523de132dafa5748345ceb22f4a9f5d4cd4.zip | |
sl0ppty: modals get their own surface, and dim what is behind them
Two things wrong with the first one, and both are about it being a modal
rather than a pane that happens to float.
The close button was invisible. It was drawn in the pane button colour on the
finder background, and in the default theme those are the same value --
#45454a on #45454a -- so it only appeared when the pointer landed on it and
the hover colour took over. That is the hazard of borrowing names from
another surface: each one is right, and together they are nothing. A modal is
its own surface now, with its own names (modal_bg, modal_fg, modal_border,
modal_title, modal_button, modal_button_hover), a dark panel a shade lighter
than the dimmed screen, a border in the accent, and a button chosen to be
visible *without* the pointer on it. All six themes set them.
And nothing behind it moved, so it read as another pane rather than as
something in front. There is a scrim now, `modal_scrim` (0..255, 120 by
default), and the pleasing part is that it is not a new mechanism: it is the
shader pass aimed at the screen instead of at a pane. Same dim, same
materialisation of default colours, no special case. It goes down after
everything else is painted and before the modal, so the modal is the only
thing at full brightness -- which is the whole idea, and is asserted rather
than assumed.
The shape is now reusable: modal_frame() draws the box, title, close button
and hit, and returns the rect inside it; draw_scrim() is one line above it.
The next modal is a function call and looks the same as this one.
The finder is deliberately left alone. It is a picker rather than a modal --
it navigates, where a modal here dismisses on any key -- so unifying them
would be making two things one because they are both rectangles.
Diffstat (limited to 'src/expr.c')
0 files changed, 0 insertions, 0 deletions
