(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

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