add align option to tasklist

This commit is contained in:
Julien Danjou 2008-01-03 16:05:39 +01:00
parent 7c716e0ec0
commit a06d739dfb
2 changed files with 6 additions and 2 deletions

View File

@ -554,6 +554,7 @@ config_parse(const char *confpatharg)
CFG_STR((char *) "focus_fg", (char *) NULL, CFGF_NONE),
CFG_STR((char *) "focus_bg", (char *) NULL, CFGF_NONE),
CFG_STR((char *) "font", (char *) NULL, CFGF_NONE),
CFG_STR((char *) "align", (char *) "left", CFGF_NONE),
CFG_END()
};
static cfg_opt_t widget_progressbar_bar_opts[] =

View File

@ -34,6 +34,7 @@ extern AwesomeConf globalconf;
typedef struct
{
int align;
XColor fg_sel;
XColor bg_sel;
XColor fg;
@ -74,7 +75,7 @@ tasklist_draw(Widget *widget, DrawCtx *ctx, int offset, int used)
draw_text(ctx, widget->location + box_width * i, 0,
box_width,
vscreen.statusbar->height,
AlignLeft,
d->align,
widget->font->height / 2, widget->font, c->name,
d->fg_sel, d->bg_sel);
}
@ -82,7 +83,7 @@ tasklist_draw(Widget *widget, DrawCtx *ctx, int offset, int used)
draw_text(ctx, widget->location + box_width * i, 0,
box_width,
vscreen.statusbar->height,
AlignLeft,
d->align,
widget->font->height / 2, widget->font, c->name,
d->fg, d->bg);
if(sel->isfloating)
@ -178,6 +179,8 @@ tasklist_new(Statusbar *statusbar, cfg_t *config)
else
d->fg_sel = globalconf.screens[statusbar->screen].colors_selected[ColFG];
d->align = draw_get_align(cfg_getstr(config, "align"));
if((buf = cfg_getstr(config, "font")))
w->font = XftFontOpenName(globalconf.display, get_phys_screen(statusbar->screen), buf);