summaryrefslogtreecommitdiff
path: root/src/draw.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-21 22:53:57 -0300
committerGabriel Schneider <[email protected]>2026-10-22 10:03:15 -0300
commit6076ab9e805838d4c4e8bb795428fae0a85671e9 (patch)
treeffbc0b1cfb803be44ff5ba65486ba42229df2ce7 /src/draw.zig
parent1c6ebadde64b2e0f416550f9fc806dfc3c80b5c1 (diff)
downloadpardes-6076ab9e805838d4c4e8bb795428fae0a85671e9.tar.gz
pardes-6076ab9e805838d4c4e8bb795428fae0a85671e9.zip
Window mode: the pane's letter in its tag's box, no message
Diffstat (limited to 'src/draw.zig')
-rw-r--r--src/draw.zig17
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.