diff options
| -rw-r--r-- | src/draw.zig | 4 | ||||
| -rw-r--r-- | src/mouse.zig | 3 | ||||
| -rw-r--r-- | src/pardes.zig | 3 | ||||
| -rw-r--r-- | test/column_drag.zig | 8 | ||||
| -rw-r--r-- | test/panes.zig | 11 |
5 files changed, 5 insertions, 24 deletions
diff --git a/src/draw.zig b/src/draw.zig index 38080c92..bfcb8509 100644 --- a/src/draw.zig +++ b/src/draw.zig @@ -32,7 +32,6 @@ const TagKind = @import("Layer.zig").Kind; const pdf_enabled = panes.Pdf.enabled; const wordBoundsAtCol = pardes.wordBoundsAtCol; const BOX_H = pardes.BOX_H; -const TAG_GAP = pardes.TAG_GAP; const TAG_TEXT_INSET = pardes.TAG_TEXT_INSET; const MAX_PANES = pardes.MAX_PANES; const MAX_COLS = pardes.MAX_COLS; @@ -1215,7 +1214,7 @@ fn joinPaneTag(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, r layer.kind = .pane; layer.id = @intCast(id); layer.serial = pane.serial; - layer.viewport = .{ .x = region.rect.x + TAG_GAP, .y = region.rect.y, .w = region.rect.w - TAG_GAP - region.clip, .h = rows }; + layer.viewport = .{ .x = region.rect.x, .y = region.rect.y, .w = region.rect.w - region.clip, .h = rows }; layer.cols = columns; layer.rows = rows; layer.context_rows = 0; @@ -1330,7 +1329,6 @@ fn paintPaneTag(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, const tag_style: CellStyle = .{ .fg = .{ .rgb = tag_fg }, .bg = .{ .rgb = tag_bg }, .font_role = .tagline }; // Padding belongs to the same font row but keeps its default ink: a // role must not manufacture a foreground color for blank cells. - s.fill(r.x + config.GUTTER, tag_y, @min(TAG_GAP, r.w -| config.GUTTER), rows, .{ .bg = .{ .rgb = tag_bg }, .font_role = .tagline }); s.fill(tx, tag_y, tw, rows, .{ .bg = .{ .rgb = tag_bg }, .font_role = .tagline, diff --git a/src/mouse.zig b/src/mouse.zig index 32f7c716..b6650cc5 100644 --- a/src/mouse.zig +++ b/src/mouse.zig @@ -25,7 +25,6 @@ const MAX_PANES = pardes.MAX_PANES; const Layer = @import("Layer.zig"); const TOPBAR_H = pardes.TOPBAR_H; const BOX_H = pardes.BOX_H; -const TAG_GAP = pardes.TAG_GAP; const TAG_TEXT_INSET = pardes.TAG_TEXT_INSET; const Builtin = pardes.Builtin; const Mouse = pardes.Mouse; @@ -987,7 +986,7 @@ pub fn dragUpdate(p: *Pardes, mcol: u16, mrow: u16, body_hit: ?Mouse.BodyHit) vo 0 else @as(i32, @min(@max(mrow, body_y), body_y + body_h - 1)) - @as(i32, body_y) + tag_rows; - if (pane.sel[b].r1 < tag_rows) pane.sel[b].c1 += @as(i32, pane.tag_scroll) - TAG_GAP; + if (pane.sel[b].r1 < tag_rows) pane.sel[b].c1 += @as(i32, pane.tag_scroll); if (comptime pdf_enabled) panes.Pdf.pointerUpdate(&s.pdf, p, pane, mcol, mrow); } diff --git a/src/pardes.zig b/src/pardes.zig index 2335711f..e8d2d598 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -283,8 +283,7 @@ pub const MAX_JUMPS = 64; pub const TOPBAR_H: u16 = 1; pub const COLBAR_H: u16 = 1; pub const BOX_H: u16 = 1; -pub const TAG_GAP: u16 = 0; -pub const TAG_TEXT_INSET: u16 = config.GUTTER + TAG_GAP; +pub const TAG_TEXT_INSET: u16 = config.GUTTER; pub fn taglineBandOffset(row: u16, canvas_h: f32, cell_h: u32, tagline_h: u32) u32 { const spare = cell_h -| tagline_h; diff --git a/test/column_drag.zig b/test/column_drag.zig index a089ab4a..f8f6344b 100644 --- a/test/column_drag.zig +++ b/test/column_drag.zig @@ -153,14 +153,6 @@ test "column grip is separate from compact text and the resize seam" { try std.testing.expectEqual(pardes.FontRole.tagline, surface.at(rect.x + pardes.TAG_TEXT_INSET, pardes.TOPBAR_H).style.font_role); try std.testing.expectEqual(pardes.FontRole.tagline, surface.at(rect.x + pardes.TAG_TEXT_INSET, pane_tag_y).style.font_role); } - if (pardes.TAG_GAP > 0) { - const gap_x = p.col_x[1] + config.GUTTER; - try std.testing.expectEqualStrings(" ", p.surface.at(gap_x, pardes.TOPBAR_H).grapheme()); - mouse(p, .press, gap_x); - try std.testing.expect(p.drag != .column_move); - try std.testing.expect(!p.header_drag); - mouse(p, .release, gap_x); - } p.update(.{ .mouse = headerMouse(layer, 0, .press) }); try std.testing.expect(p.drag != .column_move); try std.testing.expect(p.header_drag); diff --git a/test/panes.zig b/test/panes.zig index 5a22e180..b02cf296 100644 --- a/test/panes.zig +++ b/test/panes.zig @@ -117,18 +117,11 @@ const TagLayerTests = struct { _ = try p.render(frame.allocator()); const layer = try findLayer(p, .pane, second); const edge = @as(f32, @floatFromInt(layer.viewport.x)) * 10; - const grip_edge = edge - @as(f32, @floatFromInt(pardes.TAG_GAP)) * 10; - p.update(.{ .mouse = mouse(layer, grip_edge - 0.1, .press) }); + p.update(.{ .mouse = mouse(layer, edge - 0.1, .press) }); try std.testing.expect(p.drag == .move); try std.testing.expectEqual(second, p.drag.move.id); - p.update(.{ .mouse = mouse(layer, grip_edge - 0.1, .release) }); + p.update(.{ .mouse = mouse(layer, edge - 0.1, .release) }); try std.testing.expectEqualStrings(" ", p.surface.at(layer.viewport.x - 1, layer.viewport.y).grapheme()); - if (pardes.TAG_GAP > 0) { - p.update(.{ .mouse = mouse(layer, edge - 0.1, .press) }); - try std.testing.expect(p.drag != .move); - try std.testing.expect(p.panes[second].?.focus == .body); - p.update(.{ .mouse = mouse(layer, edge - 0.1, .release) }); - } p.update(.{ .mouse = mouse(layer, edge + 0.1, .press) }); p.update(.{ .mouse = mouse(layer, edge + 0.1, .release) }); try std.testing.expectEqual(second, p.active); |
