Skip to content

Commit 4ea8124

Browse files
author
Stephan Dilly
committed
thick borders on popups
1 parent 17f6f33 commit 4ea8124

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

src/components/help.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use tui::{
1212
backend::Backend,
1313
layout::{Alignment, Constraint, Direction, Layout, Rect},
1414
style::{Modifier, Style},
15-
widgets::{Block, Borders, Clear, Paragraph, Text},
15+
widgets::{Block, Borders, Clear, Paragraph, Text, BorderType},
1616
Frame,
1717
};
1818

@@ -45,7 +45,8 @@ impl DrawableComponent for HelpComponent {
4545
f.render_widget(
4646
Block::default()
4747
.title(strings::HELP_TITLE)
48-
.borders(Borders::ALL),
48+
.borders(Borders::ALL)
49+
.border_type(BorderType::Thick),
4950
area,
5051
);
5152

src/components/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use tui::{
3030
backend::Backend,
3131
layout::Alignment,
3232
layout::Rect,
33-
widgets::{Block, Borders, Paragraph, Text},
33+
widgets::{Block, BorderType, Borders, Paragraph, Text},
3434
Frame,
3535
};
3636

src/components/msg.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use strings::commands;
99
use tui::{
1010
backend::Backend,
1111
layout::{Alignment, Rect},
12-
widgets::{Block, Borders, Clear, Paragraph, Text},
12+
widgets::{Block, BorderType, Borders, Clear, Paragraph, Text},
1313
Frame,
1414
};
1515
use ui::style::Theme;
@@ -41,7 +41,8 @@ impl DrawableComponent for MsgComponent {
4141
Block::default()
4242
.title(strings::MSG_TITLE_ERROR)
4343
.title_style(self.theme.text_danger())
44-
.borders(Borders::ALL),
44+
.borders(Borders::ALL)
45+
.border_type(BorderType::Thick),
4546
)
4647
.alignment(Alignment::Left)
4748
.wrap(true),

src/components/textinput.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,16 @@ use super::{
22
visibility_blocking, CommandBlocking, CommandInfo, Component,
33
DrawableComponent,
44
};
5-
use crate::{
6-
components::dialog_paragraph, strings, ui, ui::style::Theme,
7-
};
5+
use crate::{strings, ui, ui::style::Theme};
86
use anyhow::Result;
97
use crossterm::event::{Event, KeyCode};
108
use std::borrow::Cow;
119
use strings::commands;
1210
use tui::{
1311
backend::Backend,
14-
layout::Rect,
12+
layout::{Alignment, Rect},
1513
style::Style,
16-
widgets::{Clear, Text},
14+
widgets::{Block, BorderType, Borders, Clear, Paragraph, Text},
1715
Frame,
1816
};
1917

@@ -75,7 +73,14 @@ impl DrawableComponent for TextInputComponent {
7573
let area = ui::centered_rect(60, 20, f.size());
7674
f.render_widget(Clear, area);
7775
f.render_widget(
78-
dialog_paragraph(self.title.as_str(), txt.iter()),
76+
Paragraph::new(txt.iter())
77+
.block(
78+
Block::default()
79+
.title(self.title.as_str())
80+
.borders(Borders::ALL)
81+
.border_type(BorderType::Thick),
82+
)
83+
.alignment(Alignment::Left),
7984
area,
8085
);
8186
}

0 commit comments

Comments
 (0)