tweaks: rename a function, to be a bit more fitting

master
Benno Schulenberg 2019-09-27 19:07:25 +02:00
parent b14ad451a9
commit 43235c2f16
3 changed files with 5 additions and 5 deletions

View File

@ -428,8 +428,8 @@ int the_code_for(void (*func)(void), int defaultval)
return s->keycode;
}
/* Return the number of entries in the shortcut list for a given menu. */
size_t length_of_list(int menu)
/* Return the number of entries that can be shown in the given menu. */
size_t shown_entries_for(int menu)
{
funcstruct *item;
size_t count = 0;

View File

@ -319,7 +319,7 @@ char *input_tab(char *buf, bool allow_files, size_t *place,
/* Some functions in global.c. */
const keystruct *first_sc_for(int menu, void (*func)(void));
int the_code_for(void (*func)(void), int defaultval);
size_t length_of_list(int menu);
size_t shown_entries_for(int menu);
const keystruct *get_shortcut(int *kbinput);
functionptrtype func_from_key(int *kbinput);
int keycode_from_string(const char *keystring);

View File

@ -1696,7 +1696,7 @@ int get_mouseinput(int *mouse_y, int *mouse_x, bool allow_shortcuts)
}
/* Determine how many shortcuts are being shown. */
number = length_of_list(currmenu);
number = shown_entries_for(currmenu);
/* Calculate the width of each non-rightmost shortcut item;
* the rightmost ones will "absorb" any remaining slack. */
@ -2293,7 +2293,7 @@ void bottombars(int menu)
return;
/* Determine how many shortcuts must be shown. */
number = length_of_list(menu);
number = shown_entries_for(menu);
/* Compute the width of each keyname-plus-explanation pair. */
itemwidth = COLS / ((number / 2) + (number % 2));