summaryrefslogtreecommitdiff
path: root/src/draw.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-21 21:42:33 -0300
committerGabriel Schneider <[email protected]>2026-10-22 10:03:15 -0300
commit3643635640e97eb2e43730d58fcc46214e21851e (patch)
treea096772d1709492a624bb90f06fdc98a60d142ac /src/draw.zig
parent4e89db185fa4e3bfe4358d2da3b76fad0cc7e547 (diff)
downloadpardes-3643635640e97eb2e43730d58fcc46214e21851e.tar.gz
pardes-3643635640e97eb2e43730d58fcc46214e21851e.zip
Window mode: pick the pane to focus with an outline or a label
Diffstat (limited to 'src/draw.zig')
-rw-r--r--src/draw.zig17
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|