Use string of element instead of multi section
This commit is contained in:
parent
f2d67a8ace
commit
55586bc20a
@ -16,9 +16,10 @@ static void
|
||||
config_bars(void)
|
||||
{
|
||||
Scr33n *s;
|
||||
size_t i, n, j, m;
|
||||
struct conf_sec *sec, **ks, **es;
|
||||
size_t i, n;
|
||||
struct conf_sec *sec, **ks;
|
||||
int screenid;
|
||||
char *elem;
|
||||
|
||||
/* [bars] */
|
||||
sec = fetch_section_first(NULL, "bars");
|
||||
@ -28,21 +29,12 @@ config_bars(void)
|
||||
/* [bar] */
|
||||
for(i = 0; i < n; ++i)
|
||||
{
|
||||
char elem[128] = { 0 };
|
||||
|
||||
/* [element] */
|
||||
es = fetch_section(ks[i], "element");
|
||||
m = fetch_section_count(es);
|
||||
for(j = 0; j < m; ++j)
|
||||
elem[j] = fetch_opt_first(es[j], "t", "type").str[0];
|
||||
|
||||
elem = fetch_opt_first(ks[i], "", "elements").str;
|
||||
screenid = fetch_opt_first(ks[i], "-1", "screen").num;
|
||||
|
||||
SLIST_FOREACH(s, &W->h.screen, next)
|
||||
if(screenid == s->id || screenid == -1)
|
||||
(Infobar*)infobar_new(s, elem);
|
||||
|
||||
free(es);
|
||||
}
|
||||
|
||||
free(ks);
|
||||
|
||||
@ -27,8 +27,6 @@ tag_new(Scr33n *s, char *name)
|
||||
void
|
||||
tag_screen(Scr33n *s, Tag *t)
|
||||
{
|
||||
Infobar *i;
|
||||
|
||||
s->seltag = t;
|
||||
|
||||
infobar_elem_screen_update(s, ElemTag);
|
||||
|
||||
@ -5,17 +5,17 @@
|
||||
[bars]
|
||||
|
||||
# element type:
|
||||
# t Tag list
|
||||
# S statustext
|
||||
# t Tags
|
||||
# S Statustext
|
||||
|
||||
[bar]
|
||||
screen = 0
|
||||
[element] type = "t" [/element]
|
||||
elements = "tt"
|
||||
[/bar]
|
||||
|
||||
[bar]
|
||||
screen = 1
|
||||
[element] type = "t" [/element]
|
||||
elements = "t"
|
||||
[/bar]
|
||||
|
||||
[/bars]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user