(hotkey_draw): minor optimization.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2019-12-14 16:56:18 +03:00
parent 53314c58b5
commit 432af88b06

View File

@ -206,18 +206,23 @@ hotkey_equal (const hotkey_t hotkey1, const hotkey_t hotkey2)
void void
hotkey_draw (Widget * w, const hotkey_t hotkey, gboolean focused) hotkey_draw (Widget * w, const hotkey_t hotkey, gboolean focused)
{ {
widget_selectcolor (w, focused, FALSE); if (hotkey.start[0] != '\0')
tty_print_string (hotkey.start); {
widget_selectcolor (w, focused, FALSE);
tty_print_string (hotkey.start);
}
if (hotkey.hotkey != NULL) if (hotkey.hotkey != NULL)
{ {
widget_selectcolor (w, focused, TRUE); widget_selectcolor (w, focused, TRUE);
tty_print_string (hotkey.hotkey); tty_print_string (hotkey.hotkey);
widget_selectcolor (w, focused, FALSE);
} }
if (hotkey.end != NULL) if (hotkey.end != NULL)
{
widget_selectcolor (w, focused, FALSE);
tty_print_string (hotkey.end); tty_print_string (hotkey.end);
}
} }
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */