mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
allow textbox to have special width
This commit is contained in:
parent
0eb4743385
commit
75c7d04adf
2 changed files with 6 additions and 1 deletions
1
config.c
1
config.c
|
@ -517,6 +517,7 @@ config_parse(const char *confpatharg)
|
|||
static cfg_opt_t widget_textbox_focus_opts[] =
|
||||
{
|
||||
CFG_SEC((char *) "mouse", mouse_generic_opts, CFGF_MULTI),
|
||||
CFG_INT((char *) "width", 0, CFGF_NONE),
|
||||
CFG_STR((char *) "text", (char *) NULL, CFGF_NONE),
|
||||
CFG_STR((char *) "fg", (char *) NULL, CFGF_NONE),
|
||||
CFG_STR((char *) "bg", (char *) NULL, CFGF_NONE),
|
||||
|
|
|
@ -48,7 +48,9 @@ textbox_draw(Widget *widget, DrawCtx *ctx, int offset,
|
|||
{
|
||||
Data *d = widget->data;
|
||||
|
||||
widget->width = textwidth(widget->font, d->text);
|
||||
if(!widget->width)
|
||||
widget->width = textwidth(widget->font, d->text);
|
||||
|
||||
widget->location = widget_calculate_offset(widget->statusbar->width,
|
||||
widget->width,
|
||||
offset,
|
||||
|
@ -91,6 +93,8 @@ textbox_new(Statusbar *statusbar, cfg_t *config)
|
|||
else
|
||||
d->bg = globalconf.screens[statusbar->screen].colors_normal[ColBG];
|
||||
|
||||
w->width = cfg_getint(config, "width");
|
||||
|
||||
if((buf = cfg_getstr(config, "font")))
|
||||
w->font = XftFontOpenName(globalconf.display, get_phys_screen(statusbar->screen), buf);
|
||||
|
||||
|
|
Loading…
Reference in a new issue