WGroupbox: respect dialog's colors.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
mooffie 2015-05-24 19:10:12 +03:00 committed by Andrew Borodin
parent b918ff1499
commit ace07e4239

View File

@ -67,18 +67,20 @@ groupbox_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void
case MSG_DRAW:
{
WDialog *h = w->owner;
gboolean disabled;
disabled = (w->options & W_DISABLED) != 0;
tty_setcolor (disabled ? DISABLED_COLOR : COLOR_NORMAL);
tty_setcolor (disabled ? DISABLED_COLOR : h->color[DLG_COLOR_NORMAL]);
tty_draw_box (w->y, w->x, w->lines, w->cols, TRUE);
if (g->title != NULL)
{
Widget *wo = WIDGET (w->owner);
tty_setcolor (disabled ? DISABLED_COLOR : COLOR_TITLE);
widget_move (wo, w->y - wo->y, w->x - wo->x + 1);
tty_setcolor (disabled ? DISABLED_COLOR : h->color[DLG_COLOR_TITLE]);
widget_move (w, 0, 1);
tty_print_string (g->title);
}
return MSG_HANDLED;