Skip to content

Commit a4db798

Browse files
committed
fix remote details height
1 parent 0eee47f commit a4db798

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/popups/remotelist.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,14 @@ impl DrawableComponent for RemoteListPopup {
6363
let chunks = Layout::default()
6464
.direction(Direction::Vertical)
6565
.constraints(vec![
66-
Constraint::Percentage(50),
67-
Constraint::Percentage(50),
66+
Constraint::Min(1),
67+
Constraint::Length(1),
68+
Constraint::Length(2),
6869
])
6970
.split(area);
7071
self.draw_remotes_list(f, chunks[0])?;
71-
self.draw_selected_remote_details(f, chunks[1]);
72+
self.draw_separator(f, chunks[1]);
73+
self.draw_selected_remote_details(f, chunks[2]);
7274
}
7375
Ok(())
7476
}
@@ -290,20 +292,17 @@ impl RemoteListPopup {
290292
Ok(())
291293
}
292294

293-
fn draw_selected_remote_details(&self, f: &mut Frame, r: Rect) {
295+
fn draw_separator(&self, f: &mut Frame, r: Rect) {
294296
f.render_widget(
295297
Block::default()
296298
.title(strings::POPUP_SUBTITLE_REMOTES)
297299
.border_type(BorderType::Plain)
298300
.borders(Borders::TOP),
299301
r,
300302
);
303+
}
301304

302-
let area = r.inner(Margin {
303-
vertical: 1,
304-
horizontal: 0,
305-
});
306-
305+
fn draw_selected_remote_details(&self, f: &mut Frame, r: Rect) {
307306
let remote =
308307
self.remote_names.get(usize::from(self.selection));
309308
if let Some(remote) = remote {
@@ -324,7 +323,7 @@ impl RemoteListPopup {
324323
Paragraph::new(Text::from(lines))
325324
.alignment(Alignment::Left)
326325
.wrap(Wrap { trim: true }),
327-
area,
326+
r,
328327
);
329328

330329
let mut r = r;

0 commit comments

Comments
 (0)