mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-07-25 14:44:39 +02:00
deps: migrate from tui to ratatui (#1086)
This commit is contained in:
parent
8c6ae3bbc7
commit
6ea3635b28
46
Cargo.lock
generated
46
Cargo.lock
generated
@ -117,7 +117,7 @@ dependencies = [
|
|||||||
"concat-string",
|
"concat-string",
|
||||||
"const_format",
|
"const_format",
|
||||||
"core-foundation",
|
"core-foundation",
|
||||||
"crossterm 0.26.1",
|
"crossterm",
|
||||||
"ctrlc",
|
"ctrlc",
|
||||||
"dirs",
|
"dirs",
|
||||||
"fern",
|
"fern",
|
||||||
@ -135,6 +135,7 @@ dependencies = [
|
|||||||
"once_cell",
|
"once_cell",
|
||||||
"predicates",
|
"predicates",
|
||||||
"procfs",
|
"procfs",
|
||||||
|
"ratatui",
|
||||||
"regex",
|
"regex",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
@ -144,7 +145,6 @@ dependencies = [
|
|||||||
"thiserror",
|
"thiserror",
|
||||||
"time",
|
"time",
|
||||||
"toml_edit",
|
"toml_edit",
|
||||||
"tui",
|
|
||||||
"typed-builder",
|
"typed-builder",
|
||||||
"unicode-segmentation",
|
"unicode-segmentation",
|
||||||
"unicode-width",
|
"unicode-width",
|
||||||
@ -325,22 +325,6 @@ dependencies = [
|
|||||||
"lazy_static",
|
"lazy_static",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "crossterm"
|
|
||||||
version = "0.25.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "e64e6c0fbe2c17357405f7c758c1ef960fce08bdfb2c03d88d2a18d7e09c4b67"
|
|
||||||
dependencies = [
|
|
||||||
"bitflags",
|
|
||||||
"crossterm_winapi",
|
|
||||||
"libc",
|
|
||||||
"mio",
|
|
||||||
"parking_lot",
|
|
||||||
"signal-hook",
|
|
||||||
"signal-hook-mio",
|
|
||||||
"winapi",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "crossterm"
|
name = "crossterm"
|
||||||
version = "0.26.1"
|
version = "0.26.1"
|
||||||
@ -909,6 +893,19 @@ dependencies = [
|
|||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ratatui"
|
||||||
|
version = "0.20.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "dcc0d032bccba900ee32151ec0265667535c230169f5a011154cdcd984e16829"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags",
|
||||||
|
"cassowary",
|
||||||
|
"crossterm",
|
||||||
|
"unicode-segmentation",
|
||||||
|
"unicode-width",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rayon"
|
name = "rayon"
|
||||||
version = "1.5.2"
|
version = "1.5.2"
|
||||||
@ -1288,19 +1285,6 @@ dependencies = [
|
|||||||
"winnow",
|
"winnow",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "tui"
|
|
||||||
version = "0.19.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "ccdd26cbd674007e649a272da4475fb666d3aa0ad0531da7136db6fab0e5bad1"
|
|
||||||
dependencies = [
|
|
||||||
"bitflags",
|
|
||||||
"cassowary",
|
|
||||||
"crossterm 0.25.0",
|
|
||||||
"unicode-segmentation",
|
|
||||||
"unicode-width",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "typed-builder"
|
name = "typed-builder"
|
||||||
version = "0.14.0"
|
version = "0.14.0"
|
||||||
|
@ -99,7 +99,7 @@ sysinfo = "0.28.4"
|
|||||||
thiserror = "1.0.40"
|
thiserror = "1.0.40"
|
||||||
time = { version = "0.3.20", features = ["formatting", "macros"] }
|
time = { version = "0.3.20", features = ["formatting", "macros"] }
|
||||||
toml_edit = { version = "0.19.8", features = ["serde"] }
|
toml_edit = { version = "0.19.8", features = ["serde"] }
|
||||||
tui = "0.19.0"
|
tui = { version = "0.20.1", package = "ratatui" }
|
||||||
typed-builder = "0.14.0"
|
typed-builder = "0.14.0"
|
||||||
unicode-segmentation = "1.10.1"
|
unicode-segmentation = "1.10.1"
|
||||||
unicode-width = "0.1.10"
|
unicode-width = "0.1.10"
|
||||||
|
@ -345,8 +345,8 @@ impl Painter {
|
|||||||
})
|
})
|
||||||
.collect::<Vec<(u16, u16, u16, u16, usize)>>();
|
.collect::<Vec<(u16, u16, u16, u16, usize)>>();
|
||||||
|
|
||||||
for (btn, pos) in buttons.into_iter().zip(layout.into_iter()) {
|
for (btn, pos) in buttons.into_iter().zip(layout.iter()) {
|
||||||
f.render_widget(Paragraph::new(btn).alignment(Alignment::Left), pos);
|
f.render_widget(Paragraph::new(btn).alignment(Alignment::Left), *pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ impl Painter {
|
|||||||
|
|
||||||
let num_entries = cpu_data.len();
|
let num_entries = cpu_data.len();
|
||||||
let mut row_counter = num_entries;
|
let mut row_counter = num_entries;
|
||||||
for (itx, column) in columns.into_iter().enumerate() {
|
for (itx, column) in columns.iter().enumerate() {
|
||||||
if REQUIRED_COLUMNS > itx {
|
if REQUIRED_COLUMNS > itx {
|
||||||
let to_divide = REQUIRED_COLUMNS - itx;
|
let to_divide = REQUIRED_COLUMNS - itx;
|
||||||
let num_taken = min(
|
let num_taken = min(
|
||||||
@ -106,9 +106,11 @@ impl Painter {
|
|||||||
.direction(Direction::Vertical)
|
.direction(Direction::Vertical)
|
||||||
.constraints(vec![Constraint::Length(1); remaining_height])
|
.constraints(vec![Constraint::Length(1); remaining_height])
|
||||||
.horizontal_margin(1)
|
.horizontal_margin(1)
|
||||||
.split(column);
|
.split(*column);
|
||||||
|
|
||||||
for ((start_label, inner_label, ratio, style), row) in chunk.zip(rows) {
|
for ((start_label, inner_label, ratio, style), row) in
|
||||||
|
chunk.zip(rows.iter())
|
||||||
|
{
|
||||||
f.render_widget(
|
f.render_widget(
|
||||||
PipeGauge::default()
|
PipeGauge::default()
|
||||||
.gauge_style(style)
|
.gauge_style(style)
|
||||||
@ -117,7 +119,7 @@ impl Painter {
|
|||||||
.start_label(start_label)
|
.start_label(start_label)
|
||||||
.ratio(ratio)
|
.ratio(ratio)
|
||||||
.hide_parts(hide_parts),
|
.hide_parts(hide_parts),
|
||||||
row,
|
*row,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user