From ace07e4239490bc693e6257fc4cc0fcc10edebb6 Mon Sep 17 00:00:00 2001 From: mooffie Date: Sun, 24 May 2015 19:10:12 +0300 Subject: [PATCH] WGroupbox: respect dialog's colors. Signed-off-by: Andrew Borodin --- lib/widget/groupbox.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/widget/groupbox.c b/lib/widget/groupbox.c index 30d3b6a06..fe52d50aa 100644 --- a/lib/widget/groupbox.c +++ b/lib/widget/groupbox.c @@ -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; -- 2.11.4.GIT