From dc8f2a2cfbea39916846ccbaba566b2c8c0c9b68 Mon Sep 17 00:00:00 2001 From: Qball Cow Date: Mon, 13 Jan 2014 13:36:41 +0100 Subject: [PATCH] Don't highlight row when empty. --- simpleswitcher.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/simpleswitcher.c b/simpleswitcher.c index 4aa03404..49e15ef1 100644 --- a/simpleswitcher.c +++ b/simpleswitcher.c @@ -735,10 +735,17 @@ void menu_draw( textbox *text, textbox **boxes, int max_lines, int selected, cha textbox_draw( text ); for ( i = 0; i < max_lines; i++ ) { - textbox_font( boxes[i], config_menu_font, - i == selected ? config_menu_hlfg: config_menu_fg, - i == selected ? config_menu_hlbg: config_menu_bg ); - textbox_text( boxes[i], filtered[i] ? filtered[i]: "" ); + if(filtered[i] == NULL) { + textbox_font( boxes[i], config_menu_font, + config_menu_fg, + config_menu_bg ); + textbox_text( boxes[i], "" ); + }else { + textbox_font( boxes[i], config_menu_font, + i == selected ? config_menu_hlfg: config_menu_fg, + i == selected ? config_menu_hlbg: config_menu_bg ); + textbox_text( boxes[i], filtered[i]); + } textbox_draw( boxes[i] ); } }