aboutsummaryrefslogtreecommitdiffstats
path: root/sl0ppij/zellij-utils/src/plugin_api/style.rs
diff options
context:
space:
mode:
authoruser <user@clank>2026-08-08 19:49:23 +0200
committeruser <user@clank>2026-08-12 19:34:18 +0200
commit925097bcb9056196709d7fbeae7ab9d4fe3da603 (patch)
treec76e10141d93f885478f98af0d725637714e7a8f /sl0ppij/zellij-utils/src/plugin_api/style.rs
parentsl0p: configurable pane title alignment (diff)
downloadsl0ppi-925097bcb9056196709d7fbeae7ab9d4fe3da603.tar.gz
sl0ppi-925097bcb9056196709d7fbeae7ab9d4fe3da603.tar.xz
sl0ppi-925097bcb9056196709d7fbeae7ab9d4fe3da603.zip
sl0p: configurable pane gap (outer) and padding (inner)
Adds `ui { pane_frames { gap N; padding N } }`, both defaulting to 0 so stock configs are unaffected. gap - cells each pane gives up on every side, leaving real empty terminal between neighbouring panes (WM-style outer gaps). Two adjacent panes therefore show 2*gap between them. padding - cells between a pane's frame and its content; breathing room inside the pane without moving the frame. Design: the pane KEEPS its allocated PaneGeom. Only two things move: 1. the drawn frame, via Viewport::inset(gap), reusing the existing frame_geom_override mechanism already used for stacked panes; 2. the content, via Offset::expanded_by(gap + padding) inside set_content_offset. Because the allocation is untouched, the kasuari resize solver and mouse hit-testing need no changes at all, and a click landing in a gap still resolves to the owning pane. Content position, size and cursor are all derived from content_offset, so widening it in one place keeps every consumer consistent. Viewport::inset refuses to shrink a pane below a frame's minimum viable extent (two borders + one content cell) rather than emitting a degenerate or zero-sized frame. Negative KDL values clamp to 0 instead of wrapping. Tests cover: inset identity/shrink/recentre, the containment invariant (an inset frame never escapes its allocation), small-pane refusal, and the key safety property that content inset by gap+border+padding lands strictly inside the frame drawn at inset(gap).
Diffstat (limited to 'sl0ppij/zellij-utils/src/plugin_api/style.rs')
-rw-r--r--sl0ppij/zellij-utils/src/plugin_api/style.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/sl0ppij/zellij-utils/src/plugin_api/style.rs b/sl0ppij/zellij-utils/src/plugin_api/style.rs
index 2f3ff29..46c3ce8 100644
--- a/sl0ppij/zellij-utils/src/plugin_api/style.rs
+++ b/sl0ppij/zellij-utils/src/plugin_api/style.rs
@@ -26,6 +26,8 @@ impl TryFrom<ProtobufStyle> for Style {
// alignment, and adding a proto field would mean regenerating the
// committed prost assets.
pane_title_alignment: Default::default(),
+ pane_gap: Default::default(),
+ pane_padding: Default::default(),
})
}
}