From da752535b603a573496e5c0bedbf158a0c2ce0ed Mon Sep 17 00:00:00 2001 From: Zsolt Tasnadi Date: Tue, 12 May 2026 20:32:10 +0200 Subject: [PATCH] modal --- lib/bbs/tui_helpers.rb | 6 ------ lib/bbs/tui_runner.rb | 8 ++++++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/bbs/tui_helpers.rb b/lib/bbs/tui_helpers.rb index b1335ab..9390b1c 100644 --- a/lib/bbs/tui_helpers.rb +++ b/lib/bbs/tui_helpers.rb @@ -179,12 +179,6 @@ module BBS x: CONT_X, y: CONT_Y + cont_h, style: THEME[:label] end - def render_sysinfo_rows - @items.each_with_index do |row, i| - text row[0, cont_w], x: CONT_X, y: CONT_Y + i, style: THEME[:normal] - end - text 'q back', x: CONT_X, y: CONT_Y + cont_h, style: THEME[:label] - end end end end diff --git a/lib/bbs/tui_runner.rb b/lib/bbs/tui_runner.rb index 00e4763..2fc5aaf 100644 --- a/lib/bbs/tui_runner.rb +++ b/lib/bbs/tui_runner.rb @@ -173,6 +173,14 @@ module BBS yield x + 1, y + 1, inner, h - 2 if block_given? end + def float(title: nil, width: 40, height: 20, style: :muted, bg: :black, &block) + w = [[width, term_cols - 4].min, 4].max + h = [[height, term_rows - 4].min, 3].max + x = (term_cols - w) / 2 + 1 + y = (term_rows - h) / 2 + 1 + box(x: x, y: y, w: w, h: h, title: title, style: style, bg: bg, &block) + end + private def resolve_style(style)