From ab45864138f334a7345aa4a4b57fd458d25a7a0d Mon Sep 17 00:00:00 2001 From: Ingo Ruhnke Date: Mon, 25 Feb 2008 00:51:00 +0000 Subject: [PATCH] - added highlight rectangle around the current menu item SVN-Revision: 5341 --- src/gui/menu.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/gui/menu.cpp b/src/gui/menu.cpp index 9a1635473..a8b2d6bf9 100644 --- a/src/gui/menu.cpp +++ b/src/gui/menu.cpp @@ -490,7 +490,7 @@ void Menu::draw_item(DrawingContext& context, int index) { float menu_height = get_height(); - float menu_width = get_width(); + float menu_width = get_width(); MenuItem& pitem = *(items[index]); @@ -524,6 +524,15 @@ Menu::draw_item(DrawingContext& context, int index) text_font = active_font; } + if(active_item == index) + { + context.draw_filled_rect(Rect(Vector(pos_x - menu_width/2 + 10, y_pos - 12), + Vector(pos_x + menu_width/2 - 10, y_pos + 12)), + Color(1.0f, 1.0f, 1.0f, 0.5f), + 16.0f, + LAYER_GUI-10); + } + switch (pitem.kind) { case MN_DEACTIVE: -- 2.11.0