diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2014-01-22 17:45:27 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2014-01-22 17:45:27 -0800 |
commit | 7d3f808e4c48d3cb54cb603b94901eaa6078b70c (patch) | |
tree | 224cf3c48732c6615ff64a49be5f99b0dd40fb72 /pager.h | |
parent | ee9a4082b6a313dc15fcb24801cc54937777c662 (diff) |
Various tweaks and improvements to new pager, including disclosure
feature
Diffstat (limited to 'pager.h')
-rw-r--r-- | pager.h | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -18,6 +18,8 @@ class page_rendering_t size_t selected_completion_idx; screen_data_t screen_data; + size_t remaining_to_disclose; + /* Returns a rendering with invalid data, useful to indicate "no rendering" */ page_rendering_t(); }; @@ -26,19 +28,25 @@ class page_rendering_t #define PAGER_SPACER_STRING L" " #define PAGER_SPACER_STRING_WIDTH 2 +/* How many rows we will show in the "initial" pager */ +#define PAGER_UNDISCLOSED_MAX_ROWS 4 + typedef std::vector<completion_t> completion_list_t; page_rendering_t render_completions(const completion_list_t &raw_completions, const wcstring &prefix); class pager_t { - int term_width; - int term_height; + int available_term_width; + int available_term_height; completion_list_t completions; size_t selected_completion_idx; size_t suggested_row_start; + /* Fully disclosed means that we show all completions */ + bool fully_disclosed; + /* Returns the index of the completion that should draw selected, using the given number of columns */ size_t visual_selected_completion_index(size_t rows, size_t cols) const; |