Add support for urgent style in tasklist
This commit is contained in:
parent
44824e9ac7
commit
a47e3d26d5
|
@ -387,7 +387,7 @@ This widget shows a list of running windows.
|
||||||
*mouse*::
|
*mouse*::
|
||||||
Set mouse bindings.
|
Set mouse bindings.
|
||||||
*styles*::
|
*styles*::
|
||||||
Style section with a focus and normal subsection.
|
Style section with normal, focus and urgent subsections.
|
||||||
*text_align*::
|
*text_align*::
|
||||||
Text alignement.
|
Text alignement.
|
||||||
*show_icons*::
|
*show_icons*::
|
||||||
|
|
|
@ -47,6 +47,7 @@ typedef struct
|
||||||
{
|
{
|
||||||
style_t normal;
|
style_t normal;
|
||||||
style_t focus;
|
style_t focus;
|
||||||
|
style_t urgent;
|
||||||
} styles;
|
} styles;
|
||||||
} Data;
|
} Data;
|
||||||
|
|
||||||
|
@ -115,7 +116,12 @@ tasklist_draw(Widget *widget, DrawCtx *ctx, int offset, int used)
|
||||||
{
|
{
|
||||||
icon_width = 0;
|
icon_width = 0;
|
||||||
|
|
||||||
style = sel == c ? d->styles.focus : d->styles.normal;
|
if(c->isurgent)
|
||||||
|
style = d->styles.urgent;
|
||||||
|
else if(sel == c)
|
||||||
|
style = d->styles.focus;
|
||||||
|
else
|
||||||
|
style = d->styles.normal;
|
||||||
|
|
||||||
if(d->show_icons)
|
if(d->show_icons)
|
||||||
{
|
{
|
||||||
|
@ -286,6 +292,11 @@ tasklist_new(Statusbar *statusbar, cfg_t *config)
|
||||||
&d->styles.focus,
|
&d->styles.focus,
|
||||||
&globalconf.screens[statusbar->screen].styles.focus);
|
&globalconf.screens[statusbar->screen].styles.focus);
|
||||||
|
|
||||||
|
draw_style_init(globalconf.display, phys_screen,
|
||||||
|
cfg_getsec(cfg_styles, "urgent"),
|
||||||
|
&d->styles.urgent,
|
||||||
|
&globalconf.screens[statusbar->screen].styles.urgent);
|
||||||
|
|
||||||
d->align = draw_get_align(cfg_getstr(config, "text_align"));
|
d->align = draw_get_align(cfg_getstr(config, "text_align"));
|
||||||
d->show_icons = cfg_getbool(config, "show_icons");
|
d->show_icons = cfg_getbool(config, "show_icons");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue