add align option to tasklist
This commit is contained in:
parent
7c716e0ec0
commit
a06d739dfb
1
config.c
1
config.c
|
@ -554,6 +554,7 @@ config_parse(const char *confpatharg)
|
||||||
CFG_STR((char *) "focus_fg", (char *) NULL, CFGF_NONE),
|
CFG_STR((char *) "focus_fg", (char *) NULL, CFGF_NONE),
|
||||||
CFG_STR((char *) "focus_bg", (char *) NULL, CFGF_NONE),
|
CFG_STR((char *) "focus_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_progressbar_bar_opts[] =
|
static cfg_opt_t widget_progressbar_bar_opts[] =
|
||||||
|
|
|
@ -34,6 +34,7 @@ extern AwesomeConf globalconf;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
int align;
|
||||||
XColor fg_sel;
|
XColor fg_sel;
|
||||||
XColor bg_sel;
|
XColor bg_sel;
|
||||||
XColor fg;
|
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,
|
draw_text(ctx, widget->location + box_width * i, 0,
|
||||||
box_width,
|
box_width,
|
||||||
vscreen.statusbar->height,
|
vscreen.statusbar->height,
|
||||||
AlignLeft,
|
d->align,
|
||||||
widget->font->height / 2, widget->font, c->name,
|
widget->font->height / 2, widget->font, c->name,
|
||||||
d->fg_sel, d->bg_sel);
|
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,
|
draw_text(ctx, widget->location + box_width * i, 0,
|
||||||
box_width,
|
box_width,
|
||||||
vscreen.statusbar->height,
|
vscreen.statusbar->height,
|
||||||
AlignLeft,
|
d->align,
|
||||||
widget->font->height / 2, widget->font, c->name,
|
widget->font->height / 2, widget->font, c->name,
|
||||||
d->fg, d->bg);
|
d->fg, d->bg);
|
||||||
if(sel->isfloating)
|
if(sel->isfloating)
|
||||||
|
@ -178,6 +179,8 @@ tasklist_new(Statusbar *statusbar, cfg_t *config)
|
||||||
else
|
else
|
||||||
d->fg_sel = globalconf.screens[statusbar->screen].colors_selected[ColFG];
|
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")))
|
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