diff --git a/config.c b/config.c index 64df2669..2efd37b2 100644 --- a/config.c +++ b/config.c @@ -375,6 +375,8 @@ config_parse_screen(cfg_t *cfg, int screen) virtscreen->statusbar->position = virtscreen->statusbar->dposition = statusbar_get_position_from_str(cfg_getstr(cfg_statusbar, "position")); + virtscreen->statusbar->height = cfg_getint(cfg_statusbar, "height"); + create_widgets(cfg_statusbar, virtscreen->statusbar); /* Layouts */ @@ -535,6 +537,7 @@ config_parse(const char *confpatharg) static cfg_opt_t statusbar_opts[] = { CFG_STR((char *) "position", (char *) "top", CFGF_NONE), + CFG_INT((char *) "height", 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), diff --git a/statusbar.c b/statusbar.c index eaf08bda..c57d4998 100644 --- a/statusbar.c +++ b/statusbar.c @@ -140,11 +140,15 @@ statusbar_init(int screen) &globalconf.screens[screen].padding); Statusbar *statusbar = globalconf.screens[screen].statusbar; - statusbar->height = globalconf.screens[screen].font->height * 1.5; + if(statusbar->height <= 0) + { + /* 1.5 as default factor, it fits nice but no one know why */ + statusbar->height = globalconf.screens[screen].font->height * 1.5; - for(widget = statusbar->widgets; widget; widget = widget->next) - if(widget->font) - statusbar->height = MAX(statusbar->height, widget->font->height); + for(widget = statusbar->widgets; widget; widget = widget->next) + if(widget->font) + statusbar->height = MAX(statusbar->height, widget->font->height * 1.5); + } if(statusbar->position == BarRight || statusbar->position == BarLeft) statusbar->width = area.height;