Skip to content

Commit

Permalink
Merge pull request #96 from jacek-kurlit/chore-update-ratatui
Browse files Browse the repository at this point in the history
updated ratatui and tui-textarea
  • Loading branch information
jacek-kurlit authored Nov 9, 2024
2 parents 030610b + 4c31ac8 commit 601a643
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 24 deletions.
32 changes: 22 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ repository = "https://github.com/jacek-kurlit/pik"

[dependencies]
crossterm = "0.28"
ratatui = "0.28"
tui-textarea = "0.6"
ratatui = "0.29"
tui-textarea = "0.7"
anyhow = "1.0.79"
sysinfo = "0.32"
listeners = "0.2.1"
Expand Down
18 changes: 6 additions & 12 deletions src/tui/rendering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ use std::{borrow::Cow, rc::Rc};

use crossterm::event::KeyEvent;
use ratatui::{
layout::{Alignment, Constraint, Layout, Margin, Rect},
layout::{Constraint, Layout, Margin, Rect},
style::{palette::tailwind, Color, Modifier, Style, Stylize},
text::{Line, Span, Text},
widgets::{
block::{Position, Title},
Block, BorderType, Borders, HighlightSpacing, Paragraph, Row, Scrollbar,
ScrollbarOrientation, ScrollbarState, Table, TableState, Wrap,
},
Expand Down Expand Up @@ -228,20 +227,19 @@ impl Tui {
]))
.block(
Block::default()
.title(
Title::from(format!(
.title_top(
Line::from(format!(
" {} / {} ",
self.process_table.selected().map(|i| i + 1).unwrap_or(0),
search_results.len()
))
.position(Position::Top)
.alignment(Alignment::Left),
.left_aligned(),
)
.borders(Borders::ALL)
.border_style(Style::new().fg(self.theme.process_table_border_color))
.border_type(BorderType::Plain),
)
.highlight_style(
.row_highlight_style(
Style::default()
.add_modifier(Modifier::REVERSED)
.fg(self.theme.selected_style_fg),
Expand Down Expand Up @@ -279,11 +277,7 @@ impl Tui {
.block(
Block::default()
.borders(Borders::ALL)
.title(
Title::from(" Process Details ")
.alignment(Alignment::Left)
.position(Position::Top),
)
.title_top(Line::from(" Process Details ").left_aligned())
// .border_style(Style::new().fg(app.colors.footer_border_color))
.border_type(BorderType::Rounded),
)
Expand Down

0 comments on commit 601a643

Please # to comment.