Merge pull request #55 from adamperkowski/main

Add formatting fixes and remove dead code
This commit is contained in:
Chris Titus 2024-07-23 21:44:55 -05:00 committed by GitHub
commit 7125cac196
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 10 additions and 10 deletions

Binary file not shown.

View File

@ -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;
} }

View File

@ -95,6 +95,5 @@ fn run<B: Backend>(terminal: &mut Terminal<B>) -> io::Result<()> {
} }
} }
} }
} }
} }

View File

@ -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 };
} }