From 54ee9a486cb176221dc427c84a9eb071b713a02f Mon Sep 17 00:00:00 2001 From: Salman Farooq Date: Mon, 22 Jun 2026 11:46:19 +0500 Subject: [PATCH] Make overlays fullscreen under minimum screen size (#12311) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add cursorcolumn and cursorline to base16_transparent theme * remove-margins-from-overlay * remove-bottom-clip * cleanup-and-comments * typo-correction * slightly-adjust-comment-wording * ui/picker.rs: remove a comment * undo-picker-preview-ratio-change * undo-fullscreen-without-status-line-and-bring-back-old-code * make-overlaid-content-conditionally-take-all-the-space * Apply suggestion from @archseer --------- Co-authored-by: Blaž Hrastnik --- helix-term/src/ui/overlay.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/helix-term/src/ui/overlay.rs b/helix-term/src/ui/overlay.rs index ff184d40..fa409a87 100644 --- a/helix-term/src/ui/overlay.rs +++ b/helix-term/src/ui/overlay.rs @@ -7,6 +7,8 @@ use tui::buffer::Buffer; use crate::compositor::{Component, Context, Event, EventResult}; +pub const FULL_OVERLAID_MAX_WIDTH: u16 = 200; + /// Contains a component placed in the center of the parent component pub struct Overlay { /// Child component @@ -19,7 +21,14 @@ pub struct Overlay { pub fn overlaid(content: T) -> Overlay { Overlay { content, - calc_child_size: Box::new(|rect: Rect| clip_rect_relative(rect.clip_bottom(2), 90, 90)), + calc_child_size: Box::new(|rect: Rect| { + let percentage = if rect.width < FULL_OVERLAID_MAX_WIDTH { + 100 + } else { + 90 + }; + clip_rect_relative(rect.clip_bottom(2), percentage, percentage) + }), } } -- 2.51.2