diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-16 22:17:47 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-16 22:32:11 -0300 |
| commit | 266515537a917154ef4736a1d6b1cc97be23fced (patch) | |
| tree | 9e0a10c3abd0c8911182c8b071f692e0b09a9310 /src/layout.zig | |
| parent | fc38c73c59f7855a4caad8aa4d3bb8e023309c13 (diff) | |
| download | pardes-266515537a917154ef4736a1d6b1cc97be23fced.tar.gz pardes-266515537a917154ef4736a1d6b1cc97be23fced.zip | |
mouse: no drag guides, and columns resize by their grips alone
A drag draws no guide lines: the dashes where a pane or column would land, the carried column's rail and the held seam's dashes are gone, with the guide region kind, Surface.overlayDash, the rail's Region.clip and MAX_GUIDES; the gui's floating draw group is the debug box's alone.
The line between two columns is no resize handle: Drag.border_v and its corner variant are gone, with clampBorderCol and the unused chromeTarget. A press there is a press in the pane under it (a sweep). A column resizes by its grip, a pane by its grip or, in a window, the rule above it (border_h, unchanged).
Tests: the corner and border-drag unit tests and the cornerdrag and cornerdrag-left tty cases are deleted; windowops loses its border drag and tagalign2col widens its column by the grip; colgrip, shrinktag and windowops goldens drop the guides; a unit test pins that a press on the line between columns sweeps and resizes nothing. The cheatsheet, themes, render-pipeline notes and changelog say so.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/layout.zig')
| -rw-r--r-- | src/layout.zig | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/layout.zig b/src/layout.zig index fca4c846..0cfbf04a 100644 --- a/src/layout.zig +++ b/src/layout.zig @@ -180,8 +180,8 @@ pub fn columnDrop(p: *const Pardes, source: usize, x: u16, grab: u16) ColumnDrop } /// Share out the width of columns `left` and `left + 1` so the left one is -/// `left_width` cells, neither below MINW. A border drag and a column grip -/// dropped inside its own place both end here. +/// `left_width` cells, neither below MINW. A column grip dropped inside its +/// own place ends here. pub fn setColumnPairWidth(p: *Pardes, left: usize, left_width: u64) void { const v = p.view(); if (left + 1 >= v.ncol) return; @@ -2099,15 +2099,7 @@ test "repeated non-dyadic column splits preserve every unrelated boundary" { try std.testing.expect(splitColumn(p, 0, 1, false)); p.sync(); - const handle = p.view().col_x[0] + p.view().col_w[0] - 1; - const untouched = weightsOf(p); - p.update(.{ .mouse = .{ .button = .left, .kind = .press, .col = handle, .row = TOPBAR_H + 1 } }); - p.update(.{ .mouse = .{ .button = .left, .kind = .release, .col = handle, .row = TOPBAR_H + 1 } }); - try std.testing.expectEqual(untouched, weightsOf(p)); - - p.update(.{ .mouse = .{ .button = .left, .kind = .press, .col = handle, .row = TOPBAR_H + 1 } }); - p.update(.{ .mouse = .{ .button = .left, .kind = .drag, .col = 417, .row = TOPBAR_H + 1 } }); - p.update(.{ .mouse = .{ .button = .left, .kind = .release, .col = 417, .row = TOPBAR_H + 1 } }); + setColumnPairWidth(p, 0, 418); p.sync(); try std.testing.expectEqual(@as(u16, 418), p.view().rects[0].w); |
