mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-05 21:28:48 +00:00
Merge pull request #55 from adamperkowski/main
Add formatting fixes and remove dead code
This commit is contained in:
commit
7125cac196
Binary file not shown.
|
@ -1,5 +1,3 @@
|
||||||
use std::usize;
|
|
||||||
|
|
||||||
use crate::{float::floating_window, theme::*};
|
use crate::{float::floating_window, theme::*};
|
||||||
use crossterm::event::{KeyCode, KeyEvent, KeyEventKind};
|
use crossterm::event::{KeyCode, KeyEvent, KeyEventKind};
|
||||||
use ego_tree::{tree, NodeId};
|
use ego_tree::{tree, NodeId};
|
||||||
|
@ -169,7 +167,10 @@ impl CustomList {
|
||||||
// node
|
// node
|
||||||
let list = List::new(items)
|
let list = List::new(items)
|
||||||
.highlight_style(Style::default().reversed())
|
.highlight_style(Style::default().reversed())
|
||||||
.block(Block::default().borders(Borders::ALL).title(format!("Linux Toolbox - {}", chrono::Local::now().format("%Y-%m-%d"))))
|
.block(Block::default().borders(Borders::ALL).title(format!(
|
||||||
|
"Linux Toolbox - {}",
|
||||||
|
chrono::Local::now().format("%Y-%m-%d")
|
||||||
|
)))
|
||||||
.scroll_padding(1);
|
.scroll_padding(1);
|
||||||
|
|
||||||
// Render it
|
// Render it
|
||||||
|
@ -251,7 +252,7 @@ impl CustomList {
|
||||||
// Get the selected command
|
// Get the selected command
|
||||||
if let Some(selected_command) = self.get_selected_command() {
|
if let Some(selected_command) = self.get_selected_command() {
|
||||||
// If command is a folder, we don't display a preview
|
// If command is a folder, we don't display a preview
|
||||||
if selected_command == "" {
|
if selected_command.is_empty() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,6 +95,5 @@ fn run<B: Backend>(terminal: &mut Terminal<B>) -> io::Result<()> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,9 +31,9 @@ pub const THEMES: [Theme; 2] = [
|
||||||
];
|
];
|
||||||
|
|
||||||
pub fn get_theme() -> &'static Theme {
|
pub fn get_theme() -> &'static Theme {
|
||||||
&THEMES[unsafe { THEME_IDX } ]
|
&THEMES[unsafe { THEME_IDX }]
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_theme(idx: usize){
|
pub fn set_theme(idx: usize) {
|
||||||
unsafe { THEME_IDX = idx };
|
unsafe { THEME_IDX = idx };
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user