diff options
author | Canop <cano.petrole@gmail.com> | 2020-06-24 20:52:51 +0200 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2020-06-24 20:52:51 +0200 |
commit | 3bc5358107189817b93e6b575e358dbd44d64703 (patch) | |
tree | 9b87808fb7741e643878361e4cf0af52915b0ec4 /src/browser/browser_state.rs | |
parent | 2c812b6fbb157fd449b75f90b52ae12f009b16ea (diff) |
sort by date; sizes visible on toggle even without sorting
Diffstat (limited to 'src/browser/browser_state.rs')
-rw-r--r-- | src/browser/browser_state.rs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/browser/browser_state.rs b/src/browser/browser_state.rs index d46b8e9..e670afc 100644 --- a/src/browser/browser_state.rs +++ b/src/browser/browser_state.rs @@ -550,6 +550,39 @@ impl AppState for BrowserState { } } } + Internal::sort_by_date => { + self.with_new_options( + screen, &|o| { + if o.sort.is_date() { + o.sort = Sort::None; + o.show_dates = false; + } else { + o.sort = Sort::Date; + o.show_dates = true; + } + }, + bang, + con, + ) + } + Internal::sort_by_size => { + self.with_new_options( + screen, &|o| { + if o.sort.is_size() { + o.sort = Sort::None; + o.show_sizes = false; + } else { + o.sort = Sort::Size; + o.show_sizes = true; + } + }, + bang, + con, + ) + } + Internal::no_sort => { + self.with_new_options(screen, &|o| o.sort = Sort::None, bang, con) + } Internal::toggle_dates => { self.with_new_options(screen, &|o| o.show_dates ^= true, bang, con) } |