diff options
| author | user <user@clank> | 2026-08-08 19:49:23 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-08-08 19:49:23 +0200 |
| commit | 30782cbb2fab4e01cadb9815927a404591472064 (patch) | |
| tree | 29bdd07fc0c56c7ec38b1238066f1ae0ee6e53c5 /zellij-utils/src/plugin_api | |
| parent | sl0p: configurable pane title alignment (diff) | |
| download | sl0ppij-30782cbb2fab4e01cadb9815927a404591472064.tar.gz sl0ppij-30782cbb2fab4e01cadb9815927a404591472064.tar.xz sl0ppij-30782cbb2fab4e01cadb9815927a404591472064.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 'zellij-utils/src/plugin_api')
| -rw-r--r-- | zellij-utils/src/plugin_api/event.rs | 2 | ||||
| -rw-r--r-- | zellij-utils/src/plugin_api/style.rs | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/zellij-utils/src/plugin_api/event.rs b/zellij-utils/src/plugin_api/event.rs index 0189d11b..f4bb3523 100644 --- a/zellij-utils/src/plugin_api/event.rs +++ b/zellij-utils/src/plugin_api/event.rs @@ -2493,6 +2493,8 @@ fn serialize_mode_update_event_with_non_default_values() { rounded_corners: true, hide_session_name: false, pane_title_alignment: Default::default(), + pane_gap: Default::default(), + pane_padding: Default::default(), }, capabilities: PluginCapabilities { arrow_fonts: false }, session_name: Some("my awesome test session".to_owned()), diff --git a/zellij-utils/src/plugin_api/style.rs b/zellij-utils/src/plugin_api/style.rs index 2f3ff298..46c3ce83 100644 --- a/zellij-utils/src/plugin_api/style.rs +++ b/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(), }) } } |
