Use ratatui bundled crossterm

This commit is contained in:
Jeevitha Kannan K S 2024-10-12 11:28:42 +05:30
parent 79eb752552
commit c7b99d9903
No known key found for this signature in database
GPG Key ID: 5904C34A2F7CE333
9 changed files with 16 additions and 15 deletions

1
Cargo.lock generated
View File

@ -503,7 +503,6 @@ dependencies = [
"anstyle",
"chrono",
"clap",
"crossterm",
"ego-tree",
"linutil_core",
"oneshot",

View File

@ -16,7 +16,6 @@ tips = ["rand"]
[dependencies]
clap = { version = "4.5.19", features = ["derive"] }
crossterm = "0.28.1"
ego-tree = { workspace = true }
oneshot = "0.1.8"
portable-pty = "0.8.1"

View File

@ -2,8 +2,8 @@ use std::borrow::Cow;
use crate::{float::FloatContent, hint::Shortcut};
use crossterm::event::{KeyCode, KeyEvent};
use ratatui::{
crossterm::event::{KeyCode, KeyEvent},
layout::Alignment,
prelude::*,
widgets::{Block, Borders, Clear, List},

View File

@ -1,8 +1,8 @@
use crate::{state::ListEntry, theme::Theme};
use crossterm::event::{KeyCode, KeyEvent};
use ego_tree::NodeId;
use linutil_core::Tab;
use ratatui::{
crossterm::event::{KeyCode, KeyEvent},
layout::{Position, Rect},
style::Style,
text::Span,

View File

@ -1,5 +1,5 @@
use crossterm::event::{KeyCode, KeyEvent};
use ratatui::{
crossterm::event::{KeyCode, KeyEvent},
layout::{Constraint, Direction, Layout, Rect},
Frame,
};

View File

@ -8,9 +8,8 @@ use crate::{float::FloatContent, hint::Shortcut};
use linutil_core::Command;
use crossterm::event::{KeyCode, KeyEvent};
use ratatui::{
crossterm::event::{KeyCode, KeyEvent},
layout::Rect,
style::{Style, Stylize},
text::Line,

View File

@ -14,13 +14,17 @@ use std::{
use crate::theme::Theme;
use clap::Parser;
use crossterm::{
use ratatui::{
backend::CrosstermBackend,
crossterm::{
event::{self, DisableMouseCapture, Event, KeyEventKind},
style::ResetColor,
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
ExecutableCommand,
},
Terminal,
};
use ratatui::{backend::CrosstermBackend, Terminal};
use state::AppState;
// Linux utility toolbox

View File

@ -1,11 +1,11 @@
use crate::{float::FloatContent, hint::Shortcut};
use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};
use linutil_core::Command;
use oneshot::{channel, Receiver};
use portable_pty::{
ChildKiller, CommandBuilder, ExitStatus, MasterPty, NativePtySystem, PtySize, PtySystem,
};
use ratatui::{
crossterm::event::{KeyCode, KeyEvent, KeyModifiers},
layout::{Rect, Size},
style::{Color, Style, Stylize},
text::{Line, Span},

View File

@ -7,12 +7,12 @@ use crate::{
running_command::RunningCommand,
theme::Theme,
};
use crossterm::event::{KeyCode, KeyEvent, KeyEventKind, KeyModifiers};
use ego_tree::NodeId;
use linutil_core::{ListNode, Tab};
#[cfg(feature = "tips")]
use rand::Rng;
use ratatui::{
crossterm::event::{KeyCode, KeyEvent, KeyEventKind, KeyModifiers},
layout::{Alignment, Constraint, Direction, Flex, Layout},
style::{Style, Stylize},
text::{Line, Span, Text},