Skip to content

Commit

Permalink
Updated to ratatui 0.27.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus-Mussmaecher committed Jun 28, 2024
1 parent f81707a commit 609f93e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
[dependencies]
# General TUI
crossterm = "0.27.0"
ratatui = {version = "=0.26.3", features = ["serde"]}
ratatui = {version = "^0.27", features = ["serde"]}
tui-textarea = "^0.4"
# Command line parsing
clap = {version = "^4.5", features = ["derive"]}
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ You should have received a copy of the GNU General Public License along with thi
/// Temporary screen while the programm is indexing.
fn draw_loading_screen(
terminal: &mut Terminal<impl ratatui::backend::Backend>,
) -> Result<CompletedFrame, std::io::Error> {
) -> Result<ratatui::CompletedFrame, std::io::Error> {
// Draw 'loading' screen
terminal.draw(|frame| {
frame.render_widget(
Expand Down
5 changes: 4 additions & 1 deletion src/ui/screen/display_screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ impl super::Screen for DisplayScreen {

let stats = self.note.to_stats_table(&self.styles).block(
Block::bordered()
.title("Statistics".set_style(self.styles.title_style))
.title(style::Styled::set_style(
"Statistics",
self.styles.title_style,
))
.title(instructions_bot_right),
);

Expand Down
23 changes: 16 additions & 7 deletions src/ui/screen/select_screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -572,15 +572,21 @@ impl super::Screen for SelectScreen {
let [global_stats_area, local_stats_area, filter_area, table_area] = vertical.areas(area);

// Generate stats areas
let global_stats = self
.global_stats
.to_global_stats_table(&self.styles)
.block(Block::bordered().title("Global Statistics".set_style(self.styles.title_style)));
let global_stats =
self.global_stats
.to_global_stats_table(&self.styles)
.block(Block::bordered().title(style::Styled::set_style(
"Global Statistics",
self.styles.title_style,
)));

let local_stats = self
.local_stats
.to_local_stats_table(&self.global_stats, &self.styles)
.block(Block::bordered().title("Local Statistics".set_style(self.styles.title_style)));
.block(Block::bordered().title(style::Styled::set_style(
"Local Statistics",
self.styles.title_style,
)));

// === Filter area ===

Expand Down Expand Up @@ -696,7 +702,7 @@ impl super::Screen for SelectScreen {
// Add Instructions and a title
.block(
Block::bordered()
.title("Notes".set_style(self.styles.title_style))
.title(style::Styled::set_style("Notes", self.styles.title_style))
.title(instructions_bot_left)
.title(instructions_bot_right),
);
Expand Down Expand Up @@ -844,7 +850,10 @@ impl super::Screen for SelectScreen {

let help_table = Table::new(help_rows, help_widths).column_spacing(1).block(
Block::bordered()
.title("Filter Syntax".set_style(self.styles.title_style))
.title(style::Styled::set_style(
"Filter Syntax",
self.styles.title_style,
))
.title(
block::Title::from(Line::from(vec![
Span::styled("C", self.styles.hotkey_style),
Expand Down

0 comments on commit 609f93e

Please # to comment.