allow to set statusbar width

This commit is contained in:
Julien Danjou 2007-12-30 18:55:46 +01:00
parent 643407b5ea
commit 64e44421dd
2 changed files with 9 additions and 4 deletions

View File

@ -376,6 +376,7 @@ config_parse_screen(cfg_t *cfg, int screen)
statusbar_get_position_from_str(cfg_getstr(cfg_statusbar, "position"));
virtscreen->statusbar->height = cfg_getint(cfg_statusbar, "height");
virtscreen->statusbar->width = cfg_getint(cfg_statusbar, "width");
create_widgets(cfg_statusbar, virtscreen->statusbar);
@ -538,6 +539,7 @@ config_parse(const char *confpatharg)
{
CFG_STR((char *) "position", (char *) "top", CFGF_NONE),
CFG_INT((char *) "height", 0, CFGF_NONE),
CFG_INT((char *) "width", 0, CFGF_NONE),
CFG_SEC((char *) "textbox", widget_textbox_focus_opts, CFGF_TITLE | CFGF_MULTI | CFGF_NO_TITLE_DUPES),
CFG_SEC((char *) "taglist", widget_taglist_opts, CFGF_TITLE | CFGF_MULTI | CFGF_NO_TITLE_DUPES),
CFG_SEC((char *) "focustitle", widget_textbox_focus_opts, CFGF_TITLE | CFGF_MULTI | CFGF_NO_TITLE_DUPES),

View File

@ -150,10 +150,13 @@ statusbar_init(int screen)
statusbar->height = MAX(statusbar->height, widget->font->height * 1.5);
}
if(statusbar->width <= 0)
{
if(statusbar->position == BarRight || statusbar->position == BarLeft)
statusbar->width = area.height;
else
statusbar->width = area.width;
}
statusbar->screen = screen;