diff options
author | Clement Tsang <34804052+ClementTsang@users.noreply.github.com> | 2020-08-15 17:35:49 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-15 20:35:49 -0400 |
commit | f3897f0538f90c682b96bc340c3c05e80be10b2d (patch) | |
tree | f24673d4d5702e48b9d3d1889f7498c97ac238a1 /src/canvas/drawing_utils.rs | |
parent | 84f63f2f8306382dbf5cab819589161bf0b7c093 (diff) |
feature: Allow sorting by any column
This feature allows any column to be sortable.
This also adds:
- Inverting sort for current column with `I`
- Invoking a sort widget with `s` or `F6`. Close with same key or esc.
And:
- A bugfix in regards the basic menu and battery widget
- A lot of refactoring
Diffstat (limited to 'src/canvas/drawing_utils.rs')
-rw-r--r-- | src/canvas/drawing_utils.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/canvas/drawing_utils.rs b/src/canvas/drawing_utils.rs index 410b8916..283d8538 100644 --- a/src/canvas/drawing_utils.rs +++ b/src/canvas/drawing_utils.rs @@ -85,7 +85,7 @@ pub fn get_search_start_position( } match cursor_direction { - app::CursorDirection::RIGHT => { + app::CursorDirection::Right => { if current_cursor_position < *cursor_bar + num_columns { // If, using previous_scrolled_position, we can see the element // (so within that and + num_rows) just reuse the current previously scrolled position @@ -100,7 +100,7 @@ pub fn get_search_start_position( 0 } } - app::CursorDirection::LEFT => { + app::CursorDirection::Left => { if current_cursor_position <= *cursor_bar { // If it's past the first element, then show from that element downwards *cursor_bar = current_cursor_position; @@ -125,7 +125,7 @@ pub fn get_start_position( } match scroll_direction { - app::ScrollDirection::DOWN => { + app::ScrollDirection::Down => { if currently_selected_position < *scroll_position_bar + num_rows { // If, using previous_scrolled_position, we can see the element // (so within that and + num_rows) just reuse the current previously scrolled position @@ -140,7 +140,7 @@ pub fn get_start_position( 0 } } - app::ScrollDirection::UP => { + app::ScrollDirection::Up => { if currently_selected_position <= *scroll_position_bar { // If it's past the first element, then show from that element downwards *scroll_position_bar = currently_selected_position; |