Merge branch '3468_groupbox_colors'

* 3468_groupbox_colors:
  WGroupbox: respect dialog's colors.
This commit is contained in:
Andrew Borodin 2015-05-24 19:10:50 +03:00
commit 4f64bccf06

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;