summaryrefslogtreecommitdiff
path: root/src/gui/gui.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/gui.zig')
-rw-r--r--src/gui/gui.zig18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/gui/gui.zig b/src/gui/gui.zig
index 140ca1db..7bf45676 100644
--- a/src/gui/gui.zig
+++ b/src/gui/gui.zig
@@ -5508,11 +5508,11 @@ const ResolvedCell = struct {
const topbarPaneBorderPixels = pardes.topbarPaneBorderPixels;
const taglineBandOffset = pardes.taglineBandOffset;
-fn topbarPaneBorderHeight(surface: *const pardes.Surface, cell_h: u32, tagline_h: u32) ?u32 {
- if (surface.rows <= pardes.TOPBAR_H) return null;
+fn topbarPaneBorderHeight(surface: *const pardes.Surface, top: u16, cell_h: u32, tagline_h: u32) ?u32 {
+ if (top == 0 or surface.rows <= top) return null;
const height = topbarPaneBorderPixels(cell_h, tagline_h);
if (height == 0) return null;
- const base = @as(usize, pardes.TOPBAR_H) * surface.cols;
+ const base = @as(usize, top) * surface.cols;
for (surface.cells[base..][0..surface.cols]) |cell|
if (!cell.default and cell.style.font_role == .tagline) return height;
return null;
@@ -5611,7 +5611,7 @@ fn cellInstanceCount(cell: *const pardes.Cell) u32 {
fn taglineBaseRgb(core: *const pardes.Pardes, col: u16, row: u16) [3]u8 {
const chrome = core.chromeTheme();
if (!core.settings.focus_tint) return chrome.tag_bg;
- if (row >= pardes.TOPBAR_H and row < pardes.TOPBAR_H + core.columnBarHeight()) {
+ if (row >= core.topBarHeight() and row < core.topBarHeight() + core.columnBarHeight()) {
for (0..core.ncol) |column| for (core.col_panes[column][0..core.col_n[column]]) |id| {
if (id != core.active) continue;
const x = core.col_x[column];
@@ -7275,8 +7275,10 @@ fn buildOverlay(
const win_h: f32 = @floatFromInt(sh);
var builder = OverlayBuilder{ .vertices = g.overlay_vertices, .win_w = win_w, .win_h = win_h };
appendWorkspacePet(g, core, surface, &builder);
- if (topbarPaneBorderHeight(surface, g.cell_h, g.tagline_height)) |height| {
- const y0: f32 = @floatFromInt(g.cell_h - height / 2);
+ // The workspace tag grows a row per line, so the border follows its foot.
+ const top_rows: u16 = if (core) |p| p.topBarHeight() else pardes.TOPBAR_H;
+ if (topbarPaneBorderHeight(surface, top_rows, g.cell_h, g.tagline_height)) |height| {
+ const y0: f32 = @floatFromInt(top_rows * g.cell_h - height / 2);
const rgb = topbar_pane_border_rgb;
builder.addRect(0, y0, win_w, y0 + @as(f32, @floatFromInt(height)), .{
.r = @as(f32, @floatFromInt(rgb[0])) / 255.0,
@@ -7286,7 +7288,7 @@ fn buildOverlay(
});
}
if (core) |p| if (p.columnBarHeight() > 0) {
- const y = @as(f32, @floatFromInt(pardes.TOPBAR_H + p.columnBarHeight())) * layout.h;
+ const y = @as(f32, @floatFromInt(top_rows + p.columnBarHeight())) * layout.h;
builder.addRect(0, y - 1, win_w, y, overlayRgb(p.chromeTheme().border));
};
const grid_bottom = @as(f32, @floatFromInt(surface.rows)) * layout.h;
@@ -7589,7 +7591,7 @@ fn appendSquareRail(builder: *OverlayBuilder, x: f32, y0: f32, y1: f32, cell_w:
}
fn appendColumnSpines(core: *const pardes.Pardes, rows: u16, layout: CellLayout, builder: *OverlayBuilder) void {
- const y0 = @as(f32, @floatFromInt(pardes.TOPBAR_H)) * layout.h;
+ const y0 = @as(f32, @floatFromInt(core.topBarHeight())) * layout.h;
const grid_y1 = @as(f32, @floatFromInt(rows)) * layout.h;
// Down through the pixels past the last whole row, as tags run right.
const y1 = if (builder.win_h - grid_y1 < layout.h) @max(grid_y1, builder.win_h) else grid_y1;