summaryrefslogtreecommitdiff
path: root/src/draw.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 20:47:45 -0300
committerGabriel Schneider <[email protected]>2026-11-05 22:07:55 -0300
commit80d47cd246f37356fd2e705495936f6546613e29 (patch)
treec9b8025faa82717c9cc51d98dd4ce774dc0fad13 /src/draw.zig
parent4c3dbce20f11204f6d4bfb715239beae74259e7f (diff)
downloadpardes-80d47cd246f37356fd2e705495936f6546613e29.tar.gz
pardes-80d47cd246f37356fd2e705495936f6546613e29.zip
fields #39, a header's focus is one optional union: header_focus and header_column, of which (false, some column) never happened, are the session's header: ?Header, workspace or column, and p.headerColumn() the column whose tag has the keyboard (null for none or the workspace's); tagline.enterHeader and exitHeader set it in one write each, layout.reorderColumn moves the focused column's index in place, and the reads in 17 files say p.header != null where they said header_focus; views.zig's per-view fields name header; a dump written before this change loads it as the default once: an Upgrade or Restore from it comes back with the keyboard on a pane, not a header, and the wire's semantics change; gates on tui: core-test 960/960, behaviour-test 238/238, pane-test 171/172 (1 skipped), snap all 108 scripts ok; gui unit-test 1518/1519 (1 skipped)
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.zig12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/draw.zig b/src/draw.zig
index e8276904..830f10df 100644
--- a/src/draw.zig
+++ b/src/draw.zig
@@ -471,7 +471,7 @@ fn paintHeaders(p: *Pardes, s: *Surface) !void {
// global tagbar: full width, top rows — unless a native shell has
// taken its commands over, in which case the rows are not ours to draw
if (s.region(.workspace_tag, Region.none)) |region| {
- const top = if (p.header_focus and p.header_column == null) p.header_top else 0;
+ const top = if (p.header != null and p.headerColumn() == null) p.header_top else 0;
const layer = &s.tag_layers[MAX_PANES + MAX_COLS];
var viewport = region.rect;
const inset = @min(TAG_TEXT_INSET, viewport.w);
@@ -500,7 +500,7 @@ fn paintHeaders(p: *Pardes, s: *Surface) !void {
s.fill(p.col_x[c], region.rect.y + 1, grip, column_rows -| 1, .{ .bg = .{ .rgb = bg }, .font_role = .tagline });
s.fill(p.col_x[c] + grip, region.rect.y, inset - grip, column_rows, .{ .bg = .{ .rgb = bg }, .font_role = .tagline });
}
- const top = if (p.header_focus and p.header_column == c) p.header_top else 0;
+ const top = if (p.header != null and p.headerColumn() == c) p.header_top else 0;
const layer = &s.tag_layers[MAX_PANES + c];
try renderHeaderLayer(p, layer, .column, @intCast(c), region.rect, tagline.columnTag(p, c), top, bg, fg);
if (p.col_x[c] < s.cols) joinHeaderRows(s, layer, fg);
@@ -597,9 +597,9 @@ fn renderHeaderLayer(p: *Pardes, layer: *pardes.Layer, kind: TagKind, id: u16, v
// 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.
- const editing: ?*Text = if (p.header_focus and switch (kind) {
- .workspace => p.header_column == null,
- .column => p.header_column == id,
+ const editing: ?*Text = if (p.header != null and switch (kind) {
+ .workspace => p.headerColumn() == null,
+ .column => p.headerColumn() == id,
.pane, .notice, .body => false,
}) tagline.focusedHeader(p) else null;
const scroll = if (editing != null) p.header_scroll else 0;
@@ -710,7 +710,7 @@ 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.cursor = if (p.header_focus) null else if (temporary.cursor) |cursor|
+ layer.cursor = if (p.header != null) null else if (temporary.cursor) |cursor|
.{ .x = cursor.x - TAG_TEXT_INSET, .y = cursor.y, .bar = cursor.bar }
else
null;