mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-21 12:59:41 +00:00
Use ratatui bundled crossterm (#805)
This commit is contained in:
parent
98e2f83f43
commit
176b19d692
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -435,7 +435,6 @@ dependencies = [
|
||||||
"ansi-to-tui",
|
"ansi-to-tui",
|
||||||
"anstyle",
|
"anstyle",
|
||||||
"clap",
|
"clap",
|
||||||
"crossterm",
|
|
||||||
"ego-tree",
|
"ego-tree",
|
||||||
"linutil_core",
|
"linutil_core",
|
||||||
"oneshot",
|
"oneshot",
|
||||||
|
|
|
@ -15,7 +15,6 @@ tips = ["rand"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "4.5.20", features = ["derive"] }
|
clap = { version = "4.5.20", features = ["derive"] }
|
||||||
crossterm = "0.28.1"
|
|
||||||
ego-tree = { workspace = true }
|
ego-tree = { workspace = true }
|
||||||
oneshot = "0.1.8"
|
oneshot = "0.1.8"
|
||||||
portable-pty = "0.8.1"
|
portable-pty = "0.8.1"
|
||||||
|
|
|
@ -2,8 +2,8 @@ use std::borrow::Cow;
|
||||||
|
|
||||||
use crate::{float::FloatContent, hint::Shortcut};
|
use crate::{float::FloatContent, hint::Shortcut};
|
||||||
|
|
||||||
use crossterm::event::{KeyCode, KeyEvent};
|
|
||||||
use ratatui::{
|
use ratatui::{
|
||||||
|
crossterm::event::{KeyCode, KeyEvent},
|
||||||
layout::Alignment,
|
layout::Alignment,
|
||||||
prelude::*,
|
prelude::*,
|
||||||
widgets::{Block, Borders, Clear, List},
|
widgets::{Block, Borders, Clear, List},
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
use crate::{state::ListEntry, theme::Theme};
|
use crate::{state::ListEntry, theme::Theme};
|
||||||
use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};
|
|
||||||
use ego_tree::NodeId;
|
use ego_tree::NodeId;
|
||||||
use linutil_core::Tab;
|
use linutil_core::Tab;
|
||||||
use ratatui::{
|
use ratatui::{
|
||||||
|
crossterm::event::{KeyCode, KeyEvent, KeyModifiers},
|
||||||
layout::{Position, Rect},
|
layout::{Position, Rect},
|
||||||
style::{Color, Style},
|
style::{Color, Style},
|
||||||
text::Span,
|
text::Span,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use crossterm::event::{KeyCode, KeyEvent};
|
|
||||||
use ratatui::{
|
use ratatui::{
|
||||||
|
crossterm::event::{KeyCode, KeyEvent},
|
||||||
layout::{Constraint, Direction, Layout, Rect},
|
layout::{Constraint, Direction, Layout, Rect},
|
||||||
Frame,
|
Frame,
|
||||||
};
|
};
|
||||||
|
|
|
@ -8,9 +8,8 @@ use crate::{float::FloatContent, hint::Shortcut};
|
||||||
|
|
||||||
use linutil_core::Command;
|
use linutil_core::Command;
|
||||||
|
|
||||||
use crossterm::event::{KeyCode, KeyEvent};
|
|
||||||
|
|
||||||
use ratatui::{
|
use ratatui::{
|
||||||
|
crossterm::event::{KeyCode, KeyEvent},
|
||||||
layout::Rect,
|
layout::Rect,
|
||||||
style::{Style, Stylize},
|
style::{Style, Stylize},
|
||||||
text::Line,
|
text::Line,
|
||||||
|
|
|
@ -14,13 +14,17 @@ use std::{
|
||||||
|
|
||||||
use crate::theme::Theme;
|
use crate::theme::Theme;
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use crossterm::{
|
|
||||||
event::{self, DisableMouseCapture, Event, KeyEventKind},
|
use ratatui::{
|
||||||
style::ResetColor,
|
backend::CrosstermBackend,
|
||||||
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
|
crossterm::{
|
||||||
ExecutableCommand,
|
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;
|
use state::AppState;
|
||||||
|
|
||||||
// Linux utility toolbox
|
// Linux utility toolbox
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
use crate::{float::FloatContent, hint::Shortcut};
|
use crate::{float::FloatContent, hint::Shortcut};
|
||||||
use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};
|
|
||||||
use linutil_core::Command;
|
use linutil_core::Command;
|
||||||
use oneshot::{channel, Receiver};
|
use oneshot::{channel, Receiver};
|
||||||
use portable_pty::{
|
use portable_pty::{
|
||||||
ChildKiller, CommandBuilder, ExitStatus, MasterPty, NativePtySystem, PtySize, PtySystem,
|
ChildKiller, CommandBuilder, ExitStatus, MasterPty, NativePtySystem, PtySize, PtySystem,
|
||||||
};
|
};
|
||||||
use ratatui::{
|
use ratatui::{
|
||||||
|
crossterm::event::{KeyCode, KeyEvent, KeyModifiers},
|
||||||
layout::{Rect, Size},
|
layout::{Rect, Size},
|
||||||
style::{Color, Style, Stylize},
|
style::{Color, Style, Stylize},
|
||||||
text::{Line, Span},
|
text::{Line, Span},
|
||||||
|
|
|
@ -7,12 +7,12 @@ use crate::{
|
||||||
running_command::RunningCommand,
|
running_command::RunningCommand,
|
||||||
theme::Theme,
|
theme::Theme,
|
||||||
};
|
};
|
||||||
use crossterm::event::{KeyCode, KeyEvent, KeyEventKind, KeyModifiers};
|
|
||||||
use ego_tree::NodeId;
|
use ego_tree::NodeId;
|
||||||
use linutil_core::{ListNode, TabList};
|
use linutil_core::{ListNode, TabList};
|
||||||
#[cfg(feature = "tips")]
|
#[cfg(feature = "tips")]
|
||||||
use rand::Rng;
|
use rand::Rng;
|
||||||
use ratatui::{
|
use ratatui::{
|
||||||
|
crossterm::event::{KeyCode, KeyEvent, KeyEventKind, KeyModifiers},
|
||||||
layout::{Alignment, Constraint, Direction, Flex, Layout},
|
layout::{Alignment, Constraint, Direction, Flex, Layout},
|
||||||
style::{Style, Stylize},
|
style::{Style, Stylize},
|
||||||
text::{Line, Span, Text},
|
text::{Line, Span, Text},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user