allow to set statusbar width
This commit is contained in:
parent
643407b5ea
commit
64e44421dd
2
config.c
2
config.c
|
@ -376,6 +376,7 @@ config_parse_screen(cfg_t *cfg, int screen)
|
||||||
statusbar_get_position_from_str(cfg_getstr(cfg_statusbar, "position"));
|
statusbar_get_position_from_str(cfg_getstr(cfg_statusbar, "position"));
|
||||||
|
|
||||||
virtscreen->statusbar->height = cfg_getint(cfg_statusbar, "height");
|
virtscreen->statusbar->height = cfg_getint(cfg_statusbar, "height");
|
||||||
|
virtscreen->statusbar->width = cfg_getint(cfg_statusbar, "width");
|
||||||
|
|
||||||
create_widgets(cfg_statusbar, virtscreen->statusbar);
|
create_widgets(cfg_statusbar, virtscreen->statusbar);
|
||||||
|
|
||||||
|
@ -538,6 +539,7 @@ config_parse(const char *confpatharg)
|
||||||
{
|
{
|
||||||
CFG_STR((char *) "position", (char *) "top", CFGF_NONE),
|
CFG_STR((char *) "position", (char *) "top", CFGF_NONE),
|
||||||
CFG_INT((char *) "height", 0, 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 *) "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 *) "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),
|
CFG_SEC((char *) "focustitle", widget_textbox_focus_opts, CFGF_TITLE | CFGF_MULTI | CFGF_NO_TITLE_DUPES),
|
||||||
|
|
11
statusbar.c
11
statusbar.c
|
@ -150,10 +150,13 @@ statusbar_init(int screen)
|
||||||
statusbar->height = MAX(statusbar->height, widget->font->height * 1.5);
|
statusbar->height = MAX(statusbar->height, widget->font->height * 1.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(statusbar->position == BarRight || statusbar->position == BarLeft)
|
if(statusbar->width <= 0)
|
||||||
statusbar->width = area.height;
|
{
|
||||||
else
|
if(statusbar->position == BarRight || statusbar->position == BarLeft)
|
||||||
statusbar->width = area.width;
|
statusbar->width = area.height;
|
||||||
|
else
|
||||||
|
statusbar->width = area.width;
|
||||||
|
}
|
||||||
|
|
||||||
statusbar->screen = screen;
|
statusbar->screen = screen;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue