Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Rust crate ratatui to 0.28.0 #6267

Merged
merged 3 commits into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 64 additions & 33 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ const_format = "0.2.32"
cookie = "0.18"
criterion = { version = "0.5.1", features = [ "async_tokio" ] }
crossbeam = "0.8"
crossterm = { version = "0.27.0", features = ["event-stream"] }
crossterm = { version = "0.28.1", features = ["event-stream"] }
crucible-agent-client = { git = "https://github.com/oxidecomputer/crucible", rev = "e58ca3693cb9ce0438947beba10e97ee38a0966b" }
crucible-pantry-client = { git = "https://github.com/oxidecomputer/crucible", rev = "e58ca3693cb9ce0438947beba10e97ee38a0966b" }
crucible-smf = { git = "https://github.com/oxidecomputer/crucible", rev = "e58ca3693cb9ce0438947beba10e97ee38a0966b" }
Expand Down Expand Up @@ -477,7 +477,7 @@ rand = "0.8.5"
rand_core = "0.6.4"
rand_distr = "0.4.3"
rand_seeder = "0.3.0"
ratatui = "0.27.0"
ratatui = "0.28.0"
rayon = "1.10"
rcgen = "0.12.1"
reedline = "0.31.0"
Expand Down Expand Up @@ -569,7 +569,7 @@ trust-dns-server = "0.22"
trybuild = "1.0.99"
tufaceous = { path = "tufaceous" }
tufaceous-lib = { path = "tufaceous-lib" }
tui-tree-widget = "0.21.0"
tui-tree-widget = "0.22.0"
typed-rng = { path = "typed-rng" }
unicode-width = "0.1.13"
update-common = { path = "update-common" }
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/omdb/src/bin/omdb/mgs/dashboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,7 @@ fn draw_status(f: &mut Frame, parent: Rect, status: &[(&str, &str)]) {
}

fn draw(f: &mut Frame, dashboard: &mut Dashboard) {
let size = f.size();
let size = f.area();

let screen = Layout::default()
.direction(Direction::Vertical)
Expand Down
2 changes: 1 addition & 1 deletion wicket/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl RunnerCore {
/// Resize and draw the initial screen before handling `Event`s
pub fn init_screen(&mut self) -> anyhow::Result<()> {
// Size the initial screen
let rect = self.terminal.get_frame().size();
let rect = self.terminal.get_frame().area();
self.screen.resize(&mut self.state, rect.width, rect.height);

// Draw the initial screen
Expand Down
4 changes: 2 additions & 2 deletions wicket/src/ui/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl MainScreen {
terminal: &mut Term,
) -> anyhow::Result<()> {
terminal.draw(|frame| {
let mut rect = frame.size();
let mut rect = frame.area();

rect.height -= 1;
let statusbar_rect = Rect {
Expand All @@ -85,7 +85,7 @@ impl MainScreen {

// Draw all the components, starting with the background
let background = Block::default().style(style::background());
frame.render_widget(background, frame.size());
frame.render_widget(background, frame.area());
self.sidebar.draw(state, frame, chunks[0], self.sidebar.active);
self.draw_pane(state, frame, chunks[1]);
self.draw_statusbar(state, frame, statusbar_rect);
Expand Down
4 changes: 2 additions & 2 deletions wicket/src/ui/splash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ impl SplashScreen {

fn draw_background(&self, f: &mut Frame) {
let block = Block::default().style(style::background());
f.render_widget(block, f.size());
f.render_widget(block, f.area());
}

// Sweep left to right, painting the banner white, with
// the x painted green.
fn animate_logo(&self, f: &mut Frame) {
// Center the banner
let rect = f
.size()
.area()
.center_horizontally(LOGO_WIDTH)
.center_vertically(LOGO_HEIGHT);

Expand Down
2 changes: 1 addition & 1 deletion wicket/src/ui/widgets/animated_logo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl<'a> Widget for Logo<'a> {
for (x, c) in line.chars().enumerate() {
if c == '#' {
let cell = buf
.get_mut(x as u16 + area.left(), y as u16 + area.top())
[(x as u16 + area.left(), y as u16 + area.top())]
.set_symbol(" ");
if x < paint_point {
// The cell is highlighted
Expand Down
8 changes: 4 additions & 4 deletions wicket/src/ui/widgets/box_connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ impl Widget for BoxConnector {
if self.kind == BoxConnectorKind::Top
|| self.kind == BoxConnectorKind::Both
{
buf.get_mut(rect.x, rect.y - 1).set_symbol("├");
buf.get_mut(rect.x + rect.width - 1, rect.y - 1).set_symbol("┤");
buf[(rect.x, rect.y - 1)].set_symbol("├");
buf[(rect.x + rect.width - 1, rect.y - 1)].set_symbol("┤");
}

if self.kind == BoxConnectorKind::Bottom
|| self.kind == BoxConnectorKind::Both
{
buf.get_mut(rect.x, rect.y + rect.height).set_symbol("├");
buf.get_mut(rect.x + rect.width - 1, rect.y + rect.height)
buf[(rect.x, rect.y + rect.height)].set_symbol("├");
buf[(rect.x + rect.width - 1, rect.y + rect.height)]
.set_symbol("┤");
}
}
Expand Down
6 changes: 3 additions & 3 deletions wicket/src/ui/widgets/rack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl<'a> Rack<'a> {
// TODO: Draw 10 only? - That may not scale down as well
for x in inner.left()..inner.right() {
for y in inner.top()..inner.bottom() {
let cell = buf.get_mut(x, y).set_symbol("▕");
let cell = buf[(x, y)].set_symbol("▕");
if self.state.selected == component_id {
if let Some(KnightRiderMode { count }) =
self.state.knight_rider_mode
Expand Down Expand Up @@ -118,7 +118,7 @@ impl<'a> Rack<'a> {
if presence == ComponentPresence::Present {
for x in inner.left()..inner.right() {
for y in inner.top()..inner.bottom() {
buf.get_mut(x, y).set_symbol("❒");
buf[(x, y)].set_symbol("❒");
}
}
}
Expand Down Expand Up @@ -156,7 +156,7 @@ impl<'a> Rack<'a> {
for x in inner.left() + border..inner.right() - border {
for y in inner.top()..inner.bottom() {
if x % step != 0 {
buf.get_mut(x, y).set_symbol("█");
buf[(x, y)].set_symbol("█");
}
}
}
Expand Down
Loading
Loading