diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-05 13:08:44 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-05 15:21:15 -0300 |
| commit | 1b2ac091200e9192f3677abe161217ba82463606 (patch) | |
| tree | 8fe35cf6edaa032e4650a631598dfab2fc4aabb5 /src/draw.zig | |
| parent | 1870d06248f884439cb2ec4ef8f1b03952df2eb8 (diff) | |
| download | pardes-1b2ac091200e9192f3677abe161217ba82463606.tar.gz pardes-1b2ac091200e9192f3677abe161217ba82463606.zip | |
effects out, the message animations: a message no longer falls into its row and dissolves out of it; it shows at once and goes when it has lingered, its lifetime the one deadline the core keeps for it (MessageLinger, a wait nextWake jumps in one step); MessageAnimation, MessageFall and MessageDissolve go with their settings, the entering and leaving phases (Pane.MessagePhase is shown or lingering), Messages.messageMotion and noticeLife, the notice band's colour blend toward the page, Layer.slide and fade, and the window's offset band, its clip to the body and its rule's fade; no frontend fades a message of its own (the window would have to see a notice come and go between frames for a 150 ms fade); the snapshot harness's, kitty harness's and casts' inits lose `MessageAnimation off`; the message tests keep their linger and stacking and lose the fall and dissolve, and `a notice leaves quicker than it arrives` goes; GUI goldens 10 and 12 to 17 change, the golden session having run with MessageAnimation on by default: a message dismissed while it fell stayed up (its dismissal undone by the next announcement), and FocusTint's stood on in every scene after; the tree before this change with MessageAnimation off draws exactly these frames, all sixteen byte for byte
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/draw.zig')
| -rw-r--r-- | src/draw.zig | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/draw.zig b/src/draw.zig index d299b03f..55fab141 100644 --- a/src/draw.zig +++ b/src/draw.zig @@ -752,8 +752,6 @@ fn renderHeaderLayer(p: *Pardes, layer: *pardes.Layer, kind: TagKind, id: u16, v layer.context_rows = 0; layer.bg = bg; layer.cursor = null; - layer.slide = 0; - layer.fade = 1; // A notice band carries a PANE id, not a column index, so it must not // answer to the column being edited -- that would scroll and select // its text with the column tag's offsets and give it a second caret. @@ -870,8 +868,6 @@ fn joinPaneTag(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, r layer.rows = rows; layer.context_rows = 0; layer.bg = if (p.window_pick == id) p.theme().sel_bg else if (active and p.settings.focus_tint) chrome.tag_active_bg else chrome.tag_bg; - layer.slide = 0; - layer.fade = 1; layer.cursor = if (p.header_focus) null else if (temporary.cursor) |cursor| .{ .x = cursor.x - TAG_TEXT_INSET, .y = cursor.y, .bar = cursor.bar } else @@ -892,7 +888,6 @@ fn joinPaneTag(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, r /// grid's chip a copy of its right end, where its text is. fn joinNotice(p: *Pardes, s: *Surface, arena: std.mem.Allocator, region: Region) !void { const chrome = p.chromeTheme(); - const th = p.theme(); const id: usize = region.owner; const pane = p.panes[id].?; const i: usize = region.notice; @@ -901,15 +896,10 @@ fn joinNotice(p: *Pardes, s: *Surface, arena: std.mem.Allocator, region: Region) const chip = region.rect.w; var leader_buf: [16]u8 = undefined; const text = Messages.noticeText(p, pane, i, &leader_buf); - // A message coming or going blends toward the page it sits on; a grid - // cannot move it by less than a row, a pixel shell slides it too. - const motion: Messages.MessageMotion = if (Messages.noticeLife(pane, i)) |life| Messages.messageMotion(p, life) else .{}; - const page = th.bg orelse chrome.tag_bg; - const bg = colors.lerp(page, chrome.tag_bg, motion.alpha); + const bg = chrome.tag_bg; // Where an exec was sent to a REPL reads in the tag's name tint, set // apart from what the editor says. - const ink = if (kind == .message and pane.msg_sent) chrome.tag_name_fg else chrome.tag_fg; - const fg = colors.lerp(page, ink, motion.alpha); + const fg = if (kind == .message and pane.msg_sent) chrome.tag_name_fg else chrome.tag_fg; // Nothing to say, or too narrow for a layer: a blank chip on the grid. if (text.len == 0 or r.w <= TAG_TEXT_INSET) { s.fill(region.rect.x, region.rect.y, chip, 1, .{ .bg = .{ .rgb = bg }, .font_role = .tagline }); @@ -941,8 +931,6 @@ fn joinNotice(p: *Pardes, s: *Surface, arena: std.mem.Allocator, region: Region) @memcpy(line[pad..], kept); const layer = &s.tag_layers[NOTICE_LAYER_BASE + id * Pane.Notices.max + i]; try renderHeaderLayer(p, layer, .notice, @intCast(id), region.rect, line, 0, bg, fg); - layer.slide = motion.slide; - layer.fade = motion.alpha; // The caret rides the band, where the prompt's glyphs are. if (kind == .prompt and id == p.active and pane.prompt != .del_side and pane.prompt != .repl_choice) caret: { const typed = panes.File.displayWidth(text[0..@min(@as(usize, @intCast(@max(0, pane.input.cur_col))), text.len)]); |
