From 2a15531bb9df283060e0eb0e7e93ecf33e494b4d Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Sun, 18 May 2014 09:47:19 +0200 Subject: Add support for caption rows in list boxes This adds support for rows that cannot be selected. Such rows can be used for section headings and the like. Signed-off-by: Lukas Fleischer --- src/custom.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/custom.c') diff --git a/src/custom.c b/src/custom.c index bb425a6..688ca21 100644 --- a/src/custom.c +++ b/src/custom.c @@ -684,6 +684,11 @@ static void print_general_option(int i, WINDOW *win, int y, int hilt, void *cb_d custom_remove_attr(win, ATTR_HIGHEST); } +static enum listbox_row_type general_option_row_type(int i, void *cb_data) +{ + return LISTBOX_ROW_TEXT; +} + static int general_option_height(int i, void *cb_data) { if (i == 9) @@ -771,8 +776,8 @@ void custom_general_config(void) clear(); listbox_init(&lb, 0, 0, notify_bar() ? row - 3 : row - 2, col, - _("general options"), general_option_height, - print_general_option); + _("general options"), general_option_row_type, + general_option_height, print_general_option); listbox_load_items(&lb, 10); listbox_draw_deco(&lb, 0); status_mesg("", ""); -- cgit v1.2.3-54-g00ecf