Skip to content

Commit

Permalink
Merge pull request #4 from tranzystorek-io/ratatui-switch
Browse files Browse the repository at this point in the history
Switch tui dependency to ratatui
  • Loading branch information
LeoRiether committed May 15, 2023
2 parents 64f7e56 + fd5e69d commit aae141a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 20 deletions.
32 changes: 16 additions & 16 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 @@ -30,8 +30,8 @@ default = ["clip"]
clip = ["clipboard"]

[dependencies]
tui = "0.19"
crossterm = "0.25"
tui = { version = "0.20", package = "ratatui" }
crossterm = "0.26"

# libmpv isn't working for mpv v0.35 :(
# So I'm using a fork :)
Expand Down
4 changes: 3 additions & 1 deletion src/app/app_screen/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::rc::Rc;

use crate::{command, error::Result, events, util::RectContains};

mod now_playing;
Expand Down Expand Up @@ -94,7 +96,7 @@ impl<'a> AppScreen<'a> {
Ok(())
}

fn subcomponent_chunks(&self, frame: Rect) -> Vec<Rect> {
fn subcomponent_chunks(&self, frame: Rect) -> Rc<[Rect]> {
Layout::default()
.direction(Direction::Vertical)
.constraints([Constraint::Min(20), Constraint::Length(2)].as_ref())
Expand Down
3 changes: 2 additions & 1 deletion src/app/browse_screen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use crate::{

use crossterm::event::{KeyCode, MouseEvent, MouseEventKind};

use std::rc::Rc;
use std::borrow::Cow;
use tui::layout::Rect;
use tui::style::Color;
Expand Down Expand Up @@ -358,7 +359,7 @@ impl<'a> BrowseScreen<'a> {
}
}

fn subcomponent_chunks(&self, chunk: Rect) -> Vec<Rect> {
fn subcomponent_chunks(&self, chunk: Rect) -> Rc<[Rect]> {
Layout::default()
.direction(Direction::Horizontal)
.constraints([Constraint::Percentage(15), Constraint::Percentage(85)].as_ref())
Expand Down

0 comments on commit aae141a

Please sign in to comment.