Add a per Tab config

A tab config is useful for allowing users to show hidden files, sorting
by different metrics such as size or MIME type, as well as providing a
way to implement some of the todos such as configurable icon sizes for
views.
This commit is contained in:
Josh Megnauth 2024-02-10 02:13:13 -05:00 committed by Jeremy Soller
parent 75874caf9d
commit 073a9a95ab
4 changed files with 41 additions and 14 deletions

View file

@ -26,7 +26,7 @@ use std::{
};
use crate::{
config::{AppTheme, Config, CONFIG_VERSION},
config::{AppTheme, Config, Tab as TabConfig, CONFIG_VERSION},
fl, home_dir,
key_bind::{key_binds, KeyBind},
menu, mouse_area,
@ -186,7 +186,7 @@ pub struct App {
impl App {
fn open_tab(&mut self, location: Location) -> Command<Message> {
let tab = Tab::new(location.clone());
let tab = Tab::new(location.clone(), TabConfig::default());
let entity = self
.tab_model
.insert()
@ -1237,7 +1237,7 @@ pub(crate) mod test_utils {
// New tab with items
let location = Location::Path(path.to_owned());
let items = location.scan();
let mut tab = Tab::new(location);
let mut tab = Tab::new(location, TabConfig::default());
tab.items_opt = Some(items);
// Ensure correct number of directories as a sanity check