diff options
Diffstat (limited to 'src/draw.zig')
| -rw-r--r-- | src/draw.zig | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/draw.zig b/src/draw.zig index 1cf136bd..3d0d4d3c 100644 --- a/src/draw.zig +++ b/src/draw.zig @@ -941,7 +941,9 @@ fn renderPane(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, r: .bg = .{ .rgb = band }, .font_role = .tagline, }); - s.set(r.x, tag_y, switch (pane.body.mode) { + // In window mode the box holds the pane's letter instead of its mode. + const label: ?u8 = if (p.window_pick != null) layout.windowLabel(p, id) else null; + s.set(r.x, tag_y, if (label) |*letter| @as(*const [1]u8, letter) else switch (pane.body.mode) { .normal => config.tag_normal, .insert => config.tag_insert, .tty => config.tag_tty, @@ -1209,19 +1211,14 @@ fn joinPaneTag(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, r var temporary: Surface = .{ .cols = columns + TAG_TEXT_INSET, .rows = rows, .cells = storage }; try paintPaneTag(p, &temporary, arena, pane, .{ .x = 0, .y = 0, .w = columns + TAG_TEXT_INSET, .h = rows }, id, active, capacity); // Window mode (layout.windowKey): the outlined pane's tag in the - // selection's colours, and each pane's letter over its tag's start. - if (p.window_pick) |pick| { + // selection's colours. + if (p.window_pick == id) { const th = p.theme(); - if (pick == id) for (storage) |*cell| { + for (storage) |*cell| { cell.style.bg = .{ .rgb = th.sel_bg }; cell.style.fg = .{ .rgb = th.sel_fg }; cell.default = false; - }; - if (layout.windowLabel(p, id)) |letter| if (columns >= 3) for (" ? ", 0..) |ch, i| { - const at = temporary.at(@intCast(TAG_TEXT_INSET + i), 0); - const style: CellStyle = .{ .fg = .{ .rgb = chrome.tag_bg }, .bg = .{ .rgb = chrome.tag_fg }, .bold = true, .font_role = at.style.font_role }; - temporary.set(@intCast(TAG_TEXT_INSET + i), 0, &.{if (ch == '?') letter else ch}, style); - }; + } } const tag_fg: Color = .{ .rgb = if (active and p.settings.focus_tint) chrome.tag_active_fg else chrome.tag_fg }; // One layer, a row to each line the tag shows. |
