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:
parent
75874caf9d
commit
073a9a95ab
4 changed files with 41 additions and 14 deletions
|
|
@ -28,12 +28,33 @@ impl AppTheme {
|
|||
#[derive(Clone, CosmicConfigEntry, Debug, Deserialize, Eq, PartialEq, Serialize)]
|
||||
pub struct Config {
|
||||
pub app_theme: AppTheme,
|
||||
pub tab: Tab,
|
||||
}
|
||||
|
||||
impl Default for Config {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
app_theme: AppTheme::System,
|
||||
tab: Tab::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Per tab config
|
||||
#[derive(Clone, Debug, Eq, PartialEq, CosmicConfigEntry, Deserialize, Serialize)]
|
||||
pub struct Tab {
|
||||
/// Show hidden files
|
||||
pub show_hidden: bool,
|
||||
// TODO: Other possible options
|
||||
// pub sort_by: fn(&PathBuf, &PathBuf) -> Ordering,
|
||||
// Icon handle sizes
|
||||
// icon_size_dialog: u16,
|
||||
// icon_size_list: u16,
|
||||
// icon_size_grid: u16,
|
||||
}
|
||||
|
||||
impl Default for Tab {
|
||||
fn default() -> Self {
|
||||
Self { show_hidden: false }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue