diff options
Diffstat (limited to 'src/draw.zig')
| -rw-r--r-- | src/draw.zig | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/draw.zig b/src/draw.zig index 31157b1d..1cf136bd 100644 --- a/src/draw.zig +++ b/src/draw.zig @@ -1208,6 +1208,21 @@ fn joinPaneTag(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, r @memset(storage, .{}); 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| { + const th = p.theme(); + if (pick == id) 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. const layer = &s.tag_layers[id]; @@ -1220,7 +1235,7 @@ fn joinPaneTag(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, r layer.cols = columns; layer.rows = rows; layer.context_rows = 0; - layer.bg = if (active and p.settings.focus_tint) chrome.tag_active_bg else chrome.tag_bg; + 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| |
