add align option to focustitle

This commit is contained in:
Julien Danjou 2008-01-03 16:04:16 +01:00
parent ec53f3d070
commit 7c716e0ec0
2 changed files with 5 additions and 1 deletions

View File

@ -543,6 +543,7 @@ config_parse(const char *confpatharg)
CFG_STR((char *) "fg", (char *) NULL, CFGF_NONE),
CFG_STR((char *) "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_tasklist_opts[] =

View File

@ -33,6 +33,7 @@ extern AwesomeConf globalconf;
typedef struct
{
int align;
XColor fg;
XColor bg;
} Data;
@ -54,7 +55,7 @@ focustitle_draw(Widget *widget, DrawCtx *ctx, int offset, int used)
draw_text(ctx, widget->location, 0,
vscreen.statusbar->width - used,
vscreen.statusbar->height,
AlignLeft,
d->align,
widget->font->height / 2, widget->font, sel->name,
d->fg, d->bg);
if(sel->isfloating)
@ -95,6 +96,8 @@ focustitle_new(Statusbar *statusbar, cfg_t *config)
else
d->bg = globalconf.screens[statusbar->screen].colors_selected[ColBG];
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);