[widgets] Cosmetic, and allow more bindings in tasklist
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
d5859c60f7
commit
a3a47d718e
|
@ -39,10 +39,7 @@ focusicon_draw(widget_t *widget, draw_context_t *ctx, int offset,
|
||||||
NetWMIcon *icon;
|
NetWMIcon *icon;
|
||||||
|
|
||||||
if(!sel)
|
if(!sel)
|
||||||
{
|
return (widget->area.width = 0);
|
||||||
widget->area.width = 0;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
widget->area.height = widget->statusbar->height;
|
widget->area.height = widget->statusbar->height;
|
||||||
|
|
||||||
|
@ -66,10 +63,7 @@ focusicon_draw(widget_t *widget, draw_context_t *ctx, int offset,
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!(icon = ewmh_get_window_icon(sel->win)))
|
if(!(icon = ewmh_get_window_icon(sel->win)))
|
||||||
{
|
return (widget->area.width = 0);
|
||||||
widget->area.width = 0;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
widget->area.width = ((double) widget->statusbar->height / (double) icon->height) * icon->width;
|
widget->area.width = ((double) widget->statusbar->height / (double) icon->height) * icon->width;
|
||||||
|
|
||||||
|
|
|
@ -250,10 +250,7 @@ tasklist_button_press(widget_t *widget, xcb_button_press_event_t *ev)
|
||||||
|
|
||||||
for(b = widget->buttons; b; b = b->next)
|
for(b = widget->buttons; b; b = b->next)
|
||||||
if(ev->detail == b->button && CLEANMASK(ev->state) == b->mod && b->func)
|
if(ev->detail == b->button && CLEANMASK(ev->state) == b->mod && b->func)
|
||||||
{
|
|
||||||
b->func(widget->statusbar->screen, b->arg);
|
b->func(widget->statusbar->screen, b->arg);
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
widget_t *
|
widget_t *
|
||||||
|
|
|
@ -69,8 +69,7 @@ textbox_tell(widget_t *widget, char *property, char *new_value)
|
||||||
|
|
||||||
if(!a_strcmp(property, "text"))
|
if(!a_strcmp(property, "text"))
|
||||||
{
|
{
|
||||||
if (d->text)
|
p_delete(&d->text);
|
||||||
p_delete(&d->text);
|
|
||||||
d->text = a_strdup(new_value);
|
d->text = a_strdup(new_value);
|
||||||
}
|
}
|
||||||
else if(!a_strcmp(property, "width"))
|
else if(!a_strcmp(property, "width"))
|
||||||
|
|
Loading…
Reference in New Issue