Skip to content

Commit d45c07e

Browse files
committed
Fix modal close button highlighting
- Re-render button after modal border to ensure visibility - Close button now properly displays with yellow background - Maintains all modal interaction blocking functionality
1 parent 2b07e01 commit d45c07e

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

src/ui/modal.rs

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,17 @@ pub fn render_modal(app: &App, frame: &mut Frame, area: Rect) {
157157
1,
158158
);
159159

160+
// Render the close button background first
161+
let button_background = Block::default()
162+
.style(Style::default().bg(Color::Yellow));
163+
frame.render_widget(button_background, button_area);
164+
165+
// Then render the text on top
160166
let close_button = Paragraph::new("[ Close ]")
161167
.style(Style::default()
162168
.fg(Color::Black)
163-
.bg(Color::Yellow)) // Highlighted button
164-
.alignment(Alignment::Center)
165-
.block(Block::default()
166-
.style(Style::default()
167-
.fg(Color::Black)
168-
.bg(Color::Yellow)));
169+
.bg(Color::Yellow))
170+
.alignment(Alignment::Center);
169171

170172
frame.render_widget(close_button, button_area);
171173

@@ -177,4 +179,16 @@ pub fn render_modal(app: &App, frame: &mut Frame, area: Rect) {
177179
.fg(Color::White)
178180
.bg(Color::Black)); // Solid black background
179181
frame.render_widget(modal_block, modal_area);
182+
183+
// Re-render the button after the border to ensure it's visible
184+
let button_background = Block::default()
185+
.style(Style::default().bg(Color::Yellow));
186+
frame.render_widget(button_background, button_area);
187+
188+
let close_button = Paragraph::new("[ Close ]")
189+
.style(Style::default()
190+
.fg(Color::Black)
191+
.bg(Color::Yellow))
192+
.alignment(Alignment::Center);
193+
frame.render_widget(close_button, button_area);
180194
}

0 commit comments

Comments
 (0)