use list functions for statusbar
This commit is contained in:
parent
6bd8c670e5
commit
56d7e1654a
27
config.c
27
config.c
|
@ -292,6 +292,7 @@ config_parse_screen(cfg_t *cfg, int screen)
|
||||||
*cfg_layouts, *cfg_padding, *cfgsectmp;
|
*cfg_layouts, *cfg_padding, *cfgsectmp;
|
||||||
VirtScreen *virtscreen = &globalconf.screens[screen];
|
VirtScreen *virtscreen = &globalconf.screens[screen];
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
int j;
|
||||||
int phys_screen = get_phys_screen(screen);
|
int phys_screen = get_phys_screen(screen);
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%d", screen);
|
snprintf(buf, sizeof(buf), "%d", screen);
|
||||||
|
@ -350,22 +351,18 @@ config_parse_screen(cfg_t *cfg, int screen)
|
||||||
|
|
||||||
/* Statusbar */
|
/* Statusbar */
|
||||||
|
|
||||||
if(cfg_size(cfg_screen, "statusbar"))
|
statusbar_list_init(&virtscreen->statusbar);
|
||||||
|
for(j = cfg_size(cfg_screen, "statusbar") - 1; j >= 0; j--)
|
||||||
{
|
{
|
||||||
virtscreen->statusbar = statusbar = p_new(Statusbar, 1);
|
statusbar = p_new(Statusbar, 1);
|
||||||
for(i = 0; i < cfg_size(cfg_screen, "statusbar"); i++)
|
cfgsectmp = cfg_getnsec(cfg_screen, "statusbar", j);
|
||||||
{
|
statusbar->position = statusbar->dposition =
|
||||||
cfgsectmp = cfg_getnsec(cfg_screen, "statusbar", i);
|
statusbar_get_position_from_str(cfg_getstr(cfgsectmp, "position"));
|
||||||
statusbar->position = statusbar->dposition =
|
statusbar->height = cfg_getint(cfgsectmp, "height");
|
||||||
statusbar_get_position_from_str(cfg_getstr(cfgsectmp, "position"));
|
statusbar->width = cfg_getint(cfgsectmp, "width");
|
||||||
statusbar->height = cfg_getint(cfgsectmp, "height");
|
statusbar->name = a_strdup(cfg_title(cfgsectmp));
|
||||||
statusbar->width = cfg_getint(cfgsectmp, "width");
|
create_widgets(cfgsectmp, statusbar);
|
||||||
statusbar->name = a_strdup(cfg_title(cfgsectmp));
|
statusbar_list_append(&virtscreen->statusbar, statusbar);
|
||||||
create_widgets(cfgsectmp, statusbar);
|
|
||||||
|
|
||||||
if(i < cfg_size(cfg_screen, "statusbar") - 1)
|
|
||||||
statusbar = statusbar->next = p_new(Statusbar, 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Layouts */
|
/* Layouts */
|
||||||
|
|
Loading…
Reference in New Issue