chore: Upgrade to Ratatui v0.30.0
Test Coverage / coverage (push) Has been cancelled
Rust / rustfmt (push) Has been cancelled
Rust / clippy (beta) (push) Has been cancelled
Rust / clippy (nightly) (push) Has been cancelled
Rust / clippy (stable) (push) Has been cancelled
Rust / features (macos-latest, beta) (push) Has been cancelled
Rust / features (macos-latest, stable) (push) Has been cancelled
Rust / features (ubuntu-latest, beta) (push) Has been cancelled
Rust / features (ubuntu-latest, stable) (push) Has been cancelled
Rust / features (windows-latest, beta) (push) Has been cancelled
Rust / features (windows-latest, stable) (push) Has been cancelled
Rust / test (macos-latest, beta) (push) Has been cancelled
Rust / test (macos-latest, nightly) (push) Has been cancelled
Rust / test (macos-latest, stable) (push) Has been cancelled
Rust / test (ubuntu-latest, beta) (push) Has been cancelled
Rust / test (ubuntu-latest, nightly) (push) Has been cancelled
Rust / test (ubuntu-latest, stable) (push) Has been cancelled
Rust / test (windows-latest, beta) (push) Has been cancelled
Rust / test (windows-latest, nightly) (push) Has been cancelled
Rust / test (windows-latest, stable) (push) Has been cancelled
Rust / Release aarch64-apple-darwin (push) Has been cancelled
Rust / Release x86_64-apple-darwin (push) Has been cancelled
Rust / Release aarch64-unknown-linux-gnu (push) Has been cancelled
Rust / Release arm-unknown-linux-gnueabihf (push) Has been cancelled
Rust / Release armv7-unknown-linux-gnueabihf (push) Has been cancelled
Rust / Release riscv64gc-unknown-linux-gnu (push) Has been cancelled
Rust / Release x86_64-unknown-linux-gnu (push) Has been cancelled
Rust / Release aarch64-pc-windows-msvc (push) Has been cancelled
Rust / Release x86_64-pc-windows-msvc (push) Has been cancelled
Test Coverage / coverage (push) Has been cancelled
Rust / rustfmt (push) Has been cancelled
Rust / clippy (beta) (push) Has been cancelled
Rust / clippy (nightly) (push) Has been cancelled
Rust / clippy (stable) (push) Has been cancelled
Rust / features (macos-latest, beta) (push) Has been cancelled
Rust / features (macos-latest, stable) (push) Has been cancelled
Rust / features (ubuntu-latest, beta) (push) Has been cancelled
Rust / features (ubuntu-latest, stable) (push) Has been cancelled
Rust / features (windows-latest, beta) (push) Has been cancelled
Rust / features (windows-latest, stable) (push) Has been cancelled
Rust / test (macos-latest, beta) (push) Has been cancelled
Rust / test (macos-latest, nightly) (push) Has been cancelled
Rust / test (macos-latest, stable) (push) Has been cancelled
Rust / test (ubuntu-latest, beta) (push) Has been cancelled
Rust / test (ubuntu-latest, nightly) (push) Has been cancelled
Rust / test (ubuntu-latest, stable) (push) Has been cancelled
Rust / test (windows-latest, beta) (push) Has been cancelled
Rust / test (windows-latest, nightly) (push) Has been cancelled
Rust / test (windows-latest, stable) (push) Has been cancelled
Rust / Release aarch64-apple-darwin (push) Has been cancelled
Rust / Release x86_64-apple-darwin (push) Has been cancelled
Rust / Release aarch64-unknown-linux-gnu (push) Has been cancelled
Rust / Release arm-unknown-linux-gnueabihf (push) Has been cancelled
Rust / Release armv7-unknown-linux-gnueabihf (push) Has been cancelled
Rust / Release riscv64gc-unknown-linux-gnu (push) Has been cancelled
Rust / Release x86_64-unknown-linux-gnu (push) Has been cancelled
Rust / Release aarch64-pc-windows-msvc (push) Has been cancelled
Rust / Release x86_64-pc-windows-msvc (push) Has been cancelled
This commit is contained in:
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "managarr-tree-widget"
|
name = "managarr-tree-widget"
|
||||||
description = "Tree Widget for Managarr"
|
description = "Tree Widget for Managarr"
|
||||||
version = "0.24.0"
|
version = "0.25.0"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
repository = "https://github.com/Dark-Alex-17/managarr-tree-widget"
|
repository = "https://github.com/Dark-Alex-17/managarr-tree-widget"
|
||||||
authors = [
|
authors = [
|
||||||
@@ -26,12 +26,12 @@ debug = true
|
|||||||
lto = true
|
lto = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
ratatui = { version = "0.29", default-features = false }
|
ratatui = { version = "0.30", default-features = false }
|
||||||
unicode-width = "0.2"
|
unicode-width = "0.2"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
criterion = "0.5"
|
criterion = "0.5"
|
||||||
ratatui = "0.29"
|
ratatui = "0.30"
|
||||||
|
|
||||||
[target.'cfg(target_family = "unix")'.dev-dependencies]
|
[target.'cfg(target_family = "unix")'.dev-dependencies]
|
||||||
pprof = { version = "0.14.0", features = ["criterion", "flamegraph"] }
|
pprof = { version = "0.14.0", features = ["criterion", "flamegraph"] }
|
||||||
|
|||||||
+6
-3
@@ -7,7 +7,7 @@ use ratatui::layout::{Position, Rect};
|
|||||||
use ratatui::style::{Color, Modifier, Style};
|
use ratatui::style::{Color, Modifier, Style};
|
||||||
use ratatui::text::Span;
|
use ratatui::text::Span;
|
||||||
use ratatui::widgets::{Block, Scrollbar, ScrollbarOrientation};
|
use ratatui::widgets::{Block, Scrollbar, ScrollbarOrientation};
|
||||||
use ratatui::{crossterm, Frame, Terminal};
|
use ratatui::{Frame, Terminal, crossterm};
|
||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
struct App {
|
struct App {
|
||||||
@@ -129,7 +129,10 @@ fn main() -> std::io::Result<()> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn run_app<B: Backend>(terminal: &mut Terminal<B>, mut app: App) -> std::io::Result<()> {
|
fn run_app<B: Backend<Error = std::io::Error>>(
|
||||||
|
terminal: &mut Terminal<B>,
|
||||||
|
mut app: App,
|
||||||
|
) -> std::io::Result<()> {
|
||||||
const DEBOUNCE: Duration = Duration::from_millis(20); // 50 FPS
|
const DEBOUNCE: Duration = Duration::from_millis(20); // 50 FPS
|
||||||
|
|
||||||
let before = Instant::now();
|
let before = Instant::now();
|
||||||
@@ -144,7 +147,7 @@ fn run_app<B: Backend>(terminal: &mut Terminal<B>, mut app: App) -> std::io::Res
|
|||||||
let update = match crossterm::event::read()? {
|
let update = match crossterm::event::read()? {
|
||||||
Event::Key(key) => match key.code {
|
Event::Key(key) => match key.code {
|
||||||
KeyCode::Char('c') if key.modifiers.contains(KeyModifiers::CONTROL) => {
|
KeyCode::Char('c') if key.modifiers.contains(KeyModifiers::CONTROL) => {
|
||||||
return Ok(())
|
return Ok(());
|
||||||
}
|
}
|
||||||
KeyCode::Char('q') => return Ok(()),
|
KeyCode::Char('q') => return Ok(()),
|
||||||
KeyCode::Char('\n' | ' ') => app.state.toggle_selected(),
|
KeyCode::Char('\n' | ' ') => app.state.toggle_selected(),
|
||||||
|
|||||||
+1
-2
@@ -46,8 +46,7 @@ mod tree_state;
|
|||||||
/// .block(Block::bordered().title("Tree Widget"));
|
/// .block(Block::bordered().title("Tree Widget"));
|
||||||
///
|
///
|
||||||
/// frame.render_stateful_widget(tree_widget, area, &mut state);
|
/// frame.render_stateful_widget(tree_widget, area, &mut state);
|
||||||
/// })?;
|
/// }).unwrap();
|
||||||
/// # Ok::<(), std::io::Error>(())
|
|
||||||
/// ```
|
/// ```
|
||||||
#[must_use]
|
#[must_use]
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ use std::collections::HashSet;
|
|||||||
use std::fmt::Display;
|
use std::fmt::Display;
|
||||||
use std::hash::Hash;
|
use std::hash::Hash;
|
||||||
|
|
||||||
use crate::flatten::{flatten, Flattened};
|
use crate::flatten::{Flattened, flatten};
|
||||||
use crate::tree_item::TreeItem;
|
use crate::tree_item::TreeItem;
|
||||||
|
|
||||||
/// Keeps the state of what is currently selected and what was opened in a [`Tree`](crate::Tree).
|
/// Keeps the state of what is currently selected and what was opened in a [`Tree`](crate::Tree).
|
||||||
|
|||||||
Reference in New Issue
Block a user