Skip to content

Commit 2c83beb

Browse files
authored
Remove legacy alias for ratatui (#680)
Update usages of `tui` to `ratatui` and remove the legacy alias. Also update the readme, which points to the former.
1 parent 78edb10 commit 2c83beb

File tree

10 files changed

+16
-16
lines changed

10 files changed

+16
-16
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,4 +424,4 @@ The application stores logs inside the `$APP_CACHE_FOLDER/spotify-player-*.log`
424424

425425
## Acknowledgement
426426

427-
`spotify_player` is written in [Rust](https://www.rust-lang.org) and is built on top of awesome libraries such as [tui-rs](https://github.com/fdehau/tui-rs), [rspotify](https://github.com/ramsayleung/rspotify), [librespot](https://github.com/librespot-org/librespot), and [many more](spotify_player/Cargo.toml). It's highly inspired by [spotify-tui](https://github.com/Rigellute/spotify-tui) and [ncspot](https://github.com/hrkfdn/ncspot).
427+
`spotify_player` is written in [Rust](https://www.rust-lang.org) and is built on top of awesome libraries such as [ratatui](https://github.com/ratatui/ratatui), [rspotify](https://github.com/ramsayleung/rspotify), [librespot](https://github.com/librespot-org/librespot), and [many more](spotify_player/Cargo.toml). It's highly inspired by [spotify-tui](https://github.com/Rigellute/spotify-tui) and [ncspot](https://github.com/hrkfdn/ncspot).

spotify_player/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2021"
66
license = "MIT"
77
description = "A Spotify player in the terminal with full feature parity"
88
repository = "https://github.com/aome510/spotify-player"
9-
keywords = ["spotify", "tui", "player"]
9+
keywords = ["spotify", "tui", "ratatui", "player"]
1010
readme = "../README.md"
1111

1212
[dependencies]
@@ -32,7 +32,7 @@ tokio = { version = "1.41.1", features = [
3232
"time",
3333
] }
3434
toml = "0.8.19"
35-
tui = { package = "ratatui", version = "0.29.0" }
35+
ratatui = { version = "0.29.0" }
3636
rand = "0.8.5"
3737
maybe-async = "0.2.10"
3838
async-trait = "0.1.83"

spotify_player/src/config/theme.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::str::FromStr;
22

33
use anyhow::Result;
44
use serde::Deserialize;
5-
use tui::style;
5+
use ratatui::style;
66

77
#[derive(Clone, Debug, Deserialize)]
88
/// Application theme configurations.

spotify_player/src/event/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use crate::utils::map_join;
2323
use anyhow::{Context as _, Result};
2424

2525
use clipboard::{execute_copy_command, get_clipboard_content};
26-
use tui::widgets::ListState;
26+
use ratatui::widgets::ListState;
2727

2828
mod clipboard;
2929
mod page;

spotify_player/src/state/ui/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub use popup::*;
1818
#[cfg(feature = "image")]
1919
pub struct ImageRenderInfo {
2020
pub url: String,
21-
pub render_area: tui::layout::Rect,
21+
pub render_area: ratatui::layout::Rect,
2222
/// indicates if the image is rendered
2323
pub rendered: bool,
2424
}
@@ -36,7 +36,7 @@ pub struct UIState {
3636

3737
/// The rectangle representing the playback progress bar,
3838
/// which is mainly used to handle mouse click events (for seeking command)
39-
pub playback_progress_bar_rect: tui::layout::Rect,
39+
pub playback_progress_bar_rect: ratatui::layout::Rect,
4040

4141
#[cfg(feature = "image")]
4242
pub last_cover_image_render_info: ImageRenderInfo,
@@ -116,7 +116,7 @@ impl UIState {
116116

117117
#[cfg(feature = "fzf")]
118118
use fuzzy_matcher::skim::SkimMatcherV2;
119-
use tui::layout::Rect;
119+
use ratatui::layout::Rect;
120120

121121
#[cfg(feature = "fzf")]
122122
fn fuzzy_search_items<'a, T: std::fmt::Display>(items: &'a [T], query: &str) -> Vec<&'a T> {

spotify_player/src/state/ui/page.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::{
22
state::model::{Category, ContextId},
33
ui::single_line_input::LineInput,
44
};
5-
use tui::widgets::{ListState, TableState};
5+
use ratatui::widgets::{ListState, TableState};
66

77
#[derive(Clone, Debug)]
88
pub enum PageState {

spotify_player/src/state/ui/popup.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::{
33
state::model::{Album, Artist, Episode, EpisodeId, Playlist, Show, Track, TrackId},
44
ui::single_line_input::LineInput,
55
};
6-
use tui::widgets::ListState;
6+
use ratatui::widgets::ListState;
77

88
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
99
pub enum PlaylistCreateCurrentField {

spotify_player/src/ui/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::{
88
},
99
};
1010
use anyhow::{Context as AnyhowContext, Result};
11-
use tui::{
11+
use ratatui::{
1212
layout::{Constraint, Layout, Rect},
1313
style::{Modifier, Style},
1414
text::{Line, Span, Text},
@@ -22,7 +22,7 @@ use tui::{
2222
#[cfg(feature = "image")]
2323
use crate::state::ImageRenderInfo;
2424

25-
type Terminal = tui::Terminal<tui::backend::CrosstermBackend<std::io::Stdout>>;
25+
type Terminal = ratatui::Terminal<ratatui::backend::CrosstermBackend<std::io::Stdout>>;
2626

2727
mod page;
2828
mod playback;
@@ -82,8 +82,8 @@ fn init_ui() -> Result<Terminal> {
8282
crossterm::terminal::EnterAlternateScreen,
8383
crossterm::event::EnableMouseCapture
8484
)?;
85-
let backend = tui::backend::CrosstermBackend::new(stdout);
86-
let mut terminal = tui::Terminal::new(backend)?;
85+
let backend = ratatui::backend::CrosstermBackend::new(stdout);
86+
let mut terminal = ratatui::Terminal::new(backend)?;
8787
terminal.clear()?;
8888
Ok(terminal)
8989
}

spotify_player/src/ui/page.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::{
33
fmt::Display,
44
};
55

6-
use tui::text::Line;
6+
use ratatui::text::Line;
77

88
use crate::{state::Episode, utils::format_duration};
99

spotify_player/src/ui/single_line_input.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crossterm::event::KeyCode;
2-
use tui::widgets::Widget;
2+
use ratatui::widgets::Widget;
33

44
use super::{Line, Modifier, Paragraph, Span, Style};
55
use crate::key::Key;

0 commit comments

Comments
 (0)