Save/simplify show hidden items (#1026)
Closes: #1022, #605 See: #982 Original PR: #36 This commit reimplements saving the "show hidden" files setting. I simplified the implementation by making the toggle global. My original PR (#36) implemented per tab show hidden, but that complicates saving configs which is why (I think?) why the saving the toggle was scrapped.
This commit is contained in:
parent
c99caff5ed
commit
ec685bd185
2 changed files with 18 additions and 17 deletions
10
src/app.rs
10
src/app.rs
|
|
@ -227,9 +227,7 @@ impl Action {
|
|||
Action::TabViewGrid => Message::TabView(entity_opt, tab::View::Grid),
|
||||
Action::TabViewList => Message::TabView(entity_opt, tab::View::List),
|
||||
Action::ToggleFoldersFirst => Message::ToggleFoldersFirst,
|
||||
Action::ToggleShowHidden => {
|
||||
Message::TabMessage(entity_opt, tab::Message::ToggleShowHidden)
|
||||
}
|
||||
Action::ToggleShowHidden => Message::ToggleShowHidden,
|
||||
Action::ToggleSort(sort) => {
|
||||
Message::TabMessage(entity_opt, tab::Message::ToggleSort(*sort))
|
||||
}
|
||||
|
|
@ -382,6 +380,7 @@ pub enum Message {
|
|||
TimeConfigChange(TimeConfig),
|
||||
ToggleContextPage(ContextPage),
|
||||
ToggleFoldersFirst,
|
||||
ToggleShowHidden,
|
||||
Undo(usize),
|
||||
UndoTrash(widget::ToastId, Arc<[PathBuf]>),
|
||||
UndoTrashStart(Vec<TrashItem>),
|
||||
|
|
@ -3444,6 +3443,11 @@ impl Application for App {
|
|||
config.folders_first = !config.folders_first;
|
||||
return self.update(Message::TabConfig(config));
|
||||
}
|
||||
Message::ToggleShowHidden => {
|
||||
let mut config = self.config.tab;
|
||||
config.show_hidden = !config.show_hidden;
|
||||
return self.update(Message::TabConfig(config));
|
||||
}
|
||||
Message::TabMessage(entity_opt, tab_message) => {
|
||||
let entity = entity_opt.unwrap_or_else(|| self.tab_model.active());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue