add align option to focustitle
This commit is contained in:
parent
ec53f3d070
commit
7c716e0ec0
1
config.c
1
config.c
|
@ -543,6 +543,7 @@ config_parse(const char *confpatharg)
|
||||||
CFG_STR((char *) "fg", (char *) NULL, CFGF_NONE),
|
CFG_STR((char *) "fg", (char *) NULL, CFGF_NONE),
|
||||||
CFG_STR((char *) "bg", (char *) NULL, CFGF_NONE),
|
CFG_STR((char *) "bg", (char *) NULL, CFGF_NONE),
|
||||||
CFG_STR((char *) "font", (char *) NULL, CFGF_NONE),
|
CFG_STR((char *) "font", (char *) NULL, CFGF_NONE),
|
||||||
|
CFG_STR((char *) "align", (char *) "left", CFGF_NONE),
|
||||||
CFG_END()
|
CFG_END()
|
||||||
};
|
};
|
||||||
static cfg_opt_t widget_tasklist_opts[] =
|
static cfg_opt_t widget_tasklist_opts[] =
|
||||||
|
|
|
@ -33,6 +33,7 @@ extern AwesomeConf globalconf;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
int align;
|
||||||
XColor fg;
|
XColor fg;
|
||||||
XColor bg;
|
XColor bg;
|
||||||
} Data;
|
} Data;
|
||||||
|
@ -54,7 +55,7 @@ focustitle_draw(Widget *widget, DrawCtx *ctx, int offset, int used)
|
||||||
draw_text(ctx, widget->location, 0,
|
draw_text(ctx, widget->location, 0,
|
||||||
vscreen.statusbar->width - used,
|
vscreen.statusbar->width - used,
|
||||||
vscreen.statusbar->height,
|
vscreen.statusbar->height,
|
||||||
AlignLeft,
|
d->align,
|
||||||
widget->font->height / 2, widget->font, sel->name,
|
widget->font->height / 2, widget->font, sel->name,
|
||||||
d->fg, d->bg);
|
d->fg, d->bg);
|
||||||
if(sel->isfloating)
|
if(sel->isfloating)
|
||||||
|
@ -95,6 +96,8 @@ focustitle_new(Statusbar *statusbar, cfg_t *config)
|
||||||
else
|
else
|
||||||
d->bg = globalconf.screens[statusbar->screen].colors_selected[ColBG];
|
d->bg = globalconf.screens[statusbar->screen].colors_selected[ColBG];
|
||||||
|
|
||||||
|
d->align = draw_get_align(cfg_getstr(config, "align"));
|
||||||
|
|
||||||
if((buf = cfg_getstr(config, "font")))
|
if((buf = cfg_getstr(config, "font")))
|
||||||
w->font = XftFontOpenName(globalconf.display, get_phys_screen(statusbar->screen), buf);
|
w->font = XftFontOpenName(globalconf.display, get_phys_screen(statusbar->screen), buf);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue