use list function for Widget
This commit is contained in:
parent
19887a3201
commit
a823470fd0
11
config.c
11
config.c
|
@ -265,19 +265,14 @@ create_widgets(cfg_t* cfg_statusbar, Statusbar *statusbar)
|
||||||
|
|
||||||
qsort(widgets, numwidgets, sizeof(cfg_t), cmp_widget_cfg);
|
qsort(widgets, numwidgets, sizeof(cfg_t), cmp_widget_cfg);
|
||||||
|
|
||||||
for (i = 0; i < numwidgets; i++)
|
for(i = 0; i < numwidgets; i++)
|
||||||
{
|
{
|
||||||
wptr = widgets + i;
|
wptr = widgets + i;
|
||||||
widget_new = name_func_lookup(cfg_name(wptr), WidgetList);
|
widget_new = name_func_lookup(cfg_name(wptr), WidgetList);
|
||||||
if(widget_new)
|
if(widget_new)
|
||||||
{
|
{
|
||||||
if(!widget)
|
widget = widget_new(statusbar, wptr);
|
||||||
statusbar->widgets = widget = widget_new(statusbar, wptr);
|
widget_list_append(&statusbar->widgets, widget);
|
||||||
else
|
|
||||||
{
|
|
||||||
widget->next = widget_new(statusbar, wptr);
|
|
||||||
widget = widget->next;
|
|
||||||
}
|
|
||||||
widget->buttons = parse_mouse_bindings(wptr, "mouse", a_strcmp(cfg_name(wptr), "taglist"));
|
widget->buttons = parse_mouse_bindings(wptr, "mouse", a_strcmp(cfg_name(wptr), "taglist"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue