widget: call draw() even if it's invisible

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-08-05 14:19:29 +02:00
parent 380750dd43
commit 86cb01685b
1 changed files with 10 additions and 6 deletions

View File

@ -154,17 +154,21 @@ widget_render(widget_node_t *wnode, draw_context_t *ctx, xcb_gcontext_t gc, xcb_
draw_rectangle(ctx, rectangle, 1.0, true, &ctx->bg); draw_rectangle(ctx, rectangle, 1.0, true, &ctx->bg);
for(w = wnode; w; w = w->next) for(w = wnode; w; w = w->next)
if(w->widget->isvisible && w->widget->align == AlignLeft) if(w->widget->align == AlignLeft)
left += w->widget->draw(ctx, screen, w, left, (left + right), object, type); /* special case: systray need to be called even if it's not visible */
if(w->widget->isvisible || w->widget->type == systray_new)
left += w->widget->draw(ctx, screen, w, left, (left + right), object, type);
/* renders right widget from last to first */ /* renders right widget from last to first */
for(w = *widget_node_list_last(&wnode); w; w = w->prev) for(w = *widget_node_list_last(&wnode); w; w = w->prev)
if(w->widget->isvisible && w->widget->align == AlignRight) if(w->widget->align == AlignRight)
right += w->widget->draw(ctx, screen, w, right, (left + right), object, type); if(w->widget->isvisible || w->widget->type == systray_new)
right += w->widget->draw(ctx, screen, w, right, (left + right), object, type);
for(w = wnode; w; w = w->next) for(w = wnode; w; w = w->next)
if(w->widget->isvisible && w->widget->align == AlignFlex) if(w->widget->align == AlignFlex)
left += w->widget->draw(ctx, screen, w, left, (left + right), object, type); if(w->widget->isvisible || w->widget->type == systray_new)
left += w->widget->draw(ctx, screen, w, left, (left + right), object, type);
switch(position) switch(position)
{ {