Add sort by option to config for new tabs
This commit is contained in:
parent
a4b38c4983
commit
e22c74d721
3 changed files with 51 additions and 2 deletions
23
src/tab.rs
23
src/tab.rs
|
|
@ -27,6 +27,7 @@ use std::{
|
|||
cell::Cell,
|
||||
cmp::Ordering,
|
||||
collections::HashMap,
|
||||
fmt,
|
||||
fs::{self, Metadata},
|
||||
path::PathBuf,
|
||||
time::{Duration, Instant},
|
||||
|
|
@ -620,11 +621,31 @@ pub enum View {
|
|||
}
|
||||
#[derive(Clone, Copy, Debug, Hash, PartialEq, PartialOrd, Ord, Eq, Deserialize, Serialize)]
|
||||
pub enum HeadingOptions {
|
||||
Name,
|
||||
Name = 0,
|
||||
Modified,
|
||||
Size,
|
||||
}
|
||||
|
||||
impl fmt::Display for HeadingOptions {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
HeadingOptions::Name => write!(f, "{}", fl!("name")),
|
||||
HeadingOptions::Modified => write!(f, "{}", fl!("modified")),
|
||||
HeadingOptions::Size => write!(f, "{}", fl!("size")),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl HeadingOptions {
|
||||
pub fn names() -> Vec<String> {
|
||||
vec![
|
||||
HeadingOptions::Name.to_string(),
|
||||
HeadingOptions::Modified.to_string(),
|
||||
HeadingOptions::Size.to_string(),
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Tab {
|
||||
//TODO: make more items private
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue