summaryrefslogtreecommitdiff
path: root/src/mouse.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/mouse.zig')
-rw-r--r--src/mouse.zig12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mouse.zig b/src/mouse.zig
index 5c315b4e..365ed560 100644
--- a/src/mouse.zig
+++ b/src/mouse.zig
@@ -103,7 +103,7 @@ fn headerPoint(p: *Pardes, column: ?usize, mcol: u16, mrow: u16, clamp: bool) ?s
const focused = p.header_focus and p.header_column == column;
const text = edit.flatSurface(p, t) catch return null;
const base = if (column != null) p.topBarHeight() else 0;
- const rows = if (column != null) p.columnBarHeight() else p.topBarHeight();
+ const rows = if (column != null) layout.columnBarHeight(p) else p.topBarHeight();
const row: u16 = if (clamp) @min(mrow -| base, rows -| 1) else mrow -| base;
const top: usize = if (focused) p.header_top else 0;
const lines = modal.lineCount(text);
@@ -230,7 +230,7 @@ pub const ChromeTarget = struct { col: u16, row: u16 };
/// on the cell, a pane's grip, a column's handle or a seam; then a cell
/// away, any of a pane's tag, a handle or a seam.
pub fn chromeTarget(p: *const Pardes, col: u16, row: u16) ?ChromeTarget {
- if (row < p.topBarHeight() + p.columnBarHeight()) return .{ .col = col, .row = row };
+ if (row < p.topBarHeight() + layout.columnBarHeight(p)) return .{ .col = col, .row = row };
for ([_]u16{ 0, 1 }) |slack| {
for (p.panes, 0..) |slot, id| {
const pane = slot orelse continue;
@@ -510,7 +510,7 @@ pub fn handleMouse(p: *Pardes, event: Mouse) void {
const previous_hit = p.pointer_body_hit;
p.pointer_body_hit = m.body_hit;
const previous_tag_hit = p.pointer_tag_hit;
- p.pointer_tag_hit = if (m.tag_hit) |point| p.reprojectTagHit(point) else null;
+ p.pointer_tag_hit = if (m.tag_hit) |point| layout.reprojectTagHit(p, point) else null;
if (m.tag_hit != null and p.pointer_tag_hit == null and m.kind == .press) return;
if (m.tag_hit == null and (m.kind == .drag or m.kind == .release) and (p.drag == .select or p.header_drag or p.header_sweep != null)) {
if (previous_tag_hit) |previous| {
@@ -592,7 +592,7 @@ pub fn handleMouse(p: *Pardes, event: Mouse) void {
return;
}
}
- if (mrow >= p.topBarHeight() and mrow < p.topBarHeight() + p.columnBarHeight() and m.kind == .press) {
+ if (mrow >= p.topBarHeight() and mrow < p.topBarHeight() + layout.columnBarHeight(p) and m.kind == .press) {
for (0..p.ncol) |column| {
if (mcol < p.col_x[column] or mcol >= p.col_x[column] + @min(config.GUTTER, p.col_w[column])) continue;
if (m.button == config.select_button) {
@@ -617,7 +617,7 @@ pub fn handleMouse(p: *Pardes, event: Mouse) void {
if (m.kind == .release) p.header_drag = false;
return;
}
- if (mrow < p.topBarHeight() + p.columnBarHeight() and m.kind == .press and
+ if (mrow < p.topBarHeight() + layout.columnBarHeight(p) and m.kind == .press and
(m.button == config.select_button or m.button == config.exec_button or m.button == config.look_button))
{
if (m.button == config.select_button) if (p.panes[p.active]) |pane| {
@@ -777,7 +777,7 @@ pub fn handleMouse(p: *Pardes, event: Mouse) void {
const on_tag = mrow >= tag_y and mrow < tag_y + pane.tag_rows;
if (on_tag and mcol < r.x + TAG_TEXT_INSET) return;
p.active = id;
- p.noteTyped(); // acme's button 1 sets activecol (acme.c:659)
+ layout.noteTyped(p); // acme's button 1 sets activecol (acme.c:659)
pane.closePrompt();
const pointed = edit.pointerTextSelection(p, id, mcol, mrow, m.body_hit, p.pointer_tag_hit) orelse return;
pane.clearPointerSelection(sel_slot);